Increased axial scenario max displacemnet to 0.04. Refactoring
This commit is contained in:
parent
1e384c14a7
commit
476d1fef59
15
src/main.cpp
15
src/main.cpp
|
@ -68,9 +68,17 @@ int main(int argc, char *argv[])
|
||||||
// settings_optimization.save(optimizationSettingsFilePath.parent_path());
|
// settings_optimization.save(optimizationSettingsFilePath.parent_path());
|
||||||
// std::cout << "Save settings to:" << optimizationSettingsFilePath << std::endl;
|
// std::cout << "Save settings to:" << optimizationSettingsFilePath << std::endl;
|
||||||
#else
|
#else
|
||||||
settings_optimization.load(optimizationSettingsFilePath);
|
// settings_optimization.load(optimizationSettingsFilePath);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
// settings_optimization.normalizationStrategy
|
||||||
|
// = ReducedModelOptimization::Settings::NormalizationStrategy::NonNormalized;
|
||||||
|
settings_optimization.optimizationStrategy = {{ReducedModelOptimization::A,
|
||||||
|
ReducedModelOptimization::I2,
|
||||||
|
ReducedModelOptimization::I3,
|
||||||
|
ReducedModelOptimization::J,
|
||||||
|
ReducedModelOptimization::R,
|
||||||
|
ReducedModelOptimization::Theta}};
|
||||||
// settings_optimization.setDefault();
|
// settings_optimization.setDefault();
|
||||||
// settings_optimization.rotationNormalizationEpsilon = 0;
|
// settings_optimization.rotationNormalizationEpsilon = 0;
|
||||||
|
|
||||||
|
@ -152,7 +160,6 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POLYSCOPE_DEFINED
|
#ifdef POLYSCOPE_DEFINED
|
||||||
ReducedModelEvaluator::evaluateReducedModel(optimizationResults);
|
|
||||||
std::vector<std::string> scenarioLabels(
|
std::vector<std::string> scenarioLabels(
|
||||||
optimizationResults.objectiveValue.perSimulationScenario_total.size());
|
optimizationResults.objectiveValue.perSimulationScenario_total.size());
|
||||||
const double colorAxial = 1;
|
const double colorAxial = 1;
|
||||||
|
@ -202,8 +209,10 @@ int main(int argc, char *argv[])
|
||||||
.append("perScenarioObjectiveValues.png"));
|
.append("perScenarioObjectiveValues.png"));
|
||||||
// optimizationResults.saveMeshFiles();
|
// optimizationResults.saveMeshFiles();
|
||||||
std::cout << "Saved results to:" << resultsOutputDir << std::endl;
|
std::cout << "Saved results to:" << resultsOutputDir << std::endl;
|
||||||
optimizationResults.draw();
|
// optimizationResults.draw();
|
||||||
|
|
||||||
|
const auto evaluationResults = ReducedModelEvaluator::evaluateReducedModel(optimizationResults);
|
||||||
|
ReducedModelEvaluator::printResults(evaluationResults, optimizationResults.label);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,218 @@
|
||||||
|
#include "csvfile.hpp"
|
||||||
|
#include "drmsimulationmodel.hpp"
|
||||||
|
#include "edgemesh.hpp"
|
||||||
|
#include "reducedmodelevaluator.hpp"
|
||||||
|
#include "reducedmodeloptimizer.hpp"
|
||||||
|
#include "simulationhistoryplotter.hpp"
|
||||||
|
#include "trianglepattterntopology.hpp"
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
#include <chrono>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <iostream>
|
||||||
|
#include <iterator>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
#include <vcg/complex/algorithms/update/position.h>
|
||||||
|
|
||||||
|
#ifdef POLYSCOPE_DEFINED
|
||||||
|
#include "polyscope/curve_network.h"
|
||||||
|
#include "polyscope/point_cloud.h"
|
||||||
|
#include "polyscope/polyscope.h"
|
||||||
|
#endif
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
|
// ReducedModelOptimization::Results optResults;
|
||||||
|
// optResults.load("/home/iason/Desktop/finding_submissionCode/"
|
||||||
|
// "build-ReducedModelOptimization-Clang-RelWithDebInfo/OptimizationResults/"
|
||||||
|
// "ConvergedJobs/12@single_reduced(100000_1.20)");
|
||||||
|
// ReducedModelEvaluator::evaluateReducedModel(optResults);
|
||||||
|
if (argc <= 5) {
|
||||||
|
=======
|
||||||
|
#ifdef POLYSCOPE_DEFINED
|
||||||
|
// ReducedModelOptimization::Results optResults;
|
||||||
|
// optResults.load("/home/iason/Desktop/selectionOfPatterns_0.2To1.6/selectionOfPatterns/1.2/"
|
||||||
|
// "ConvergedJobs/12@single_reduced(100000_1.20)");
|
||||||
|
// ReducedModelEvaluator::evaluateReducedModel(optResults);
|
||||||
|
// return 0;
|
||||||
|
#endif
|
||||||
|
if (argc < 3) {
|
||||||
|
>>>>>>> potentialEnergyError
|
||||||
|
std::cerr << "Wrong number of input parameters. Expects at least 4 input parameters."
|
||||||
|
"Usage:\n"
|
||||||
|
"1)full pattern file path\n"
|
||||||
|
"2)reduced pattern file path\n"
|
||||||
|
"3)Optimization results directory path\n"
|
||||||
|
"4)[optional]Intermediate results directory path\n"
|
||||||
|
"5)[optional]Optimization settings json file path\n"
|
||||||
|
"Exiting.."
|
||||||
|
<< std::endl;
|
||||||
|
std::cerr << "Input arguments are:" << std::endl;
|
||||||
|
std::copy(argv + 1, argv + argc, std::ostream_iterator<const char *>(std::cout, "\n"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Populate the pattern pair to be optimized
|
||||||
|
const int interfaceNodeIndex = 3;
|
||||||
|
////Full pattern
|
||||||
|
const std::string filepath_fullPattern = argv[1];
|
||||||
|
PatternGeometry fullPattern(filepath_fullPattern);
|
||||||
|
// fullPattern.prependToLabel(std::to_string(fullPattern.EN()) + "#");
|
||||||
|
fullPattern.scale(0.03, interfaceNodeIndex);
|
||||||
|
////Reduced pattern
|
||||||
|
const std::string filepath_reducedPattern = argv[2];
|
||||||
|
PatternGeometry reducedPattern(filepath_reducedPattern);
|
||||||
|
reducedPattern.scale(0.03, interfaceNodeIndex);
|
||||||
|
|
||||||
|
// Set the optization settings
|
||||||
|
ReducedModelOptimization::Settings settings_optimization;
|
||||||
|
if (argc > 5) {
|
||||||
|
const std::filesystem::path optimizationSettingsFilePath = argv[5];
|
||||||
|
if (!std::filesystem::exists(optimizationSettingsFilePath)) {
|
||||||
|
std::cerr << "Input optimization settings file does not exist:"
|
||||||
|
<< optimizationSettingsFilePath << std::endl;
|
||||||
|
}
|
||||||
|
#ifdef POLYSCOPE_DEFINED
|
||||||
|
// settings_optimization.save(optimizationSettingsFilePath.parent_path());
|
||||||
|
// std::cout << "Save settings to:" << optimizationSettingsFilePath << std::endl;
|
||||||
|
#else
|
||||||
|
settings_optimization.load(optimizationSettingsFilePath);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
// settings_optimization.setDefault();
|
||||||
|
// settings_optimization.rotationNormalizationEpsilon = 0;
|
||||||
|
|
||||||
|
// Optimize pairthere
|
||||||
|
const std::string optimizationName = std::to_string(fullPattern.EN()) + "#"
|
||||||
|
+ fullPattern.getLabel();
|
||||||
|
const std::string optimizationResultsDirectory = argv[3];
|
||||||
|
std::string resultsOutputDir;
|
||||||
|
bool optimizationResultFolderExists = false;
|
||||||
|
const std::filesystem::path crashedJobsDirPath(
|
||||||
|
std::filesystem::path(optimizationResultsDirectory)
|
||||||
|
.append("CrashedJobs")
|
||||||
|
.append(optimizationName));
|
||||||
|
if (std::filesystem::exists(crashedJobsDirPath)) {
|
||||||
|
resultsOutputDir = crashedJobsDirPath.string();
|
||||||
|
optimizationResultFolderExists = true;
|
||||||
|
}
|
||||||
|
const std::filesystem::path convergedJobsDirPath(
|
||||||
|
std::filesystem::path(optimizationResultsDirectory)
|
||||||
|
.append("ConvergedJobs")
|
||||||
|
.append(optimizationName));
|
||||||
|
if (std::filesystem::exists(convergedJobsDirPath)) {
|
||||||
|
resultsOutputDir = convergedJobsDirPath.string();
|
||||||
|
optimizationResultFolderExists = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReducedModelOptimization::Results optimizationResults;
|
||||||
|
constexpr bool shouldReoptimize = true;
|
||||||
|
bool optimizationAlreadyComputed = false;
|
||||||
|
if (!shouldReoptimize && optimizationResultFolderExists) {
|
||||||
|
const bool resultsWereSuccessfullyLoaded = optimizationResults.load(resultsOutputDir);
|
||||||
|
if (resultsWereSuccessfullyLoaded && optimizationResults.settings == settings_optimization) {
|
||||||
|
optimizationAlreadyComputed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!optimizationAlreadyComputed) {
|
||||||
|
auto start = std::chrono::system_clock::now();
|
||||||
|
const std::vector<size_t> numberOfNodesPerSlot{1, 0, 0, 2, 1, 2, 1};
|
||||||
|
assert(interfaceNodeIndex == numberOfNodesPerSlot[0] + numberOfNodesPerSlot[3]);
|
||||||
|
ReducedModelOptimizer optimizer(numberOfNodesPerSlot);
|
||||||
|
const bool input_intermediateResultsDirectoryDefined = argc == 5;
|
||||||
|
if (input_intermediateResultsDirectoryDefined) {
|
||||||
|
optimizer.setIntermediateResultsDirectoryPath(std::filesystem::path(argv[4]));
|
||||||
|
}
|
||||||
|
optimizer.initializePatterns(fullPattern,
|
||||||
|
reducedPattern,
|
||||||
|
settings_optimization.variablesRanges);
|
||||||
|
optimizer.optimize(settings_optimization, optimizationResults);
|
||||||
|
optimizationResults.label = optimizationName;
|
||||||
|
optimizationResults.baseTriangleFullPattern.copy(fullPattern);
|
||||||
|
optimizationResults.settings = settings_optimization;
|
||||||
|
auto end = std::chrono::system_clock::now();
|
||||||
|
auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
|
||||||
|
optimizationResults.time = elapsed.count() / 1000.0;
|
||||||
|
|
||||||
|
if (!optimizationResults.wasSuccessful) {
|
||||||
|
// resultsOutputDir = crashedJobsDirPath.string();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
resultsOutputDir = convergedJobsDirPath.string();
|
||||||
|
optimizationResults.save(resultsOutputDir, true);
|
||||||
|
csvFile csv_resultsLocalFile(std::filesystem::path(resultsOutputDir).append("results.csv"),
|
||||||
|
true);
|
||||||
|
csvFile csv_results({}, false);
|
||||||
|
std::vector<csvFile *> csvVector{&csv_resultsLocalFile, &csv_results};
|
||||||
|
csv_results << "Name";
|
||||||
|
csv_resultsLocalFile << "Name";
|
||||||
|
optimizationResults.writeHeaderTo(csvVector);
|
||||||
|
settings_optimization.writeHeaderTo(csv_results);
|
||||||
|
csv_results << endrow;
|
||||||
|
csv_resultsLocalFile << endrow;
|
||||||
|
csv_results << optimizationName;
|
||||||
|
csv_resultsLocalFile << optimizationName;
|
||||||
|
optimizationResults.writeResultsTo(csvVector);
|
||||||
|
settings_optimization.writeSettingsTo(csv_results);
|
||||||
|
csv_results << endrow;
|
||||||
|
csv_resultsLocalFile << endrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef POLYSCOPE_DEFINED
|
||||||
|
ReducedModelEvaluator::evaluateReducedModel(optimizationResults);
|
||||||
|
std::vector<std::string> scenarioLabels(
|
||||||
|
optimizationResults.objectiveValue.perSimulationScenario_total.size());
|
||||||
|
const double colorAxial = 1;
|
||||||
|
const double colorShear = 3;
|
||||||
|
const double colorBending = 5;
|
||||||
|
const double colorDome = 0.1;
|
||||||
|
const double colorSaddle = 0;
|
||||||
|
std::vector<double> colors(
|
||||||
|
optimizationResults.objectiveValue.perSimulationScenario_total.size());
|
||||||
|
for (int scenarioIndex = 0; scenarioIndex < scenarioLabels.size(); scenarioIndex++) {
|
||||||
|
scenarioLabels[scenarioIndex]
|
||||||
|
= optimizationResults.reducedPatternSimulationJobs[scenarioIndex]->getLabel();
|
||||||
|
if (scenarioLabels[scenarioIndex].rfind("Axial", 0) == 0) {
|
||||||
|
colors[scenarioIndex] = colorAxial;
|
||||||
|
|
||||||
|
} else if (scenarioLabels[scenarioIndex].rfind("Shear", 0) == 0) {
|
||||||
|
colors[scenarioIndex] = colorShear;
|
||||||
|
|
||||||
|
} else if (scenarioLabels[scenarioIndex].rfind("Bending", 0) == 0) {
|
||||||
|
colors[scenarioIndex] = colorBending;
|
||||||
|
|
||||||
|
} else if (scenarioLabels[scenarioIndex].rfind("Dome", 0) == 0) {
|
||||||
|
colors[scenarioIndex] = colorDome;
|
||||||
|
} else if (scenarioLabels[scenarioIndex].rfind("Saddle", 0) == 0) {
|
||||||
|
colors[scenarioIndex] = colorSaddle;
|
||||||
|
} else {
|
||||||
|
std::cerr << "Label could not be identified" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std::vector<double> y(optimizationResults.objectiveValue.perSimulationScenario_total.size());
|
||||||
|
for (int scenarioIndex = 0; scenarioIndex < scenarioLabels.size(); scenarioIndex++) {
|
||||||
|
y[scenarioIndex]
|
||||||
|
// = optimizationResults.objectiveValue.perSimulationScenario_rawTranslational[scenarioIndex]
|
||||||
|
// + optimizationResults.objectiveValue.perSimulationScenario_rawRotational[scenarioIndex];
|
||||||
|
= optimizationResults.objectiveValue
|
||||||
|
.perSimulationScenario_total_unweighted[scenarioIndex];
|
||||||
|
}
|
||||||
|
std::vector<double> x = matplot::linspace(0, y.size() - 1, y.size());
|
||||||
|
std::vector<double> markerSizes(y.size(), 5);
|
||||||
|
SimulationResultsReporter::createPlot("scenario index",
|
||||||
|
"error",
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
markerSizes,
|
||||||
|
colors,
|
||||||
|
std::filesystem::path(resultsOutputDir)
|
||||||
|
.append("perScenarioObjectiveValues.png"));
|
||||||
|
// optimizationResults.saveMeshFiles();
|
||||||
|
std::cout << "Saved results to:" << resultsOutputDir << std::endl;
|
||||||
|
optimizationResults.draw();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -140,27 +140,27 @@ double ReducedModelOptimizer::computeError(
|
||||||
const double &scenarioWeight,
|
const double &scenarioWeight,
|
||||||
const Settings::ObjectiveWeights &objectiveWeights)
|
const Settings::ObjectiveWeights &objectiveWeights)
|
||||||
{
|
{
|
||||||
// const double translationalError
|
|
||||||
// = computeDisplacementError(simulationResults_fullPattern.displacements,
|
|
||||||
// simulationResults_reducedPattern.displacements,
|
|
||||||
// reducedToFullInterfaceViMap,
|
|
||||||
// normalizationFactor_translationalDisplacement);
|
|
||||||
const double translationalError
|
const double translationalError
|
||||||
= computeRawTranslationalError(simulationResults_fullPattern.displacements,
|
= computeDisplacementError(simulationResults_fullPattern.displacements,
|
||||||
simulationResults_reducedPattern.displacements,
|
simulationResults_reducedPattern.displacements,
|
||||||
reducedToFullInterfaceViMap);
|
reducedToFullInterfaceViMap,
|
||||||
|
normalizationFactor_translationalDisplacement);
|
||||||
|
// const double translationalError
|
||||||
|
// = computeRawTranslationalError(simulationResults_fullPattern.displacements,
|
||||||
|
// simulationResults_reducedPattern.displacements,
|
||||||
|
// reducedToFullInterfaceViMap);
|
||||||
|
|
||||||
// std::cout << "normalization factor:" << normalizationFactor_rotationalDisplacement << std::endl;
|
// std::cout << "normalization factor:" << normalizationFactor_rotationalDisplacement << std::endl;
|
||||||
// std::cout << "trans error:" << translationalError << std::endl;
|
// std::cout << "trans error:" << translationalError << std::endl;
|
||||||
// const double rotationalError
|
|
||||||
// = computeRotationalError(simulationResults_fullPattern.rotationalDisplacementQuaternion,
|
|
||||||
// simulationResults_reducedPattern.rotationalDisplacementQuaternion,
|
|
||||||
// reducedToFullInterfaceViMap,
|
|
||||||
// normalizationFactor_rotationalDisplacement);
|
|
||||||
const double rotationalError
|
const double rotationalError
|
||||||
= computeRawRotationalError(simulationResults_fullPattern.rotationalDisplacementQuaternion,
|
= computeRotationalError(simulationResults_fullPattern.rotationalDisplacementQuaternion,
|
||||||
simulationResults_reducedPattern.rotationalDisplacementQuaternion,
|
simulationResults_reducedPattern.rotationalDisplacementQuaternion,
|
||||||
reducedToFullInterfaceViMap);
|
reducedToFullInterfaceViMap,
|
||||||
|
normalizationFactor_rotationalDisplacement);
|
||||||
|
// const double rotationalError
|
||||||
|
// = computeRawRotationalError(simulationResults_fullPattern.rotationalDisplacementQuaternion,
|
||||||
|
// simulationResults_reducedPattern.rotationalDisplacementQuaternion,
|
||||||
|
// reducedToFullInterfaceViMap);
|
||||||
// std::cout << "rot error:" << rotationalError<< std::endl;
|
// std::cout << "rot error:" << rotationalError<< std::endl;
|
||||||
const double simulationError = objectiveWeights.translational * translationalError
|
const double simulationError = objectiveWeights.translational * translationalError
|
||||||
+ objectiveWeights.rotational * rotationalError;
|
+ objectiveWeights.rotational * rotationalError;
|
||||||
|
@ -975,7 +975,11 @@ ReducedModelOptimizer::getFullPatternMaxSimulationForces(
|
||||||
.append(m_pFullPatternSimulationMesh->getLabel() + ".json"));
|
.append(m_pFullPatternSimulationMesh->getLabel() + ".json"));
|
||||||
const bool fullPatternScenarioMagnitudesExist = std::filesystem::exists(
|
const bool fullPatternScenarioMagnitudesExist = std::filesystem::exists(
|
||||||
patternMaxForceMagnitudesFilePath);
|
patternMaxForceMagnitudesFilePath);
|
||||||
|
#ifdef POLYSCOPE_DEFINED
|
||||||
constexpr bool recomputeMagnitudes = true;
|
constexpr bool recomputeMagnitudes = true;
|
||||||
|
#else
|
||||||
|
constexpr bool recomputeMagnitudes = true;
|
||||||
|
#endif
|
||||||
if (fullPatternScenarioMagnitudesExist && !recomputeMagnitudes) {
|
if (fullPatternScenarioMagnitudesExist && !recomputeMagnitudes) {
|
||||||
nlohmann::json json;
|
nlohmann::json json;
|
||||||
std::ifstream ifs(patternMaxForceMagnitudesFilePath.string());
|
std::ifstream ifs(patternMaxForceMagnitudesFilePath.string());
|
||||||
|
@ -984,6 +988,7 @@ ReducedModelOptimizer::getFullPatternMaxSimulationForces(
|
||||||
= static_cast<std::array<double, NumberOfBaseSimulationScenarios>>(json.at("maxMagn"));
|
= static_cast<std::array<double, NumberOfBaseSimulationScenarios>>(json.at("maxMagn"));
|
||||||
return fullPatternSimulationScenarioMaxMagnitudes;
|
return fullPatternSimulationScenarioMaxMagnitudes;
|
||||||
}
|
}
|
||||||
|
|
||||||
//#endif
|
//#endif
|
||||||
fullPatternSimulationScenarioMaxMagnitudes = computeFullPatternMaxSimulationForces(
|
fullPatternSimulationScenarioMaxMagnitudes = computeFullPatternMaxSimulationForces(
|
||||||
desiredBaseSimulationScenarioIndices);
|
desiredBaseSimulationScenarioIndices);
|
||||||
|
@ -1102,7 +1107,7 @@ void ReducedModelOptimizer::runOptimization(const Settings &settings,
|
||||||
arma::mat xMin_arma(global.xMin);
|
arma::mat xMin_arma(global.xMin);
|
||||||
arma::mat xMax_arma(global.xMax);
|
arma::mat xMax_arma(global.xMax);
|
||||||
// ens::LBestPSO optimizer(64, xMin_arma, xMax_arma, 1000);
|
// ens::LBestPSO optimizer(64, xMin_arma, xMax_arma, 1000);
|
||||||
ens::LBestPSO optimizer(200,
|
ens::LBestPSO optimizer(500,
|
||||||
xMin_arma,
|
xMin_arma,
|
||||||
xMax_arma,
|
xMax_arma,
|
||||||
settings.numberOfFunctionCalls,
|
settings.numberOfFunctionCalls,
|
||||||
|
@ -1407,7 +1412,6 @@ double fullPatternMaxSimulationForceRotationalObjective(const double &forceMagni
|
||||||
settings);
|
settings);
|
||||||
const double &desiredRotationAngle = global.desiredMaxRotationAngle;
|
const double &desiredRotationAngle = global.desiredMaxRotationAngle;
|
||||||
double error;
|
double error;
|
||||||
#ifdef POLYSCOPE_DEFINED
|
|
||||||
// job.pMesh->setLabel("initial");
|
// job.pMesh->setLabel("initial");
|
||||||
// job.pMesh->registerForDrawing();
|
// job.pMesh->registerForDrawing();
|
||||||
// results.registerForDrawing();
|
// results.registerForDrawing();
|
||||||
|
@ -1446,6 +1450,7 @@ double fullPatternMaxSimulationForceRotationalObjective(const double &forceMagni
|
||||||
// job.save(outputPath);
|
// job.save(outputPath);
|
||||||
// settings.save(outputPath);
|
// settings.save(outputPath);
|
||||||
|
|
||||||
|
#ifdef POLYSCOPE_DEFINED
|
||||||
std::cout << "Force:" << forceMagnitude << " Error is:" << vcg::math::ToDeg(error) << std::endl;
|
std::cout << "Force:" << forceMagnitude << " Error is:" << vcg::math::ToDeg(error) << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return error;
|
return error;
|
||||||
|
@ -1562,7 +1567,7 @@ double ReducedModelOptimizer::computeFullPatternMaxSimulationForce(
|
||||||
|
|
||||||
switch (scenario) {
|
switch (scenario) {
|
||||||
case Axial:
|
case Axial:
|
||||||
global.desiredMaxDisplacementValue = 0.03 * baseTriangleHeight;
|
global.desiredMaxDisplacementValue = 0.04 * baseTriangleHeight;
|
||||||
break;
|
break;
|
||||||
case Shear:
|
case Shear:
|
||||||
global.desiredMaxDisplacementValue = 0.04 * baseTriangleHeight;
|
global.desiredMaxDisplacementValue = 0.04 * baseTriangleHeight;
|
||||||
|
@ -1923,7 +1928,11 @@ void ReducedModelOptimizer::optimize(
|
||||||
.append(m_pFullPatternSimulationMesh->getLabel())
|
.append(m_pFullPatternSimulationMesh->getLabel())
|
||||||
.append(pFullPatternSimulationJob->getLabel()));
|
.append(pFullPatternSimulationJob->getLabel()));
|
||||||
// .append(pFullPatternSimulationJob->getLabel() + ".json")
|
// .append(pFullPatternSimulationJob->getLabel() + ".json")
|
||||||
constexpr bool recomputeFullPatternResults = false;
|
#ifdef POLYSCOPE_DEFINED
|
||||||
|
constexpr bool recomputeFullPatternResults = true;
|
||||||
|
#else
|
||||||
|
constexpr bool recomputeFullPatternResults = true;
|
||||||
|
#endif
|
||||||
SimulationResults fullPatternResults;
|
SimulationResults fullPatternResults;
|
||||||
if (!recomputeFullPatternResults && std::filesystem::exists(jobResultsDirectoryPath)) {
|
if (!recomputeFullPatternResults && std::filesystem::exists(jobResultsDirectoryPath)) {
|
||||||
fullPatternResults.load(std::filesystem::path(jobResultsDirectoryPath).append("Results"),
|
fullPatternResults.load(std::filesystem::path(jobResultsDirectoryPath).append("Results"),
|
||||||
|
@ -2035,10 +2044,10 @@ void ReducedModelOptimizer::optimize(
|
||||||
global.fullPatternSimulationJobs[0]->pMesh->unregister();
|
global.fullPatternSimulationJobs[0]->pMesh->unregister();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (global.optimizationSettings.normalizationStrategy
|
// if (global.optimizationSettings.normalizationStrategy
|
||||||
== Settings::NormalizationStrategy::Epsilon) {
|
// == Settings::NormalizationStrategy::Epsilon) {
|
||||||
computeObjectiveValueNormalizationFactors();
|
computeObjectiveValueNormalizationFactors();
|
||||||
}
|
// }
|
||||||
#ifdef POLYSCOPE_DEFINED
|
#ifdef POLYSCOPE_DEFINED
|
||||||
std::cout << "Running reduced model optimization" << std::endl;
|
std::cout << "Running reduced model optimization" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue