From 8014d90b01518ec8c9d43ae532b3a9930f91f80f Mon Sep 17 00:00:00 2001 From: David Jourdan Date: Fri, 25 Jun 2021 11:34:25 +0200 Subject: [PATCH 1/4] move header files to libshell folder makes them easier to disambiguate when including from an external project --- include/{ => libshell}/BilayerStVKMaterial.h | 2 +- include/{ => libshell}/ElasticShell.h | 2 +- include/{ => libshell}/MaterialModel.h | 2 +- include/{ => libshell}/MeshConnectivity.h | 2 +- .../MidedgeAngleSinFormulation.h | 2 +- .../MidedgeAngleTanFormulation.h | 2 +- .../MidedgeAverageFormulation.h | 2 +- include/{ => libshell}/NeoHookeanMaterial.h | 2 +- include/{ => libshell}/RestState.h | 2 +- include/{ => libshell}/StVKMaterial.h | 2 +- .../{ => libshell}/TensionFieldStVKMaterial.h | 2 +- src/ElasticShell.cpp | 23 +++++++----------- src/GeometryDerivatives.cpp | 5 ++-- src/GeometryDerivatives.h | 2 +- src/MaterialModel/BilayerStVKMaterial.cpp | 16 ++++++------- src/MaterialModel/NeoHookeanMaterial.cpp | 16 ++++++------- src/MaterialModel/StVKMaterial.cpp | 16 ++++++------- .../TensionFieldStVKMaterial.cpp | 16 ++++++------- src/MeshConnectivity.cpp | 4 ++-- .../MidedgeAngleSinFormulation.cpp | 9 ++++--- .../MidedgeAngleTanFormulation.cpp | 9 ++++--- .../MidedgeAverageFormulation.cpp | 6 ++--- tests/main.cpp | 24 +++++++++---------- 23 files changed, 80 insertions(+), 88 deletions(-) rename include/{ => libshell}/BilayerStVKMaterial.h (99%) rename include/{ => libshell}/ElasticShell.h (99%) rename include/{ => libshell}/MaterialModel.h (99%) rename include/{ => libshell}/MeshConnectivity.h (99%) rename include/{ => libshell}/MidedgeAngleSinFormulation.h (99%) rename include/{ => libshell}/MidedgeAngleTanFormulation.h (99%) rename include/{ => libshell}/MidedgeAverageFormulation.h (99%) rename include/{ => libshell}/NeoHookeanMaterial.h (99%) rename include/{ => libshell}/RestState.h (99%) rename include/{ => libshell}/StVKMaterial.h (99%) rename include/{ => libshell}/TensionFieldStVKMaterial.h (99%) diff --git a/include/BilayerStVKMaterial.h b/include/libshell/BilayerStVKMaterial.h similarity index 99% rename from include/BilayerStVKMaterial.h rename to include/libshell/BilayerStVKMaterial.h index d4df704..8e98d01 100644 --- a/include/BilayerStVKMaterial.h +++ b/include/libshell/BilayerStVKMaterial.h @@ -53,6 +53,6 @@ namespace LibShell { }; -}; +} #endif \ No newline at end of file diff --git a/include/ElasticShell.h b/include/libshell/ElasticShell.h similarity index 99% rename from include/ElasticShell.h rename to include/libshell/ElasticShell.h index ae4078b..811d908 100644 --- a/include/ElasticShell.h +++ b/include/libshell/ElasticShell.h @@ -70,5 +70,5 @@ namespace LibShell { ET_BENDING = 2 }; }; -}; +} #endif diff --git a/include/MaterialModel.h b/include/libshell/MaterialModel.h similarity index 99% rename from include/MaterialModel.h rename to include/libshell/MaterialModel.h index e3e03c1..7132cb5 100644 --- a/include/MaterialModel.h +++ b/include/libshell/MaterialModel.h @@ -29,6 +29,6 @@ namespace LibShell { Eigen::Matrix* derivative, // F(face, i), then the three vertices opposite F(face,i), then the extra DOFs on oppositeEdge(face,i) Eigen::Matrix* hessian) const = 0; }; -}; +} #endif \ No newline at end of file diff --git a/include/MeshConnectivity.h b/include/libshell/MeshConnectivity.h similarity index 99% rename from include/MeshConnectivity.h rename to include/libshell/MeshConnectivity.h index 298e11c..a2b9a90 100644 --- a/include/MeshConnectivity.h +++ b/include/libshell/MeshConnectivity.h @@ -41,6 +41,6 @@ namespace LibShell { Eigen::MatrixXi EF; Eigen::MatrixXi EOpp; }; -}; +} #endif \ No newline at end of file diff --git a/include/MidedgeAngleSinFormulation.h b/include/libshell/MidedgeAngleSinFormulation.h similarity index 99% rename from include/MidedgeAngleSinFormulation.h rename to include/libshell/MidedgeAngleSinFormulation.h index 15e04d5..b17156f 100644 --- a/include/MidedgeAngleSinFormulation.h +++ b/include/libshell/MidedgeAngleSinFormulation.h @@ -28,6 +28,6 @@ namespace LibShell { Eigen::Matrix* derivative, // F(face, i), then the three vertices opposite F(face,i), then the thetas on oppositeEdge(face,i) std::vector < Eigen::Matrix >* hessian); }; -}; +} #endif diff --git a/include/MidedgeAngleTanFormulation.h b/include/libshell/MidedgeAngleTanFormulation.h similarity index 99% rename from include/MidedgeAngleTanFormulation.h rename to include/libshell/MidedgeAngleTanFormulation.h index 4f1b0f6..485cd86 100644 --- a/include/MidedgeAngleTanFormulation.h +++ b/include/libshell/MidedgeAngleTanFormulation.h @@ -27,6 +27,6 @@ namespace LibShell { Eigen::Matrix* derivative, // F(face, i), then the three vertices opposite F(face,i), then the thetas on oppositeEdge(face,i) std::vector >* hessian); }; -}; +} #endif \ No newline at end of file diff --git a/include/MidedgeAverageFormulation.h b/include/libshell/MidedgeAverageFormulation.h similarity index 99% rename from include/MidedgeAverageFormulation.h rename to include/libshell/MidedgeAverageFormulation.h index 428efe0..f03f90e 100644 --- a/include/MidedgeAverageFormulation.h +++ b/include/libshell/MidedgeAverageFormulation.h @@ -23,6 +23,6 @@ namespace LibShell { Eigen::Matrix* derivative, // F(face, i), then the three vertices opposite F(face,i), then the thetas on oppositeEdge(face,i) std::vector >* hessian); }; -}; +} #endif \ No newline at end of file diff --git a/include/NeoHookeanMaterial.h b/include/libshell/NeoHookeanMaterial.h similarity index 99% rename from include/NeoHookeanMaterial.h rename to include/libshell/NeoHookeanMaterial.h index d2f779e..16c9371 100644 --- a/include/NeoHookeanMaterial.h +++ b/include/libshell/NeoHookeanMaterial.h @@ -45,6 +45,6 @@ namespace LibShell { }; -}; +} #endif diff --git a/include/RestState.h b/include/libshell/RestState.h similarity index 99% rename from include/RestState.h rename to include/libshell/RestState.h index e6bb03f..19d0e18 100644 --- a/include/RestState.h +++ b/include/libshell/RestState.h @@ -44,6 +44,6 @@ namespace LibShell { MonolayerRestState layers[2]; }; -}; +} #endif \ No newline at end of file diff --git a/include/StVKMaterial.h b/include/libshell/StVKMaterial.h similarity index 99% rename from include/StVKMaterial.h rename to include/libshell/StVKMaterial.h index be84481..b6a699e 100644 --- a/include/StVKMaterial.h +++ b/include/libshell/StVKMaterial.h @@ -45,6 +45,6 @@ namespace LibShell { }; -}; +} #endif \ No newline at end of file diff --git a/include/TensionFieldStVKMaterial.h b/include/libshell/TensionFieldStVKMaterial.h similarity index 99% rename from include/TensionFieldStVKMaterial.h rename to include/libshell/TensionFieldStVKMaterial.h index 8877235..3a6e769 100644 --- a/include/TensionFieldStVKMaterial.h +++ b/include/libshell/TensionFieldStVKMaterial.h @@ -45,6 +45,6 @@ namespace LibShell { Eigen::Matrix* derivative, // F(face, i), then the three vertices opposite F(face,i), then the extra DOFs on oppositeEdge(face,i) Eigen::Matrix* hessian) const; }; -}; +} #endif \ No newline at end of file diff --git a/src/ElasticShell.cpp b/src/ElasticShell.cpp index b59c13a..8d26d25 100644 --- a/src/ElasticShell.cpp +++ b/src/ElasticShell.cpp @@ -1,19 +1,14 @@ -#include "../include/ElasticShell.h" -#include +#include "libshell/ElasticShell.h" +#include "libshell/MaterialModel.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleSinFormulation.h" +#include "libshell/MidedgeAngleTanFormulation.h" +#include "libshell/MidedgeAverageFormulation.h" +#include "libshell/RestState.h" +#include "GeometryDerivatives.h" #include -#include #include -#include "GeometryDerivatives.h" -#include -#include #include -#include -#include "../include/MeshConnectivity.h" -#include "../include/MaterialModel.h" -#include "../include/RestState.h" -#include "../include/MidedgeAngleSinFormulation.h" -#include "../include/MidedgeAngleTanFormulation.h" -#include "../include/MidedgeAverageFormulation.h" namespace LibShell { @@ -193,4 +188,4 @@ namespace LibShell { template class ElasticShell; template class ElasticShell; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/GeometryDerivatives.cpp b/src/GeometryDerivatives.cpp index 3d0a2dd..03a3513 100644 --- a/src/GeometryDerivatives.cpp +++ b/src/GeometryDerivatives.cpp @@ -1,8 +1,7 @@ #include "GeometryDerivatives.h" -#include "../include/MeshConnectivity.h" +#include "libshell/MeshConnectivity.h" #include #include -#include namespace LibShell { @@ -230,4 +229,4 @@ namespace LibShell { return result; } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/GeometryDerivatives.h b/src/GeometryDerivatives.h index e82cada..d232362 100644 --- a/src/GeometryDerivatives.h +++ b/src/GeometryDerivatives.h @@ -54,6 +54,6 @@ namespace LibShell { Eigen::Matrix* derivative, // F(face, i) std::vector >* hessian); -}; +} #endif diff --git a/src/MaterialModel/BilayerStVKMaterial.cpp b/src/MaterialModel/BilayerStVKMaterial.cpp index e4de0a4..6542171 100644 --- a/src/MaterialModel/BilayerStVKMaterial.cpp +++ b/src/MaterialModel/BilayerStVKMaterial.cpp @@ -1,12 +1,12 @@ -#include "../../include/BilayerStVKMaterial.h" -#include "../../include/MeshConnectivity.h" -#include +#include "libshell/BilayerStVKMaterial.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleSinFormulation.h" +#include "libshell/MidedgeAngleTanFormulation.h" +#include "libshell/MidedgeAverageFormulation.h" +#include "libshell/RestState.h" #include "../GeometryDerivatives.h" #include -#include "../../include/MidedgeAngleSinFormulation.h" -#include "../../include/MidedgeAngleTanFormulation.h" -#include "../../include/MidedgeAverageFormulation.h" -#include "../../include/RestState.h" +#include namespace LibShell { @@ -263,4 +263,4 @@ namespace LibShell { template class BilayerStVKMaterial; template class BilayerStVKMaterial; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/MaterialModel/NeoHookeanMaterial.cpp b/src/MaterialModel/NeoHookeanMaterial.cpp index 6028a17..045b14e 100644 --- a/src/MaterialModel/NeoHookeanMaterial.cpp +++ b/src/MaterialModel/NeoHookeanMaterial.cpp @@ -1,13 +1,13 @@ -#include "../../include/NeoHookeanMaterial.h" -#include "../../include/MeshConnectivity.h" -#include +#include "libshell/NeoHookeanMaterial.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleSinFormulation.h" +#include "libshell/MidedgeAngleTanFormulation.h" +#include "libshell/MidedgeAverageFormulation.h" +#include "libshell/RestState.h" #include "../GeometryDerivatives.h" #include #include -#include "../../include/MidedgeAngleSinFormulation.h" -#include "../../include/MidedgeAngleTanFormulation.h" -#include "../../include/MidedgeAverageFormulation.h" -#include "../../include/RestState.h" +#include namespace LibShell { @@ -425,4 +425,4 @@ namespace LibShell { template class NeoHookeanMaterial; template class NeoHookeanMaterial; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/MaterialModel/StVKMaterial.cpp b/src/MaterialModel/StVKMaterial.cpp index 72c41d8..61a9b21 100644 --- a/src/MaterialModel/StVKMaterial.cpp +++ b/src/MaterialModel/StVKMaterial.cpp @@ -1,12 +1,12 @@ -#include "../../include/StVKMaterial.h" -#include "../../include/MeshConnectivity.h" -#include +#include "libshell/StVKMaterial.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleSinFormulation.h" +#include "libshell/MidedgeAngleTanFormulation.h" +#include "libshell/MidedgeAverageFormulation.h" +#include "libshell/RestState.h" #include "../GeometryDerivatives.h" #include -#include "../../include/MidedgeAngleSinFormulation.h" -#include "../../include/MidedgeAngleTanFormulation.h" -#include "../../include/MidedgeAverageFormulation.h" -#include "../../include/RestState.h" +#include namespace LibShell { @@ -125,4 +125,4 @@ namespace LibShell { template class StVKMaterial; template class StVKMaterial; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/MaterialModel/TensionFieldStVKMaterial.cpp b/src/MaterialModel/TensionFieldStVKMaterial.cpp index d75aef7..00f9517 100644 --- a/src/MaterialModel/TensionFieldStVKMaterial.cpp +++ b/src/MaterialModel/TensionFieldStVKMaterial.cpp @@ -1,12 +1,12 @@ -#include "../../include/TensionFieldStVKMaterial.h" -#include "../../include/MeshConnectivity.h" -#include +#include "libshell/TensionFieldStVKMaterial.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleSinFormulation.h" +#include "libshell/MidedgeAngleTanFormulation.h" +#include "libshell/MidedgeAverageFormulation.h" +#include "libshell/RestState.h" #include "../GeometryDerivatives.h" #include -#include "../../include/MidedgeAngleSinFormulation.h" -#include "../../include/MidedgeAngleTanFormulation.h" -#include "../../include/MidedgeAverageFormulation.h" -#include "../../include/RestState.h" +#include namespace LibShell { @@ -197,4 +197,4 @@ namespace LibShell { template class TensionFieldStVKMaterial; template class TensionFieldStVKMaterial; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/MeshConnectivity.cpp b/src/MeshConnectivity.cpp index 1a3c41d..eff465f 100644 --- a/src/MeshConnectivity.cpp +++ b/src/MeshConnectivity.cpp @@ -1,4 +1,4 @@ -#include "../include/MeshConnectivity.h" +#include "libshell/MeshConnectivity.h" #include #include @@ -129,4 +129,4 @@ namespace LibShell { return edgeOppositeVertex(edge, 1 - edgeorient); } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp b/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp index 2585308..4842aa8 100644 --- a/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp +++ b/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp @@ -1,10 +1,9 @@ -#include "../../include/MidedgeAngleSinFormulation.h" -#include +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleSinFormulation.h" #include "../GeometryDerivatives.h" -#include "../../include/MeshConnectivity.h" +#include #include #include -#include namespace LibShell { @@ -301,4 +300,4 @@ namespace LibShell { extraDOFs.setZero(); } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp b/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp index cfe64c2..d46d0b5 100644 --- a/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp +++ b/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp @@ -1,10 +1,9 @@ -#include "../../include/MidedgeAngleTanFormulation.h" -#include +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleTanFormulation.h" #include "../GeometryDerivatives.h" -#include "../../include/MeshConnectivity.h" +#include #include #include -#include namespace LibShell { @@ -301,4 +300,4 @@ namespace LibShell { extraDOFs.setZero(); } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp b/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp index 20d3316..c9f858f 100644 --- a/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp +++ b/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp @@ -1,6 +1,6 @@ -#include "../../include/MidedgeAverageFormulation.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAverageFormulation.h" #include "../GeometryDerivatives.h" -#include "../../include/MeshConnectivity.h" #include #include @@ -254,4 +254,4 @@ namespace LibShell { extraDOFs.resize(0); } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/tests/main.cpp b/tests/main.cpp index 04e7f16..4dab883 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,18 +1,18 @@ +#include "findiff.h" +#include "libshell/BilayerStVKMaterial.h" +#include "libshell/ElasticShell.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleTanFormulation.h" +#include "libshell/MidedgeAngleSinFormulation.h" +#include "libshell/MidedgeAverageFormulation.h" +#include "libshell/NeoHookeanMaterial.h" +#include "libshell/RestState.h" +#include "libshell/StVKMaterial.h" +#include "libshell/TensionFieldStVKMaterial.h" +#include #include #include #include -#include -#include "../include/MeshConnectivity.h" -#include "../include/ElasticShell.h" -#include "../include/MidedgeAngleTanFormulation.h" -#include "../include/MidedgeAngleSinFormulation.h" -#include "../include/MidedgeAverageFormulation.h" -#include "../include/StVKMaterial.h" -#include "../include/BilayerStVKMaterial.h" -#include "../include/TensionFieldStVKMaterial.h" -#include "../include/NeoHookeanMaterial.h" -#include "../include/RestState.h" -#include "findiff.h" #include std::default_random_engine rng; From 7f47b7fc48013845f25e7d33ae3cf06824942ddf Mon Sep 17 00:00:00 2001 From: David Jourdan Date: Fri, 25 Jun 2021 15:25:41 +0200 Subject: [PATCH 2/4] modify CMakeLists to include libshell as an external library --- CMakeLists.txt | 51 ++++++++++++++++++++++++++++++++---------------- example/main.cpp | 22 ++++++++++----------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cd313f..3826c28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,13 +7,19 @@ set(LIBIGL_EIGEN_VERSION 3.3.7 CACHE STRING "Eigen version") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -# libigl -option(LIBIGL_WITH_OPENGL "Use OpenGL" ON) -option(LIBIGL_WITH_OPENGL_GLFW "Use GLFW" ON) -option(LIBIGL_WITH_OPENGL_GLFW_IMGUI "Use ImGui" ON) -option(LIBIGL_WITH_VIEWER "Use OpenGL viewer" ON) +# Detects whether this is a top-level project +get_directory_property(LIBSHELL_PARENT_DIR PARENT_DIRECTORY) +if(NOT LIBSHELL_PARENT_DIR) + set(LIBSHELL_TOPLEVEL_PROJECT ON) +else() + set(LIBSHELL_TOPLEVEL_PROJECT OFF) +endif() + +# Build tests +option(LIBSHELL_BUILD_EXEC "Build libshell executable" ${LIBSHELL_TOPLEVEL_PROJECT}) +option(LIBSHELL_BUILD_TESTS "Build libshell tests" ${LIBSHELL_TOPLEVEL_PROJECT}) -find_package(LIBIGL QUIET) +find_package(Eigen3 3.3 REQUIRED NO_MODULE) # Add your project files if(MSVC) @@ -22,17 +28,28 @@ endif() file(GLOB LIBFILES src/*.cpp src/SecondFundamentalForm/*.cpp src/MaterialModel/*.cpp) add_library(${PROJECT_NAME} STATIC ${LIBFILES}) -if(LIBIGL_FOUND) - target_link_libraries(${PROJECT_NAME} igl::core) -else() - target_include_directories(${PROJECT_NAME} PRIVATE "$ENV{EIGEN3_INCLUDE_DIR}" ) + +# install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_CURRENT_LIST_DIR}/lib) +target_include_directories(libshell PRIVATE "${EIGEN3_INCLUDE_DIR}") +target_include_directories(libshell PUBLIC "${CMAKE_CURRENT_LIST_DIR}/include") + +if(LIBSHELL_BUILD_EXEC) + find_package(LIBIGL QUIET) + + # libigl + option(LIBIGL_WITH_OPENGL "Use OpenGL" ON) + option(LIBIGL_WITH_OPENGL_GLFW "Use GLFW" ON) + option(LIBIGL_WITH_OPENGL_GLFW_IMGUI "Use ImGui" ON) + option(LIBIGL_WITH_VIEWER "Use OpenGL viewer" ON) + + file(GLOB EXAMPLEFILES example/*.cpp) + add_executable(example_${PROJECT_NAME} ${EXAMPLEFILES}) + target_link_libraries(example_${PROJECT_NAME} ${PROJECT_NAME} igl::core igl::opengl_glfw igl::opengl_glfw_imgui) endif() -install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_CURRENT_LIST_DIR}/lib) -file(GLOB EXAMPLEFILES example/*.cpp) -add_executable(example_${PROJECT_NAME} ${EXAMPLEFILES}) -target_link_libraries(example_${PROJECT_NAME} ${PROJECT_NAME} igl::core igl::opengl_glfw igl::opengl_glfw_imgui) -file(GLOB TESTFILES tests/*.cpp) -add_executable(tests_${PROJECT_NAME} ${TESTFILES}) -target_link_libraries(tests_${PROJECT_NAME} ${PROJECT_NAME} igl::core) +if(LIBSHELL_BUILD_TESTS) + file(GLOB TESTFILES tests/*.cpp) + add_executable(tests_${PROJECT_NAME} ${TESTFILES}) + target_link_libraries(tests_${PROJECT_NAME} ${PROJECT_NAME}) +endif() diff --git a/example/main.cpp b/example/main.cpp index 7cd70ff..cfda6d0 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -1,17 +1,17 @@ -#include -#include "../include/MeshConnectivity.h" -#include "../include/ElasticShell.h" +#include "libshell/ElasticShell.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/MidedgeAngleTanFormulation.h" +#include "libshell/MidedgeAngleSinFormulation.h" +#include "libshell/MidedgeAverageFormulation.h" +#include "libshell/StVKMaterial.h" +#include "libshell/TensionFieldStVKMaterial.h" +#include "libshell/NeoHookeanMaterial.h" +#include "libshell/RestState.h" #include "StaticSolve.h" +#include #include #include -#include -#include "../include/MidedgeAngleTanFormulation.h" -#include "../include/MidedgeAngleSinFormulation.h" -#include "../include/MidedgeAverageFormulation.h" -#include "../include/StVKMaterial.h" -#include "../include/TensionFieldStVKMaterial.h" -#include "../include/NeoHookeanMaterial.h" -#include "../include/RestState.h" +#include int numSteps; double thickness; From b1bafb4498ccde1f04d09708586ff685c8b6e6c3 Mon Sep 17 00:00:00 2001 From: David Jourdan Date: Fri, 25 Jun 2021 16:52:13 +0200 Subject: [PATCH 3/4] small fixes --- example/StaticSolve.h | 6 +++--- include/libshell/ElasticShell.h | 1 - include/libshell/MaterialModel.h | 2 +- include/libshell/MeshConnectivity.h | 2 +- include/libshell/MidedgeAngleSinFormulation.h | 2 +- include/libshell/MidedgeAngleTanFormulation.h | 2 +- include/libshell/MidedgeAverageFormulation.h | 2 +- include/libshell/RestState.h | 6 +++--- src/GeometryDerivatives.h | 2 +- 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/example/StaticSolve.h b/example/StaticSolve.h index 180458b..9542857 100644 --- a/example/StaticSolve.h +++ b/example/StaticSolve.h @@ -4,9 +4,9 @@ #include #include -#include "../include/MaterialModel.h" -#include "../include/MeshConnectivity.h" -#include "../include/ElasticShell.h" +#include "libshell/MaterialModel.h" +#include "libshell/MeshConnectivity.h" +#include "libshell/ElasticShell.h" template void takeOneStep(const LibShell::MeshConnectivity &mesh, diff --git a/include/libshell/ElasticShell.h b/include/libshell/ElasticShell.h index 811d908..86a898f 100644 --- a/include/libshell/ElasticShell.h +++ b/include/libshell/ElasticShell.h @@ -3,7 +3,6 @@ #include #include -#include #include "MaterialModel.h" namespace LibShell { diff --git a/include/libshell/MaterialModel.h b/include/libshell/MaterialModel.h index 7132cb5..33bab41 100644 --- a/include/libshell/MaterialModel.h +++ b/include/libshell/MaterialModel.h @@ -1,7 +1,7 @@ #ifndef MATERIALMODEL_H #define MATERIALMODEL_H -#include +#include namespace LibShell { diff --git a/include/libshell/MeshConnectivity.h b/include/libshell/MeshConnectivity.h index a2b9a90..61e7c19 100644 --- a/include/libshell/MeshConnectivity.h +++ b/include/libshell/MeshConnectivity.h @@ -1,7 +1,7 @@ #ifndef MESHCONNECTIVITY_H #define MESHCONNECTIVITY_H -#include +#include namespace LibShell { diff --git a/include/libshell/MidedgeAngleSinFormulation.h b/include/libshell/MidedgeAngleSinFormulation.h index b17156f..a4555f0 100644 --- a/include/libshell/MidedgeAngleSinFormulation.h +++ b/include/libshell/MidedgeAngleSinFormulation.h @@ -1,7 +1,7 @@ #ifndef MIDEDGEANGLESINFORMULATION_H #define MIDEDGEANGLESINFORMULATION_H -#include +#include #include namespace LibShell { diff --git a/include/libshell/MidedgeAngleTanFormulation.h b/include/libshell/MidedgeAngleTanFormulation.h index 485cd86..252b6d7 100644 --- a/include/libshell/MidedgeAngleTanFormulation.h +++ b/include/libshell/MidedgeAngleTanFormulation.h @@ -1,7 +1,7 @@ #ifndef MIDEDGEANGLETANFORMULATION_H #define MIDEDGEANGLETANFORMULATION_H -#include +#include #include namespace LibShell { diff --git a/include/libshell/MidedgeAverageFormulation.h b/include/libshell/MidedgeAverageFormulation.h index f03f90e..19e1619 100644 --- a/include/libshell/MidedgeAverageFormulation.h +++ b/include/libshell/MidedgeAverageFormulation.h @@ -1,7 +1,7 @@ #ifndef MIDEDGEAVERAGEFORMULATION_H #define MIDEDGEAVERAGEFORMULATION_H -#include +#include #include namespace LibShell { diff --git a/include/libshell/RestState.h b/include/libshell/RestState.h index 19d0e18..dbd8386 100644 --- a/include/libshell/RestState.h +++ b/include/libshell/RestState.h @@ -13,7 +13,7 @@ namespace LibShell { struct RestState { public: - virtual RestStateType type() { return RestStateType::RST_NONE; } + virtual RestStateType type() const { return RestStateType::RST_NONE; } }; /* Encodes the rest state information for an elastic monolayer. @@ -25,7 +25,7 @@ namespace LibShell { struct MonolayerRestState : public RestState { public: - virtual RestStateType type() { return RestStateType::RST_MONOLAYER; } + virtual RestStateType type() const { return RestStateType::RST_MONOLAYER; } std::vector thicknesses; std::vector abars; @@ -40,7 +40,7 @@ namespace LibShell { struct BilayerRestState : public RestState { public: - virtual RestStateType type() { return RestStateType::RST_BILAYER; } + virtual RestStateType type() const { return RestStateType::RST_BILAYER; } MonolayerRestState layers[2]; }; diff --git a/src/GeometryDerivatives.h b/src/GeometryDerivatives.h index d232362..771271d 100644 --- a/src/GeometryDerivatives.h +++ b/src/GeometryDerivatives.h @@ -1,7 +1,7 @@ #ifndef GEOMETRYDERIVATIVES_H #define GEOMETRYDERIVATIVES_H -#include +#include #include namespace LibShell { From f8ec2da20745b2db6278f9e33a974f4e6d77e7d8 Mon Sep 17 00:00:00 2001 From: David Jourdan Date: Tue, 29 Jun 2021 18:36:59 +0200 Subject: [PATCH 4/4] other edits --- include/libshell/ElasticShell.h | 1 + include/libshell/MaterialModel.h | 2 +- include/libshell/MeshConnectivity.h | 2 +- include/libshell/MidedgeAngleSinFormulation.h | 2 +- include/libshell/MidedgeAngleTanFormulation.h | 2 +- include/libshell/MidedgeAverageFormulation.h | 2 +- src/ElasticShell.cpp | 4 +--- src/GeometryDerivatives.cpp | 2 -- src/GeometryDerivatives.h | 2 +- src/MaterialModel/NeoHookeanMaterial.cpp | 1 - src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp | 2 -- src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp | 2 -- src/SecondFundamentalForm/MidedgeAverageFormulation.cpp | 2 -- 13 files changed, 8 insertions(+), 18 deletions(-) diff --git a/include/libshell/ElasticShell.h b/include/libshell/ElasticShell.h index 86a898f..73cf8c1 100644 --- a/include/libshell/ElasticShell.h +++ b/include/libshell/ElasticShell.h @@ -2,6 +2,7 @@ #define ELASTICSHELL_H #include +#include #include #include "MaterialModel.h" diff --git a/include/libshell/MaterialModel.h b/include/libshell/MaterialModel.h index 33bab41..7132cb5 100644 --- a/include/libshell/MaterialModel.h +++ b/include/libshell/MaterialModel.h @@ -1,7 +1,7 @@ #ifndef MATERIALMODEL_H #define MATERIALMODEL_H -#include +#include namespace LibShell { diff --git a/include/libshell/MeshConnectivity.h b/include/libshell/MeshConnectivity.h index 61e7c19..a2b9a90 100644 --- a/include/libshell/MeshConnectivity.h +++ b/include/libshell/MeshConnectivity.h @@ -1,7 +1,7 @@ #ifndef MESHCONNECTIVITY_H #define MESHCONNECTIVITY_H -#include +#include namespace LibShell { diff --git a/include/libshell/MidedgeAngleSinFormulation.h b/include/libshell/MidedgeAngleSinFormulation.h index a4555f0..b17156f 100644 --- a/include/libshell/MidedgeAngleSinFormulation.h +++ b/include/libshell/MidedgeAngleSinFormulation.h @@ -1,7 +1,7 @@ #ifndef MIDEDGEANGLESINFORMULATION_H #define MIDEDGEANGLESINFORMULATION_H -#include +#include #include namespace LibShell { diff --git a/include/libshell/MidedgeAngleTanFormulation.h b/include/libshell/MidedgeAngleTanFormulation.h index 252b6d7..485cd86 100644 --- a/include/libshell/MidedgeAngleTanFormulation.h +++ b/include/libshell/MidedgeAngleTanFormulation.h @@ -1,7 +1,7 @@ #ifndef MIDEDGEANGLETANFORMULATION_H #define MIDEDGEANGLETANFORMULATION_H -#include +#include #include namespace LibShell { diff --git a/include/libshell/MidedgeAverageFormulation.h b/include/libshell/MidedgeAverageFormulation.h index 19e1619..f03f90e 100644 --- a/include/libshell/MidedgeAverageFormulation.h +++ b/include/libshell/MidedgeAverageFormulation.h @@ -1,7 +1,7 @@ #ifndef MIDEDGEAVERAGEFORMULATION_H #define MIDEDGEAVERAGEFORMULATION_H -#include +#include #include namespace LibShell { diff --git a/src/ElasticShell.cpp b/src/ElasticShell.cpp index 8d26d25..f31f1ba 100644 --- a/src/ElasticShell.cpp +++ b/src/ElasticShell.cpp @@ -6,8 +6,6 @@ #include "libshell/MidedgeAverageFormulation.h" #include "libshell/RestState.h" #include "GeometryDerivatives.h" -#include -#include #include namespace LibShell { @@ -183,7 +181,7 @@ namespace LibShell { } } - // instantions + // instantiations template class ElasticShell; template class ElasticShell; template class ElasticShell; diff --git a/src/GeometryDerivatives.cpp b/src/GeometryDerivatives.cpp index 03a3513..48449ce 100644 --- a/src/GeometryDerivatives.cpp +++ b/src/GeometryDerivatives.cpp @@ -1,7 +1,5 @@ #include "GeometryDerivatives.h" #include "libshell/MeshConnectivity.h" -#include -#include namespace LibShell { diff --git a/src/GeometryDerivatives.h b/src/GeometryDerivatives.h index 771271d..76e2c95 100644 --- a/src/GeometryDerivatives.h +++ b/src/GeometryDerivatives.h @@ -52,7 +52,7 @@ namespace LibShell { const Eigen::MatrixXd& curPos, int face, Eigen::Matrix* derivative, // F(face, i) - std::vector >* hessian); + std::vector >* hessian); } diff --git a/src/MaterialModel/NeoHookeanMaterial.cpp b/src/MaterialModel/NeoHookeanMaterial.cpp index 045b14e..b3644c5 100644 --- a/src/MaterialModel/NeoHookeanMaterial.cpp +++ b/src/MaterialModel/NeoHookeanMaterial.cpp @@ -6,7 +6,6 @@ #include "libshell/RestState.h" #include "../GeometryDerivatives.h" #include -#include #include namespace LibShell { diff --git a/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp b/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp index 4842aa8..a2ad49e 100644 --- a/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp +++ b/src/SecondFundamentalForm/MidedgeAngleSinFormulation.cpp @@ -2,8 +2,6 @@ #include "libshell/MidedgeAngleSinFormulation.h" #include "../GeometryDerivatives.h" #include -#include -#include namespace LibShell { diff --git a/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp b/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp index d46d0b5..df294b7 100644 --- a/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp +++ b/src/SecondFundamentalForm/MidedgeAngleTanFormulation.cpp @@ -2,8 +2,6 @@ #include "libshell/MidedgeAngleTanFormulation.h" #include "../GeometryDerivatives.h" #include -#include -#include namespace LibShell { diff --git a/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp b/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp index c9f858f..bb5cee1 100644 --- a/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp +++ b/src/SecondFundamentalForm/MidedgeAverageFormulation.cpp @@ -1,8 +1,6 @@ #include "libshell/MeshConnectivity.h" #include "libshell/MidedgeAverageFormulation.h" #include "../GeometryDerivatives.h" -#include -#include namespace LibShell {