MySources/reducedmodelevaluator.hpp

218 lines
6.5 KiB
C++

#ifndef REDUCEDMODELEVALUATOR_HPP
#define REDUCEDMODELEVALUATOR_HPP
#include "reducedmodeloptimizer_structs.hpp"
class ReducedModelEvaluator
{
public:
enum CSVExportingDirection { Vertical = 0, Horizontal };
enum CSVExportingData {
raw_drm2Reduced = 0,
norm_drm2Reduced,
raw_and_norm_drm2Reduced,
NumberOfDataTypes
};
inline static std::array<std::string, NumberOfDataTypes>
csvExportingDataStrings{"raw_drm2Reduced", "norm_drm2Reduced", "raw_and_norm_drm2Reduced"};
struct Settings
{
CSVExportingDirection exportingDirection{Horizontal};
CSVExportingData exportingData{norm_drm2Reduced};
bool shouldWriteHeader{true};
std::string resultsLabel;
};
inline static constexpr int NumberOfEvaluationScenarios{22};
struct Results
{
std::array<double, NumberOfEvaluationScenarios> distances_drm2reduced;
std::array<double, NumberOfEvaluationScenarios> distances_normalizedDrm2reduced;
std::array<std::string, NumberOfEvaluationScenarios> evaluationScenarioLabels;
};
ReducedModelEvaluator();
Results evaluateReducedModel(
ReducedModelOptimization::Results &optimizationResult,
const std::filesystem::path &scenariosDirectoryPath,
// const std::filesystem::path &reducedPatternFilePath,
const std::filesystem::path &fullPatternTessellatedResultsDirectoryPath);
Results evaluateReducedModel(ReducedModelOptimization::Results &optimizationResult);
static void printResultsVertically(const ReducedModelEvaluator::Results &evaluationResults,
csvFile &csvOutput);
static void printResults(const ReducedModelEvaluator::Results &evaluationResults,
const std::string &resultsLabel);
inline static std::array<std::string, NumberOfEvaluationScenarios> scenariosTestSetLabels{
"22Hex_randomBending0",
"22Hex_randomBending1",
"22Hex_randomBending2",
// "22Hex_randomBending3",
"22Hex_randomBending4",
"22Hex_randomBending5",
// "22Hex_randomBending6",
// "22Hex_randomBending7",
"22Hex_randomBending8",
"22Hex_randomBending9",
"22Hex_randomBending10",
"22Hex_randomBending11",
"22Hex_randomBending12",
// "22Hex_randomBending13",
// "22Hex_randomBending14",
// "22Hex_randomBending15",
"22Hex_randomBending16",
"22Hex_randomBending17",
"22Hex_randomBending18",
"22Hex_randomBending19",
// "22Hex_randomBending20",
"22Hex_bending_0.005N",
"22Hex_bending_0.01N",
"22Hex_bending_0.03N",
// "22Hex_bending_0.05N",
"22Hex_pullOppositeVerts_0.05N",
"22Hex_pullOppositeVerts_0.1N",
// "22Hex_pullOppositeVerts_0.3N",
//#ifdef POLYSCOPE_DEFINED
// "22Hex_shear_2N",
// "22Hex_shear_5N",
// "22Hex_axial_10N",
// "22Hex_axial_20N",
//#else
// "notUsed_22Hex_shear_2N",
// "notUsed_22Hex_shear_5N",
// "notUsed_22Hex_axial_10N",
// "notUsed_22Hex_axial_20N",
//#endif
"22Hex_cylinder_0.05N",
"22Hex_cylinder_0.1N",
"22Hex_s_0.05N",
// "22Hex_s_0.1N"
};
static void printResultsHorizontally(const Results &evaluationResults, csvFile &csvOutput);
static void printResults(const Results &evaluationResults,
const Settings &settings,
csvFile &csvOutput);
static void printHeader(const Settings &settings, csvFile &csvOutput);
// static double evaluateOptimizationSettings(
// const ReducedModelOptimization::Settings &optimizationSettings,
// const std::vector<std::shared_ptr<PatternGeometry>> &pPatterns,
// std::vector<ReducedModelEvaluator::Results> &patternEvaluationResults);
std::shared_ptr<VCGPolyMesh> pTileIntoSurface;
inline static constexpr char *tileIntoSurfaceFileContent = R"~(OFF
46 66 0
-0.0745923 0.03573945 0
-0.07464622 0.02191801 0
-0.06264956 0.02878203 0
-0.08658896 0.02887542 0
-0.06270347 0.01496059 0
-0.06259564 0.04260346 0
-0.08664289 0.01505398 0
-0.08653505 0.04269686 0
-0.0507068 0.02182462 0
-0.07453838 0.04956088 0
-0.05065288 0.03564605 0
-0.09858564 0.02201139 0
-0.09853172 0.03583283 0
-0.06254172 0.0564249 0
-0.05059896 0.04946748 0
-0.08648112 0.0565183 0
-0.09847781 0.04965428 0
-0.03871013 0.02868864 0
-0.07448447 0.06338232 0
-0.03865621 0.04251007 0
-0.1105284 0.02896881 0
-0.1104745 0.04279025 0
-0.03876406 0.0148672 0
-0.05054504 0.06328891 0
-0.0624878 0.07024634 0
-0.03860229 0.0563315 0
-0.1105823 0.01514738 0
-0.08642721 0.07033974 0
-0.09842389 0.06347572 0
-0.1104206 0.05661169 0
-0.07443054 0.07720376 0
-0.05049112 0.07711035 0
-0.03854837 0.07015293 0
-0.06243387 0.08406778 0
-0.08637329 0.08416118 0
-0.09836997 0.07729716 0
-0.1103666 0.07043312 0
-0.07437663 0.09102518 0
-0.03849445 0.08397438 0
-0.0504372 0.0909318 0
-0.06237995 0.09788923 0
-0.08631937 0.09798261 0
-0.09831604 0.09111859 0
-0.1103127 0.08425456 0
-0.03844052 0.09779582 0
-0.1102588 0.09807601 0
3 0 1 2
3 3 1 0
3 4 2 1
3 5 0 2
3 3 6 1
3 3 0 7
3 8 2 4
3 5 9 0
3 10 5 2
3 3 11 6
3 7 0 9
3 12 3 7
3 10 2 8
3 5 13 9
3 10 14 5
3 12 11 3
3 7 9 15
3 12 7 16
3 10 8 17
3 14 13 5
3 18 9 13
3 19 14 10
3 12 20 11
3 18 15 9
3 16 7 15
3 21 12 16
3 22 17 8
3 19 10 17
3 23 13 14
3 18 13 24
3 19 25 14
3 21 20 12
3 26 11 20
3 18 27 15
3 16 15 28
3 21 16 29
3 23 24 13
3 23 14 25
3 30 18 24
3 30 27 18
3 15 27 28
3 29 16 28
3 23 31 24
3 23 25 32
3 30 24 33
3 30 34 27
3 35 28 27
3 29 28 36
3 23 32 31
3 24 31 33
3 30 33 37
3 30 37 34
3 35 27 34
3 35 36 28
3 32 38 31
3 33 31 39
3 40 37 33
3 34 37 41
3 35 34 42
3 35 43 36
3 38 39 31
3 40 33 39
3 34 41 42
3 35 42 43
3 44 39 38
3 45 43 42
)~";
};
#endif // REDUCEDMODELEVALUATOR_HPP