Added bool variable for exportation of optimization results
This commit is contained in:
parent
596dbaba7e
commit
33774c546c
|
|
@ -284,7 +284,7 @@ struct Colors
|
||||||
inline static std::string Settings{"OptimizationSettings"};
|
inline static std::string Settings{"OptimizationSettings"};
|
||||||
};
|
};
|
||||||
|
|
||||||
void save(const string &saveToPath)
|
void save(const string &saveToPath, const bool shouldExportDebugFiles = false)
|
||||||
{
|
{
|
||||||
std::filesystem::create_directories(saveToPath);
|
std::filesystem::create_directories(saveToPath);
|
||||||
//clear directory
|
//clear directory
|
||||||
|
|
@ -326,19 +326,22 @@ struct Colors
|
||||||
/*TODO: Refactor since the meshes are saved for each simulation scenario although they do not change*/
|
/*TODO: Refactor since the meshes are saved for each simulation scenario although they do not change*/
|
||||||
//Save jobs and meshes for each simulation scenario
|
//Save jobs and meshes for each simulation scenario
|
||||||
|
|
||||||
|
if (shouldExportDebugFiles) {
|
||||||
//Save the reduced and full patterns
|
//Save the reduced and full patterns
|
||||||
const std::filesystem::path simulationJobsPath(
|
const std::filesystem::path simulationJobsPath(
|
||||||
std::filesystem::path(saveToPath).append("SimulationJobs"));
|
std::filesystem::path(saveToPath).append("SimulationJobs"));
|
||||||
const int numberOfSimulationJobs = fullPatternSimulationJobs.size();
|
const int numberOfSimulationJobs = fullPatternSimulationJobs.size();
|
||||||
for (int simulationScenarioIndex = 0; simulationScenarioIndex < numberOfSimulationJobs;
|
for (int simulationScenarioIndex = 0;
|
||||||
|
simulationScenarioIndex < numberOfSimulationJobs;
|
||||||
simulationScenarioIndex++) {
|
simulationScenarioIndex++) {
|
||||||
const std::shared_ptr<SimulationJob> &pFullPatternSimulationJob
|
const std::shared_ptr<SimulationJob> &pFullPatternSimulationJob
|
||||||
= fullPatternSimulationJobs[simulationScenarioIndex];
|
= fullPatternSimulationJobs[simulationScenarioIndex];
|
||||||
std::filesystem::path simulationJobFolderPath(
|
std::filesystem::path simulationJobFolderPath(
|
||||||
std::filesystem::path(simulationJobsPath).append(pFullPatternSimulationJob->label));
|
std::filesystem::path(simulationJobsPath)
|
||||||
|
.append(pFullPatternSimulationJob->label));
|
||||||
std::filesystem::create_directories(simulationJobFolderPath);
|
std::filesystem::create_directories(simulationJobFolderPath);
|
||||||
const auto fullPatternDirectoryPath = std::filesystem::path(simulationJobFolderPath)
|
const auto fullPatternDirectoryPath
|
||||||
.append("Full");
|
= std::filesystem::path(simulationJobFolderPath).append("Full");
|
||||||
std::filesystem::create_directory(fullPatternDirectoryPath);
|
std::filesystem::create_directory(fullPatternDirectoryPath);
|
||||||
pFullPatternSimulationJob->save(fullPatternDirectoryPath.string());
|
pFullPatternSimulationJob->save(fullPatternDirectoryPath.string());
|
||||||
const std::shared_ptr<SimulationJob> &pReducedPatternSimulationJob
|
const std::shared_ptr<SimulationJob> &pReducedPatternSimulationJob
|
||||||
|
|
@ -350,6 +353,7 @@ struct Colors
|
||||||
}
|
}
|
||||||
pReducedPatternSimulationJob->save(reducedPatternDirectoryPath.string());
|
pReducedPatternSimulationJob->save(reducedPatternDirectoryPath.string());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
settings.save(saveToPath);
|
settings.save(saveToPath);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue