From f32feeee456c03dc03ae586769f9addd11f02290 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Sep 2021 19:57:01 +0200 Subject: new package(s): DAMASK (damask, damask-grid, damask-mesh) (#25692) --- .../packages/damask-grid/CMakeDebugRelease.patch | 19 +++++++++++ .../repos/builtin/packages/damask-grid/package.py | 37 ++++++++++++++++++++++ .../packages/damask-mesh/CMakeDebugRelease.patch | 19 +++++++++++ .../repos/builtin/packages/damask-mesh/package.py | 37 ++++++++++++++++++++++ var/spack/repos/builtin/packages/damask/package.py | 32 +++++++++++++++++++ .../repos/builtin/packages/py-damask/package.py | 25 +++++++++++++++ 6 files changed, 169 insertions(+) create mode 100644 var/spack/repos/builtin/packages/damask-grid/CMakeDebugRelease.patch create mode 100644 var/spack/repos/builtin/packages/damask-grid/package.py create mode 100644 var/spack/repos/builtin/packages/damask-mesh/CMakeDebugRelease.patch create mode 100644 var/spack/repos/builtin/packages/damask-mesh/package.py create mode 100644 var/spack/repos/builtin/packages/damask/package.py create mode 100644 var/spack/repos/builtin/packages/py-damask/package.py diff --git a/var/spack/repos/builtin/packages/damask-grid/CMakeDebugRelease.patch b/var/spack/repos/builtin/packages/damask-grid/CMakeDebugRelease.patch new file mode 100644 index 0000000000..488c475ead --- /dev/null +++ b/var/spack/repos/builtin/packages/damask-grid/CMakeDebugRelease.patch @@ -0,0 +1,19 @@ +--- DAMASK.orig/CMakeLists.txt 2021-08-30 07:46:00.432886577 +0200 ++++ DAMASK/CMakeLists.txt 2021-08-30 08:21:42.249937025 +0200 +@@ -38,11 +38,14 @@ + endif () + + # Predefined sets for OPTIMIZATION/OPENMP based on BUILD_TYPE +-if (CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY") ++string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) ++if (CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR ++ CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY") + set (DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG") + set (PARALLEL "OFF") + set (OPTI "OFF") +-elseif (CMAKE_BUILD_TYPE STREQUAL "RELEASE") ++elseif (CMAKE_BUILD_TYPE STREQUAL "RELEASE" OR ++ CMAKE_BUILD_TYPE STREQUAL "DEBUGRELEASE") + set (PARALLEL "ON") + set (OPTI "DEFENSIVE") + elseif (CMAKE_BUILD_TYPE STREQUAL "PERFORMANCE") diff --git a/var/spack/repos/builtin/packages/damask-grid/package.py b/var/spack/repos/builtin/packages/damask-grid/package.py new file mode 100644 index 0000000000..2fd51b439b --- /dev/null +++ b/var/spack/repos/builtin/packages/damask-grid/package.py @@ -0,0 +1,37 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +class DamaskGrid(CMakePackage): + """Grid solver for DAMASK""" + + homepage = "https://damask3.mpie.de" + url = "https://damask3.mpie.de/download/damask-3.0.0.tar.xz" + + maintainers = ['MarDieh'] + + version('3.0.0-alpha4', sha256='0bb8bde43b27d852b1fb6e359a7157354544557ad83d87987b03f5d629ce5493') + + depends_on('cmake@3.10:', type='build') + depends_on('petsc+fftw@3.14.0:3.14.99,3.15.1:3.15.99') + depends_on('hdf5+fortran') + + patch('CMakeDebugRelease.patch', when='@3.0.0-alpha4') + + variant('build_type', default='DebugRelease', + description='The build type to build', + values=('Debug', 'Release', 'DebugRelease')) + + def cmake_args(self): + + args = ['-DDAMASK_SOLVER:STRING=grid'] + return args + + @run_after('install') + @on_package_attributes(run_tests=True) + def execute(self): + + damask_grid = Executable('DAMASK_grid') + damask_grid('--help') diff --git a/var/spack/repos/builtin/packages/damask-mesh/CMakeDebugRelease.patch b/var/spack/repos/builtin/packages/damask-mesh/CMakeDebugRelease.patch new file mode 100644 index 0000000000..488c475ead --- /dev/null +++ b/var/spack/repos/builtin/packages/damask-mesh/CMakeDebugRelease.patch @@ -0,0 +1,19 @@ +--- DAMASK.orig/CMakeLists.txt 2021-08-30 07:46:00.432886577 +0200 ++++ DAMASK/CMakeLists.txt 2021-08-30 08:21:42.249937025 +0200 +@@ -38,11 +38,14 @@ + endif () + + # Predefined sets for OPTIMIZATION/OPENMP based on BUILD_TYPE +-if (CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY") ++string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) ++if (CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR ++ CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY") + set (DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG") + set (PARALLEL "OFF") + set (OPTI "OFF") +-elseif (CMAKE_BUILD_TYPE STREQUAL "RELEASE") ++elseif (CMAKE_BUILD_TYPE STREQUAL "RELEASE" OR ++ CMAKE_BUILD_TYPE STREQUAL "DEBUGRELEASE") + set (PARALLEL "ON") + set (OPTI "DEFENSIVE") + elseif (CMAKE_BUILD_TYPE STREQUAL "PERFORMANCE") diff --git a/var/spack/repos/builtin/packages/damask-mesh/package.py b/var/spack/repos/builtin/packages/damask-mesh/package.py new file mode 100644 index 0000000000..2b19ef2c04 --- /dev/null +++ b/var/spack/repos/builtin/packages/damask-mesh/package.py @@ -0,0 +1,37 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +class DamaskMesh(CMakePackage): + """Mesh solver for DAMASK""" + + homepage = "https://damask3.mpie.de" + url = "https://damask3.mpie.de/download/damask-3.0.0.tar.xz" + + maintainers = ['MarDieh'] + + version('3.0.0-alpha4', sha256='0bb8bde43b27d852b1fb6e359a7157354544557ad83d87987b03f5d629ce5493') + + depends_on('cmake@3.10:', type='build') + depends_on('petsc@3.14.0:3.14.99,3.15.1:3.15.99') + depends_on('hdf5+fortran') + + patch('CMakeDebugRelease.patch', when='@3.0.0-alpha4') + + variant('build_type', default='DebugRelease', + description='The build type to build', + values=('Debug', 'Release', 'DebugRelease')) + + def cmake_args(self): + + args = ['-DDAMASK_SOLVER:STRING=mesh'] + return args + + @run_after('install') + @on_package_attributes(run_tests=True) + def execute(self): + + damask_mesh = Executable('DAMASK_mesh') + damask_mesh('--help') diff --git a/var/spack/repos/builtin/packages/damask/package.py b/var/spack/repos/builtin/packages/damask/package.py new file mode 100644 index 0000000000..40d792ecb6 --- /dev/null +++ b/var/spack/repos/builtin/packages/damask/package.py @@ -0,0 +1,32 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +class Damask(BundlePackage): + """ + DAMASK - The Duesseldorf Advanced Material Simulation Kit + + A unified multi-physics crystal plasticity simulation package. The solution of + continuum mechanical boundary value problems requires a constitutive response + that connects deformation and stress at each material point. This problem is + solved in DAMASK on the basis of crystal plasticity using a variety of constitutive + models and homogenization approaches. However, treating mechanics in isolation is + no longer sufficient to study emergent advanced high-strength materials. In these + materials, deformation happens interrelated with displacive phase transformation, + significant heating, and potential damage evolution. Therefore, DAMASK is capable + of handling multi-physics problems. Following a modular approach, additional field + equations are solved in a fully coupled way using a staggered approach. + + """ + + homepage = "https://damask3.mpie.de" + + maintainers = ['MarDieh'] + + version('3.0.0-alpha4') + + depends_on('damask-grid@3.0.0-alpha4', when='@3.0.0-alpha4', type='run') + depends_on('damask-mesh@3.0.0-alpha4', when='@3.0.0-alpha4', type='run') + depends_on('py-damask@3.0.0-alpha4', when='@3.0.0-alpha4', type='run') diff --git a/var/spack/repos/builtin/packages/py-damask/package.py b/var/spack/repos/builtin/packages/py-damask/package.py new file mode 100644 index 0000000000..b314f9551c --- /dev/null +++ b/var/spack/repos/builtin/packages/py-damask/package.py @@ -0,0 +1,25 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +class PyDamask(PythonPackage): + """Pre- and post-processing tools for DAMASK""" + + homepage = "https://damask3.mpie.de" + url = "https://damask3.mpie.de/download/damask-3.0.0.tar.xz" + + maintainers = ['MarDieh'] + + version('3.0.0-alpha4', sha256='0bb8bde43b27d852b1fb6e359a7157354544557ad83d87987b03f5d629ce5493') + + depends_on('python@3.7:', type=('build', 'run')) + depends_on('vtk+python') + depends_on('py-pandas') + depends_on('py-scipy') + depends_on('py-h5py') + depends_on('py-matplotlib') + depends_on('py-pyyaml') + + build_directory = 'python' -- cgit v1.2.3-60-g2f50