Skip to content

Commit

Permalink
Merge branch 'matthias/mpm' into 'master'
Browse files Browse the repository at this point in the history
Matthias/mpm

See merge request bft/afbDevelopers/Marmot!19
  • Loading branch information
matthiasneuner committed Mar 30, 2024
2 parents 6cd83d0 + 1d79660 commit 07129ba
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ variables:
format:
stage: test
image: condaforge/mambaforge:22.9.0-2
image: condaforge/mambaforge:23.11.0-0
needs: []
script:
- mamba install -c conda-forge clang-format-15
- find . \( -name \*.cpp -o -name \*.h \) -print0 | xargs -0 -n 1 clang-format-15 --Werror -n --verbose
- mamba install -c conda-forge clang-format-16
- find . \( -name \*.cpp -o -name \*.h \) -print0 | xargs -0 -n 1 clang-format-16 --Werror -n --verbose
only:
- merge_requests

build and test:
stage: build
image: condaforge/mambaforge:22.9.0-2
image: condaforge/mambaforge:23.11.0-0
script:

- function install_marmot_module(){
Expand Down Expand Up @@ -85,7 +85,7 @@ build and test:
- make install
- cd ../..

- git clone https://github.com/autodiff/autodiff.git
- git clone -b v1.1.0 https://github.com/autodiff/autodiff.git
- cd autodiff
- mkdir build
- cd build
Expand Down
60 changes: 60 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,23 @@ ENDMACRO()

get_filename_component(COREPATH ${MODULES_DIR}/core ABSOLUTE)
get_filename_component(MATERIALSPATH ${MODULES_DIR}/materials ABSOLUTE)
get_filename_component(PARTICLESPATH ${MODULES_DIR}/particles ABSOLUTE)
get_filename_component(ELEMENTSPATH ${MODULES_DIR}/elements ABSOLUTE)
get_filename_component(CELLSPATH ${MODULES_DIR}/cells ABSOLUTE)

SUBDIRLIST(COREDIRS ${COREPATH})
SUBDIRLIST(MATERIALSDIRS ${MATERIALSPATH})
SUBDIRLIST(PARTICLESDIRS ${PARTICLESPATH})
SUBDIRLIST(ELEMENTSDIRS ${ELEMENTSPATH})
SUBDIRLIST(CELLSDIRS ${CELLSPATH})

set(INSTALLED_MODULES "")
set(INSTALLED_MODULE_PATHS "")
message("+------------------------------------------------------------------------------+")

message("checking for modules in
${COREPATH}.
" "If you want to install a Marmot Core module, make sure it is in this directory.")
foreach(DIRNAME ${COREDIRS})
get_filename_component(MODULEPATH "${COREPATH}/${DIRNAME}" ABSOLUTE)
if(EXISTS ${MODULEPATH}/module.cmake)
Expand All @@ -145,7 +153,11 @@ foreach(DIRNAME ${COREDIRS})
endif()
endif()
endforeach(DIRNAME)
message("+------------------------------------------------------------------------------+")

message("Checking for modules in
${MATERIALSPATH}.
" "If you want to install a Marmot Material, make sure it is in this directory.")
foreach(DIRNAME ${MATERIALSDIRS})
get_filename_component(MODULEPATH "${MATERIALSPATH}/${DIRNAME}" ABSOLUTE)
if(EXISTS ${MODULEPATH}/module.cmake)
Expand All @@ -159,7 +171,11 @@ foreach(DIRNAME ${MATERIALSDIRS})
endif()
endif()
endforeach(DIRNAME)
message("+------------------------------------------------------------------------------+")

message("Checking for modules in
${ELEMENTSPATH}.
" "If you want to install a Marmot Finite Element, make sure it is in this directory.")
foreach(DIRNAME ${ELEMENTSDIRS})
get_filename_component(MODULEPATH "${ELEMENTSPATH}/${DIRNAME}" ABSOLUTE)
if(EXISTS ${MODULEPATH}/module.cmake)
Expand All @@ -173,6 +189,50 @@ foreach(DIRNAME ${ELEMENTSDIRS})
endif()
endif()
endforeach(DIRNAME)
message("+------------------------------------------------------------------------------+")

message("Checking for modules in
${PARTICLESPATH}.
" "If you want to install a Marmot Particle module, make sure it is in this directory.")
foreach(DIRNAME ${PARTICLESDIRS})
get_filename_component(MODULEPATH "${PARTICLESPATH}/${DIRNAME}" ABSOLUTE)
if(EXISTS ${MODULEPATH}/module.cmake)
if (NOT DEFINED PARTICLE_MODULES)
set(PARTICLE_MODULES "all")
endif()
if(PARTICLE_MODULES STREQUAL "all" OR ${DIRNAME} IN_LIST PARTICLE_MODULES)
message("--> found ${DIRNAME}")
list(APPEND INSTALLED_MODULES ${DIRNAME})
list(APPEND INSTALLED_MODULEPATHS ${MODULEPATH})
endif()
endif()
endforeach(DIRNAME)
message("+------------------------------------------------------------------------------+")

message("Checking for modules in
${CELLSPATH}.
" "If you want to install a Marmot Cell module, make sure it is in this directory.")

foreach(DIRNAME ${CELLSDIRS})
get_filename_component(MODULEPATH "${CELLSPATH}/${DIRNAME}" ABSOLUTE)
if(EXISTS ${MODULEPATH}/module.cmake)
if (NOT DEFINED CELL_MODULES)
set(CELL_MODULES "all")
endif()
if(CELL_MODULES STREQUAL "all" OR ${DIRNAME} IN_LIST CELL_MODULES)
message("--> found ${DIRNAME}")
list(APPEND INSTALLED_MODULES ${DIRNAME})
list(APPEND INSTALLED_MODULEPATHS ${MODULEPATH})
endif()
endif()
endforeach(DIRNAME)
message("+------------------------------------------------------------------------------+")

message("Now check if all of your modules are listed. If one is missing in this list
" "despite being present in the correct directory, also check if the module has a
" "proper module.cmake file.")

message("+------------------------------------------------------------------------------+")

foreach(MODULEPATH ${INSTALLED_MODULEPATHS})
include(${MODULEPATH}/module.cmake)
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion modules/core/MarmotMathCore
2 changes: 1 addition & 1 deletion modules/materials/LinearElastic
Submodule LinearElastic updated 1 files
+4 −2 test.cmake
Empty file.

0 comments on commit 07129ba

Please sign in to comment.