Refactoring. Removed the settings of CMAKE_SYSTEM to windows
This commit is contained in:
parent
f598d6a46e
commit
f140b52986
|
|
@ -4,8 +4,6 @@ set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER}")
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER}")
|
||||||
|
|
||||||
SET(CMAKE_SYSTEM_NAME Windows)
|
|
||||||
|
|
||||||
#Add the project cmake scripts to the module path
|
#Add the project cmake scripts to the module path
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
|
@ -28,23 +26,12 @@ endif()
|
||||||
##Create directory for the external libraries
|
##Create directory for the external libraries
|
||||||
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})
|
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})
|
||||||
|
|
||||||
##Polyscope
|
|
||||||
if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||||
set(USE_POLYSCOPE FALSE)
|
set(USE_POLYSCOPE FALSE)
|
||||||
else()
|
else()
|
||||||
set(USE_POLYSCOPE TRUE)
|
set(USE_POLYSCOPE TRUE)
|
||||||
endif()
|
endif()
|
||||||
if(${USE_POLYSCOPE})
|
set(MYSOURCES_STATIC_LINK FALSE)
|
||||||
download_project(PROJ POLYSCOPE
|
|
||||||
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
|
|
||||||
GIT_TAG master
|
|
||||||
PREFIX ${EXTERNAL_DEPS_DIR}
|
|
||||||
${UPDATE_DISCONNECTED_IF_AVAILABLE}
|
|
||||||
)
|
|
||||||
add_subdirectory(${POLYSCOPE_SOURCE_DIR} ${POLYSCOPE_BINARY_DIR})
|
|
||||||
add_compile_definitions(POLYSCOPE_DEFINED)
|
|
||||||
endif()
|
|
||||||
set(MYSOURCES_STATIC_LINK NOT ${USE_POLYSCOPE})
|
|
||||||
|
|
||||||
set(MYSOURCES_SOURCE_DIR "/home/iason/Coding/Libraries/MySources")
|
set(MYSOURCES_SOURCE_DIR "/home/iason/Coding/Libraries/MySources")
|
||||||
if (EXISTS ${MYSOURCES_SOURCE_DIR})
|
if (EXISTS ${MYSOURCES_SOURCE_DIR})
|
||||||
|
|
@ -59,6 +46,20 @@ download_project(PROJ MYSOURCES
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(${MYSOURCES_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/MySourcesBinDir)
|
add_subdirectory(${MYSOURCES_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/MySourcesBinDir)
|
||||||
|
|
||||||
|
##Polyscope
|
||||||
|
if(${USE_POLYSCOPE})
|
||||||
|
download_project(PROJ POLYSCOPE
|
||||||
|
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
|
||||||
|
GIT_TAG master
|
||||||
|
PREFIX ${EXTERNAL_DEPS_DIR}
|
||||||
|
${UPDATE_DISCONNECTED_IF_AVAILABLE}
|
||||||
|
)
|
||||||
|
if(NOT EXISTS ${POLYSCOPE_BINARY_DIR})
|
||||||
|
add_subdirectory(${POLYSCOPE_SOURCE_DIR} ${POLYSCOPE_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
add_compile_definitions(POLYSCOPE_DEFINED)
|
||||||
|
endif()
|
||||||
|
|
||||||
#dlib
|
#dlib
|
||||||
set(DLIB_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/dlib_bin)
|
set(DLIB_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/dlib_bin)
|
||||||
file(MAKE_DIRECTORY ${DLIB_BIN_DIR})
|
file(MAKE_DIRECTORY ${DLIB_BIN_DIR})
|
||||||
|
|
@ -103,8 +104,13 @@ target_include_directories(${PROJECT_NAME}
|
||||||
|
|
||||||
|
|
||||||
target_link_directories(${PROJECT_NAME} PRIVATE ${MYSOURCES_SOURCE_DIR}/boost_graph/libs/)
|
target_link_directories(${PROJECT_NAME} PRIVATE ${MYSOURCES_SOURCE_DIR}/boost_graph/libs/)
|
||||||
if(${USE_POLYSCOPE})
|
if(${MYSOURCES_STATIC_LINK})
|
||||||
target_link_libraries(${PROJECT_NAME} polyscope Eigen3::Eigen dlib::dlib MySources)
|
message("Linking statically")
|
||||||
else()
|
|
||||||
target_link_libraries(${PROJECT_NAME} -static Eigen3::Eigen dlib::dlib MySources)
|
target_link_libraries(${PROJECT_NAME} -static Eigen3::Eigen dlib::dlib MySources)
|
||||||
|
else()
|
||||||
|
if(${USE_POLYSCOPE})
|
||||||
|
message("Using polyscope")
|
||||||
|
target_link_libraries(${PROJECT_NAME} polyscope)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${PROJECT_NAME} Eigen3::Eigen dlib::dlib MySources)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@ int main(int argc, char *argv[]) {
|
||||||
csv_results << endrow;
|
csv_results << endrow;
|
||||||
} else {
|
} else {
|
||||||
resultsOutputDir = crashedJobsDirPath.string();
|
resultsOutputDir = crashedJobsDirPath.string();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
optimizationResults.save(resultsOutputDir, true);
|
optimizationResults.save(resultsOutputDir, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1393,12 +1393,12 @@ double fullPatternMaxSimulationForceRotationalObjective(const double &forceMagni
|
||||||
- desiredRotationAngle);
|
- desiredRotationAngle);
|
||||||
saveJobToPath = "../convergingJobs";
|
saveJobToPath = "../convergingJobs";
|
||||||
}
|
}
|
||||||
std::filesystem::path outputPath(std::filesystem::path(saveJobToPath)
|
// std::filesystem::path outputPath(std::filesystem::path(saveJobToPath)
|
||||||
.append(job.pMesh->getLabel())
|
// .append(job.pMesh->getLabel())
|
||||||
.append("mag_" + global.currentScenarioName));
|
// .append("mag_" + global.currentScenarioName));
|
||||||
std::filesystem::create_directories(outputPath);
|
// std::filesystem::create_directories(outputPath);
|
||||||
job.save(outputPath);
|
// job.save(outputPath);
|
||||||
settings.save(outputPath);
|
// settings.save(outputPath);
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -1694,8 +1694,8 @@ void ReducedModelOptimizer::optimize(
|
||||||
DRMSimulationModel::Settings simulationSettings;
|
DRMSimulationModel::Settings simulationSettings;
|
||||||
// simulationSettings.maxDRMIterations = 200000;
|
// simulationSettings.maxDRMIterations = 200000;
|
||||||
// simulationSettings.totalTranslationalKineticEnergyThreshold = 1e-8;
|
// simulationSettings.totalTranslationalKineticEnergyThreshold = 1e-8;
|
||||||
// simulationSettings.viscousDampingFactor = 5e-3;
|
simulationSettings.viscousDampingFactor = 5e-3;
|
||||||
// simulationSettings.useKineticDamping = true;
|
simulationSettings.useKineticDamping = true;
|
||||||
|
|
||||||
// simulationSettings.averageResidualForcesCriterionThreshold = 1e-5;
|
// simulationSettings.averageResidualForcesCriterionThreshold = 1e-5;
|
||||||
// simulationSettings.viscousDampingFactor = 1e-3;
|
// simulationSettings.viscousDampingFactor = 1e-3;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue