diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..317a487e45bcd37a77b6f6f83d2c23f4593683e2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,144 @@ +project(VegaFEM) + +set(VegaFEM_VERSION 4.0) + +# Minimum required version of CMake +cmake_minimum_required(VERSION 3.0) + +# Add Options +option(VegaFEM_BUILD_UTILITIES "Build utility classes in addition to libraries." ON) + +option(VegaFEM_BUILD_MODEL_REDUCTION "Build model-reduction" OFF) + +option(VegaFEM_BUILD_RIGID_BODIES "Build Rigid body support" OFF) + +option(VegaFEM_ENABLE_OpenGL_SUPPORT "Should modules that require OpenGL be enabled?" ON) + +option(VegaFEM_ENABLE_PTHREADS_SUPPORT "Use multithreading (pthread)" ON) + +option(VegaFEM_ENABLE_ExpoKit_SUPPORT "Should matrix classes use ExpoKit for exponentiation?" OFF) +# TODO: define USE_EXPOKIT if enabled + +option(VegaFEM_ENABLE_OpenGL_SUPPORT "Should modules that require OpenGL be enabled?" ON) + +option(VegaFEM_ENABLE_CLOTH_SUPPORT "Should modules that require OpenGL be enabled?" ON) + +set(VegaFEM_MODULES +basicAlgorithms +configFile +constrainedDOFs +corotationalLinearFEM +distanceField +elasticForceModel +exactArithmetic +forceModel +getopts +graph +hashTable +imageIO +immersionMesher +integrator +integratorSparse +interpolationCoordinates +isotropicHyperelasticFEM +laplacianMatrix +libiglInterface +listIO +massSpringSystem +matrixIO +mesh +mesher +minivector +objMesh +performanceCounter +polarDecomposition +quaternion +sceneObject +shapeEdit +sparseMatrix +sparseSolver +stencilForceModel +stvk +virtualTets +volumetricMesh +windingNumber +) + +if (VegaFEM_BUILD_MODEL_REDUCTION) + set(VegaFEM_Modules + ${VegaFEM_Modules} + integratorDense + matrix + modalMatrix + reducedElasticForceModel + reducedForceModel + reducedStvk + ) +endif() +if (VegaFEM_ENABLE_OpenGL_SUPPORT) + set(VegaFEM_Modules + ${VegaFEM_Modules} + camera + lighting + sceneObject + glslPhong + ) + if (VegaFEM_ENABLE_Cg_SUPPORT) + set(VegaFEM_Modules + ${VegaFEM_Modules} + objMeshGPUDeformer + ) + endif() + if (VegaFEM_BUILD_MODEL_REDUCTION) + set(VegaFEM_Modules + ${VegaFEM_Modules} + openGLHelper + sceneObjectReduced + renderVolumetricMesh + ) + endif() +endif() + + +add_subdirectory(libraries) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/VegaFEMConfigVersion.cmake" + VERSION ${VegaFEM_VERSION} + COMPATIBILITY AnyNewerVersion +) + +export(EXPORT VegaFEMTargets + FILE "${CMAKE_CURRENT_BINARY_DIR}/VegaFEMTargets.cmake" + NAMESPACE VegaFEM:: +) +configure_file( + CMake/VegaFEMConfig.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/VegaFEMConfig.cmake" + @ONLY +) + +# Install step + +set(ConfigPackageLocation lib/cmake/VegaFEM) +install(EXPORT VegaFEMTargets + FILE VegaFEMTargets.cmake + NAMESPACE VegaFEM:: + DESTINATION ${ConfigPackageLocation} +) + +install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/VegaFEMConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/VegaFEMConfigVersion.cmake" + DESTINATION + ${ConfigPackageLocation} + COMPONENT + Devel +) + + +if(VegaFEM_BUILD_UTILITIES) + add_subdirectory(utilities) +endif(VegaFEM_BUILD_UTILITIES) \ No newline at end of file diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..752951576732849beb9f5f9f525ccdb961e60677 --- /dev/null +++ b/libraries/CMakeLists.txt @@ -0,0 +1,5 @@ +foreach(mod ${VegaFEM_Modules}) + add_subdirectory(${mod}) +endforeach() + +add_subdirectory(include) \ No newline at end of file diff --git a/libraries/animationHelper/CMakeLists.txt b/libraries/animationHelper/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1ef1b6c2f2bb071f09bc3292d7ed348f8040b4b6 --- /dev/null +++ b/libraries/animationHelper/CMakeLists.txt @@ -0,0 +1,20 @@ +vega_add_library(animationHelper + SOURCES + handleControl.cpp + handleScript.cpp + simulationRecorder.cpp + PUBLIC_HEADERS + handleControl.h + handleScript.h + simulationRecorder.h +) +target_link_libraries(camera + PUBLIC + ${OPENGL_LIBRARIES} + matrixIO + minivector + basicAlgorithms + camera + openGLHelper + listIO +) diff --git a/libraries/basicAlgorithms/CMakeLists.txt b/libraries/basicAlgorithms/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1d70d02a52e3428ff0c0940c5678cd1c4822b86a --- /dev/null +++ b/libraries/basicAlgorithms/CMakeLists.txt @@ -0,0 +1,9 @@ +file(GLOB_RECURSE basicAlgorithms_sources "*.cpp") +file(GLOB_RECURSE basicAlgorithms_headers "*.h") + +vega_add_library(basicAlgorithms + SOURCES + ${basicAlgorithms_sources} + PUBLIC_HEADERS + ${basicAlgorithms_headers} +) diff --git a/libraries/camera/CMakeLists.txt b/libraries/camera/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..136f6ceded1a1fb539690e39f7829b588570438c --- /dev/null +++ b/libraries/camera/CMakeLists.txt @@ -0,0 +1,12 @@ +vega_add_library(camera + SOURCES + camera.cpp + cameraChangeLoad.cpp + PUBLIC_HEADERS + camera.h + cameraChangeLoad.h +) +target_link_libraries(camera + PUBLIC + ${OPENGL_LIBRARIES} +) diff --git a/libraries/clothBW/CMakeLists.txt b/libraries/clothBW/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8169583b80362292c90eb94631ed10885f979b83 --- /dev/null +++ b/libraries/clothBW/CMakeLists.txt @@ -0,0 +1,29 @@ +set(clothbw_sources + clothBW.cpp + clothBWFromObjMesh.cpp +) + +set(clothbw_headers + clothBW.h + clothBWFromObjMesh.h +) + +if(VegaFEM_ENABLE_PTHREADS_SUPPORT) + list(APPEND clothbw_headers clothBWMT.h) + list(APPEND clothbw_sources clothBWMT.cpp) +endif() + +vega_add_library(clothBW + SOURCES + ${clothbw_sources} + PUBLIC_HEADERS + ${clothbw_headers} +) + +target_link_libraries(clothBW + PUBLIC + objMesh + minivector + sparseMatrix + #Threads::Threads +) \ No newline at end of file diff --git a/libraries/configFile/CMakeLists.txt b/libraries/configFile/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1bcfcc76400399fb0716d2f0e4e033dcafa01e92 --- /dev/null +++ b/libraries/configFile/CMakeLists.txt @@ -0,0 +1,11 @@ +vega_add_library(configFile + SOURCES + configFile.cpp + PUBLIC_HEADERS + configFile.h +) + +target_link_libraries(configFile + PUBLIC + minivector +) diff --git a/libraries/constrainedDOFs/CMakeLists.txt b/libraries/constrainedDOFs/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..a463d3ab18fef5cf96f91be3d37afda71496a6c7 --- /dev/null +++ b/libraries/constrainedDOFs/CMakeLists.txt @@ -0,0 +1,6 @@ +vega_add_library(constrainedDOFs + SOURCES + constrainedDOFs.cpp + PUBLIC_HEADERS + constrainedDOFs.h +) diff --git a/libraries/corotationalLinearFEM/CMakeLists.txt b/libraries/corotationalLinearFEM/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..07fae829362abb58dce6440acb3304658efaeb57 --- /dev/null +++ b/libraries/corotationalLinearFEM/CMakeLists.txt @@ -0,0 +1,21 @@ +set(corotationallinearfem_sources + corotationalLinearFEM.cpp) + +set(corotationallinearfem_headers + corotationalLinearFEM.h) + +vega_add_library(corotationalLinearFEM + SOURCES + ${corotationallinearfem_sources} + PUBLIC_HEADERS + ${corotationallinearfem_headers} +) + +target_link_libraries(corotationalLinearFEM + PUBLIC + polarDecomposition + volumetricMesh + sparseMatrix + INTERFACE + minivector +) diff --git a/libraries/dirList.txt b/libraries/dirList.txt new file mode 100644 index 0000000000000000000000000000000000000000..77b9c2387b37f90b745de7f8696d35da7bf6b78e --- /dev/null +++ b/libraries/dirList.txt @@ -0,0 +1,56 @@ +animationHelper/DONE +basicAlgorithms/DONE +camera/DONE +clothBW/DONE +configFile/DONE +constrainedDOFs/DONE +corotationalLinearFEM/DONE +distanceField/DONE +elasticForceModel/DONE +exactArithmetic/DONE +forceModel/DONE +getopts/DONE +glslPhong/DONE +glui/ +graph/DONE +hashTable/DONE +imageIO/DONE +immersionMesher/DONE +include/DONE +integrator/DONE (spooles) +integratorDense/DONE (blas is a dependency?) +integratorSparse/DONE (INTERFACE) +interpolationCoordinates/DONE +isotropicHyperelasticFEM/DONE (removed RT and thread::thread is a dep) +laplacianMatrix/DONE +libiglInterface/ +lighting/ +listIO/ +massSpringSystem/ +matrix/ +matrixIO/ +mesh/ +mesher/ +minivector/ +modalMatrix/ +objMesh/ +objMeshGPUDeformer/ +openGLHelper/ +performanceCounter/ +polarDecomposition/ +quaternion/ +reducedElasticForceModel/ +reducedForceModel/ +reducedStvk/ +renderVolumetricMesh/ +rigidBodyDynamics/ +sceneObject/ +sceneObjectReduced/ +shapeEdit/ +sparseMatrix/ +sparseSolver/ +stencilForceModel/ +stvk/ +virtualTets/ +volumetricMesh/ +windingNumber/ diff --git a/libraries/distanceField/CMakeLists.txt b/libraries/distanceField/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..a44f8e7122142bc0bd3c78453020bbd0b2c3fd0d --- /dev/null +++ b/libraries/distanceField/CMakeLists.txt @@ -0,0 +1,20 @@ +file(GLOB_RECURSE distanceField_sources "*.cpp") +file(GLOB_RECURSE distanceField_headers "*.h") + +vega_add_library(distanceField + SOURCES + ${distanceField_sources} + PUBLIC_HEADERS + ${distanceField_headers} +) + +target_link_libraries(distanceField + PUBLIC + objMesh + mesh + hashTable + minivector + performanceCounter + matrixIO + configFile +) diff --git a/libraries/elasticForceModel/CMakeLists.txt b/libraries/elasticForceModel/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..ad51897ca4dd7c17a8700aa71009840770f3d352 --- /dev/null +++ b/libraries/elasticForceModel/CMakeLists.txt @@ -0,0 +1,38 @@ +set(EFM_SRCS + corotationalLinearFEMForceModel.cpp + massSpringSystemForceModel.cpp + StVKForceModel.cpp + isotropicHyperelasticFEMForceModel.cpp + linearFEMForceModel.cpp +) + +vega_add_library(elasticForceModel + SOURCES + corotationalLinearFEMForceModel.cpp + massSpringSystemForceModel.cpp + StVKForceModel.cpp + isotropicHyperelasticFEMForceModel.cpp + linearFEMForceModel.cpp + clothBWForceModel.cpp + PUBLIC_HEADERS + corotationalLinearFEMForceModel.h + massSpringSystemForceModel.h + StVKForceModel.h + isotropicHyperelasticFEMForceModel.h + linearFEMForceModel.h + clothBWForceModel.h +) + +target_link_libraries(elasticForceModel + PUBLIC + forceModel + corotationalLinearFEM + massSpringSystem + stvk + isotropicHyperelasticFEM + clothBW + INTERFACE + sparseMatrix + minivector + volumetricMesh +) diff --git a/libraries/exactArithmetic/CMakeLists.txt b/libraries/exactArithmetic/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..551b2072ada717f3ecc2e257518c2a93d5364b5b --- /dev/null +++ b/libraries/exactArithmetic/CMakeLists.txt @@ -0,0 +1,9 @@ +file(GLOB_RECURSE EA_sources "*.cpp") +file(GLOB_RECURSE EA_headers "*.h") + +vega_add_library(exactArithmatic + SOURCES + ${EA_sources} + PUBLIC_HEADERS + ${EA_headers} +) diff --git a/libraries/forceModel/CMakeLists.txt b/libraries/forceModel/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8e3aa3b7fa4ede62a411e3a06932a70848ec450b --- /dev/null +++ b/libraries/forceModel/CMakeLists.txt @@ -0,0 +1,12 @@ +vega_add_library(forceModel + SOURCES + forceModel.cpp + finiteDifferenceTester.cpp + PUBLIC_HEADERS + forceModel.h + finiteDifferenceTester.h +) +target_link_libraries(forceModel + PUBLIC + sparseMatrix +) diff --git a/libraries/getopts/CMakeLists.txt b/libraries/getopts/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f6f9b7d737ceeccb23fd0d0f2ae918b6c6551706 --- /dev/null +++ b/libraries/getopts/CMakeLists.txt @@ -0,0 +1,8 @@ +vega_add_library(getops + SOURCES + getopts.cpp + commandLineParser.cpp + PUBLIC_HEADERS + getopts.h + commandLineParser.h +) \ No newline at end of file diff --git a/libraries/glslPhong/CMakeLists.txt b/libraries/glslPhong/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc9f0424bf3c772fd223b73a74a235d4d57721c6 --- /dev/null +++ b/libraries/glslPhong/CMakeLists.txt @@ -0,0 +1,11 @@ +vega_add_library(glslPhong + SOURCES + glslPhong.cpp + PUBLIC_HEADERS + glslPhong.h +) +target_link_libraries(glslPhong + PUBLIC + ${OPENGL_LIBRARIES} + Threads::Threads +) diff --git a/libraries/graph/CMakeLists.txt b/libraries/graph/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..35262ad793193acb96283a4cbdbdc18d3fe309a1 --- /dev/null +++ b/libraries/graph/CMakeLists.txt @@ -0,0 +1,11 @@ +vega_add_library(graph + SOURCES + graph.cpp + PUBLIC_HEADERS + graph.h +) +target_link_libraries(graph + PUBLIC + sparseMatrix + matrixIO +) diff --git a/libraries/hashTable/CMakeLists.txt b/libraries/hashTable/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..27ff2bbd99923295e409439640a768e0757d65fa --- /dev/null +++ b/libraries/hashTable/CMakeLists.txt @@ -0,0 +1,6 @@ +vega_add_library(hashTable + SOURCES + hashTable.cpp + PUBLIC_HEADERS + hashTable.h +) diff --git a/libraries/imageIO/CMakeLists.txt b/libraries/imageIO/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..0ce6866479097f38c55cbdaf8d57740a7551f8b6 --- /dev/null +++ b/libraries/imageIO/CMakeLists.txt @@ -0,0 +1,7 @@ +vega_add_library(imageIO + SOURCES + imageIO.cpp + PUBLIC_HEADERS + imageFormats.h + imageIO.h +) diff --git a/libraries/immersionMesher/CMakeLists.txt b/libraries/immersionMesher/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..e6f57f343481e97c845b922670fefb3e1f365de7 --- /dev/null +++ b/libraries/immersionMesher/CMakeLists.txt @@ -0,0 +1,16 @@ +vega_add_library(immersionMesher + SOURCES + immersionMesher.cpp + immersionGraphNode.cpp + PUBLIC_HEADERS + immersionMesher.h + immersionGraphNode.h +) +target_link_libraries(immersionMesher + PUBLIC + virtualTets + exactArithmetic + mesh + basicAlgorithms + performanceCounter +) diff --git a/libraries/integrator/CMakeLists.txt b/libraries/integrator/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..d3be1f8b9b94c31bbdc3f3029fd24c59858e84c4 --- /dev/null +++ b/libraries/integrator/CMakeLists.txt @@ -0,0 +1,23 @@ +vega_add_library(integrator + SOURCES + integratorBase.cpp + getIntegratorSolver.cpp + PUBLIC_HEADERS + integratorBase.h + getIntegratorSolver.h + integratorSolverSelection.h +) +target_include_directories(integrator + PUBLIC + ${PARDISO_INCLUDE_DIRS} +) +target_link_libraries(integrator + PUBLIC + performanceCounter + insertRows + sparseSolver + forceModel + INTERFACE + sparseMatrix + insertRows +) diff --git a/libraries/integratorDense/CMakeLists.txt b/libraries/integratorDense/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6f8fbab3f6c7ff5db3497b93563014504a7bc0af --- /dev/null +++ b/libraries/integratorDense/CMakeLists.txt @@ -0,0 +1,25 @@ +vega_add_library(integratorDense + SOURCES + centralDifferencesDense.cpp + implicitBackwardEulerDense.cpp + implicitNewmarkDense.cpp + integratorBaseDense.cpp + PUBLIC_HEADERS + implicitNewmarkDenseMulti1D.h + integratorMulti1D.h + centralDifferencesDense.h + implicitBackwardEulerDense.h + implicitNewmarkDense.h + integratorBaseDense.h + IPIVC.h +) +target_link_libraries(integratorDense + PUBLIC + matrix + integrator + performanceCounter + reducedForceModel + ${BLAS} + ${CBLAS_LIBRARY} + ${LAPACK_LIBRARIES} +) diff --git a/libraries/integratorSparse/CMakeLists.txt b/libraries/integratorSparse/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4645bbb5639f3ff640eccbf858bc19d4917a6f58 --- /dev/null +++ b/libraries/integratorSparse/CMakeLists.txt @@ -0,0 +1,24 @@ +vega_add_library(integratorSparse + SOURCES + centralDifferencesSparse.cpp + eulerSparse.cpp + implicitBackwardEulerSparse.cpp + implicitNewmarkSparse.cpp + integratorBaseSparse.cpp + PUBLIC_HEADERS + centralDifferencesSparse.h + eulerSparse.h + implicitBackwardEulerSparse.h + implicitNewmarkSparse.h + integratorBaseSparse.h +) +target_link_libraries(integratorSparse + PUBLIC + integrator + performanceCounter + constrainedDOFs + sparseSolver + forceModel + INTERFACE + sparseMatrix +) diff --git a/libraries/interpolationCoordinates/CMakeLists.txt b/libraries/interpolationCoordinates/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f55522f79dc589e66d9fe183c0cb0db012411559 --- /dev/null +++ b/libraries/interpolationCoordinates/CMakeLists.txt @@ -0,0 +1,14 @@ +vega_add_library(interpolationCoordinates + SOURCES + barycentricCoordinates.cpp + PUBLIC_HEADERS + interpolationCoordinates.h + barycentricCoordinates.h +) +target_link_libraries(interpolationCoordinates + PUBLIC + minivector + objMesh + volumetricMesh + mesh +) diff --git a/libraries/isotropicHyperelasticFEM/CMakeLists.txt b/libraries/isotropicHyperelasticFEM/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..da4cc07fa77f07a00867ae53329199ba4731e812 --- /dev/null +++ b/libraries/isotropicHyperelasticFEM/CMakeLists.txt @@ -0,0 +1,43 @@ +set(isotropichyperelasticfem_srcs + isotropicMaterial.cpp + MooneyRivlinIsotropicMaterial.cpp + neoHookeanIsotropicMaterial.cpp + StVKIsotropicMaterial.cpp + homogeneousMooneyRivlinIsotropicMaterial.cpp + homogeneousStVKIsotropicMaterial.cpp + homogeneousNeoHookeanIsotropicMaterial.cpp + isotropicHyperelasticFEM.cpp + isotropicMaterialWithCompressionResistance.cpp + ) + +set(isotropichyperelasticfem_hdrs + MooneyRivlinIsotropicMaterial.h + StVKIsotropicMaterial.h + homogeneousMooneyRivlinIsotropicMaterial.h + homogeneousNeoHookeanIsotropicMaterial.h + homogeneousStVKIsotropicMaterial.h + isotropicHyperelasticFEM.h + isotropicMaterial.h + isotropicMaterialWithCompressionResistance.h + neoHookeanIsotropicMaterial.h + ) + + +#if(VegaFEM_ENABLE_PTHREADS_SUPPORT) +# list(APPEND isotropichyperelasticfem_hdrs isotropicHyperelasticFEMMT.h) +# list(APPEND isotropichyperelasticfem_srcs isotropicHyperelasticFEMMT.cpp) +#endif() + +vega_add_library(isotropicHyperelasticFEM + SOURCES + ${isotropichyperelasticfem_srcs} + PUBLIC_HEADERS + ${isotropichyperelasticfem_hdrs} +) +target_link_libraries(isotropicHyperelasticFEM + PUBLIC + minivector + volumetricMesh + sparseMatrix + Threads::Threads +) diff --git a/libraries/laplacianMatrix/CMakeLists.txt b/libraries/laplacianMatrix/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..74b09f516cc8ad507687362e2a6fffa165eb3be8 --- /dev/null +++ b/libraries/laplacianMatrix/CMakeLists.txt @@ -0,0 +1,13 @@ +vega_add_library(laplacianMatrix + SOURCES + grlaplacianMatrixaph.cpp + PUBLIC_HEADERS + laplacianMatrix.h +) +target_link_libraries(laplacianMatrix + PUBLIC + parseMatrix + volumetricMesh + minivector + sparseSolver +)