This commit is contained in:
Iason 2020-12-17 22:33:42 +02:00
parent 0508d7c055
commit 10fc282d78
2 changed files with 10 additions and 10 deletions

View File

@ -65,12 +65,12 @@ int main(int argc, char *argv[]) {
ReducedModelOptimizer optimizer(numberOfNodesPerSlot); ReducedModelOptimizer optimizer(numberOfNodesPerSlot);
FlatPattern pattern("/home/iason/Models/TestSet_validPatterns/59.ply"); // FlatPattern pattern("/home/iason/Models/TestSet_validPatterns/59.ply");
optimizer.initialize(pattern, *reducedModels[1], {}); // optimizer.initialize(pattern, *reducedModels[1], {});
// optimizer.setInitialGuess({0.10073746137216238, 1.9611251949927333, // optimizer.setInitialGuess
// 7.5940127902102867, 8.0260424171674654}); // ({0.050000000000000003, 4.0001308096448325, 4.2377893536538567,
optimizer.setInitialGuess({2, 2, 2, 2, 2}); // 5.6122373437520334});
Eigen::VectorXd optimalParameters = optimizer.optimize(3); // Eigen::VectorXd optimalParameters = optimizer.optimize(0);
std::string fullPatternsTestSetDirectory = std::string fullPatternsTestSetDirectory =
"/home/iason/Models/TestSet_validPatterns"; "/home/iason/Models/TestSet_validPatterns";

View File

@ -282,8 +282,8 @@ void ReducedModelOptimizer::computeMaps(
void ReducedModelOptimizer::createSimulationMeshes(FlatPattern &fullModel, void ReducedModelOptimizer::createSimulationMeshes(FlatPattern &fullModel,
FlatPattern &reducedModel) { FlatPattern &reducedModel) {
if (typeid(CrossSectionType) != typeid(RectangularBeamDimensions)) { if (typeid(CrossSectionType) != typeid(RectangularBeamDimensions)) {
std::cerr << "A rectangular cross section is expected." << std::endl; std::cerr << "Error: A rectangular cross section is expected." << std::endl;
return; terminate();
} }
m_pReducedPatternSimulationMesh = m_pReducedPatternSimulationMesh =
std::make_shared<SimulationMesh>(reducedModel); std::make_shared<SimulationMesh>(reducedModel);
@ -442,7 +442,7 @@ Eigen::VectorXd ReducedModelOptimizer::optimizeForSimulationJob(
"conditions is not recommended."); "conditions is not recommended.");
// Set initial guess of solution // Set initial guess of solution
std::vector<double> x(n, 2); std::vector<double> x(n, 4);
if (!initialGuess.empty()) { if (!initialGuess.empty()) {
x = initialGuess; x = initialGuess;
} // {0.10000000000000 001, 2, 1.9999999971613847, 6.9560343643347764}; } // {0.10000000000000 001, 2, 1.9999999971613847, 6.9560343643347764};
@ -450,7 +450,7 @@ Eigen::VectorXd ReducedModelOptimizer::optimizeForSimulationJob(
// {0.0001, 2, 2.000000005047502, 1.3055270196964464}; // {0.0001, 2, 2.000000005047502, 1.3055270196964464};
// {initialGuess(0), initialGuess(1), initialGuess(2), // {initialGuess(0), initialGuess(1), initialGuess(2),
// initialGuess(3)}; // initialGuess(3)};
const double xMin = 0.05; const double xMin = 0.12;
const double xMax = 10; const double xMax = 10;
// assert(x.end() == find_if(x.begin(), x.end(), [&](const double &d) { // assert(x.end() == find_if(x.begin(), x.end(), [&](const double &d) {
// return d >= xMax || d <= xMin; // return d >= xMax || d <= xMin;