Refactoring
This commit is contained in:
parent
28f2d885f3
commit
5c4172a949
|
@ -56,7 +56,8 @@ add_subdirectory(${MATPLOTPLUSPLUS_SOURCE_DIR} ${MATPLOTPLUSPLUS_BINARY_DIR})
|
|||
##threed-beam-fea
|
||||
set(threed-beam-fea_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/threed-beam-fea)
|
||||
download_project(PROJ threed-beam-fea
|
||||
GIT_REPOSITORY https://github.com/IasonManolas/threed-beam-fea.git
|
||||
# GIT_REPOSITORY https://github.com/IasonManolas/threed-beam-fea.git
|
||||
GIT_REPOSITORY https://gitea-s2i2s.isti.cnr.it/manolas/threed-beam-fea.git
|
||||
GIT_TAG master
|
||||
BINARY_DIR ${threed-beam-fea_BINARY_DIR}
|
||||
PREFIX ${EXTERNAL_DEPS_DIR}
|
||||
|
|
|
@ -214,13 +214,13 @@ struct Settings
|
|||
jsonFile.close();
|
||||
}
|
||||
|
||||
bool load(const std::filesystem::path &jsonFilepath)
|
||||
bool load(const std::filesystem::path &loadFromPath)
|
||||
{
|
||||
assert(std::filesystem::is_directory(loadFromPath));
|
||||
//Load optimal X
|
||||
nlohmann::json json;
|
||||
std::filesystem::path jsonFilepath(
|
||||
std::filesystem::path(loadFromPath).append(JsonKeys::filename));
|
||||
std::filesystem::path(loadFromPath).append(defaultFilename));
|
||||
if (!std::filesystem::exists(jsonFilepath)) {
|
||||
std::cerr << "Optimization settings could not be loaded because input filepath does "
|
||||
"not exist:"
|
||||
|
@ -670,7 +670,7 @@ struct Settings
|
|||
continue;
|
||||
}
|
||||
// Load full pattern files
|
||||
for (const auto &fileEntry : filesystem::directory_iterator(
|
||||
for (const auto &fileEntry : std::filesystem::directory_iterator(
|
||||
std::filesystem::path(simulationScenarioPath).append("Full"))) {
|
||||
const auto filepath = fileEntry.path();
|
||||
if (filepath.extension() == ".json") {
|
||||
|
@ -781,8 +781,8 @@ struct Settings
|
|||
const double beamWidth = std::sqrt(A);
|
||||
const double beamHeight = beamWidth;
|
||||
CrossSectionType elementDimensions(beamWidth, beamHeight);
|
||||
for (int ei = 0; ei < pTiledReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pTiledReducedPattern_simulationMesh->elements[ei];
|
||||
for (int ei = 0; ei < pReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pReducedPattern_simulationMesh->elements[ei];
|
||||
e.setDimensions(elementDimensions);
|
||||
}
|
||||
}
|
||||
|
@ -792,8 +792,8 @@ struct Settings
|
|||
if (optimalXVariables.contains(ymLabel)) {
|
||||
const double E = optimalXVariables.at(ymLabel);
|
||||
const ElementMaterial elementMaterial(poissonsRatio, E);
|
||||
for (int ei = 0; ei < pTiledReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pTiledReducedPattern_simulationMesh->elements[ei];
|
||||
for (int ei = 0; ei < pReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pReducedPattern_simulationMesh->elements[ei];
|
||||
e.setMaterial(elementMaterial);
|
||||
}
|
||||
}
|
||||
|
@ -801,8 +801,8 @@ struct Settings
|
|||
const std::string JLabel = "J";
|
||||
if (optimalXVariables.contains(JLabel)) {
|
||||
const double J = optimalXVariables.at(JLabel);
|
||||
for (int ei = 0; ei < pTiledReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pTiledReducedPattern_simulationMesh->elements[ei];
|
||||
for (int ei = 0; ei < pReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pReducedPattern_simulationMesh->elements[ei];
|
||||
e.dimensions.inertia.J = J;
|
||||
}
|
||||
}
|
||||
|
@ -810,8 +810,8 @@ struct Settings
|
|||
const std::string I2Label = "I2";
|
||||
if (optimalXVariables.contains(I2Label)) {
|
||||
const double I2 = optimalXVariables.at(I2Label);
|
||||
for (int ei = 0; ei < pTiledReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pTiledReducedPattern_simulationMesh->elements[ei];
|
||||
for (int ei = 0; ei < pReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pReducedPattern_simulationMesh->elements[ei];
|
||||
e.dimensions.inertia.I2 = I2;
|
||||
}
|
||||
}
|
||||
|
@ -819,12 +819,12 @@ struct Settings
|
|||
const std::string I3Label = "I3";
|
||||
if (optimalXVariables.contains(I3Label)) {
|
||||
const double I3 = optimalXVariables.at(I3Label);
|
||||
for (int ei = 0; ei < pTiledReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pTiledReducedPattern_simulationMesh->elements[ei];
|
||||
for (int ei = 0; ei < pReducedPattern_simulationMesh->EN(); ei++) {
|
||||
Element &e = pReducedPattern_simulationMesh->elements[ei];
|
||||
e.dimensions.inertia.I3 = I3;
|
||||
}
|
||||
}
|
||||
pTiledReducedPattern_simulationMesh->reset();
|
||||
pReducedPattern_simulationMesh->reset();
|
||||
}
|
||||
|
||||
#if POLYSCOPE_DEFINED
|
||||
|
|
Loading…
Reference in New Issue