summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorPeter Brady <ptb@lanl.gov>2022-04-19 05:54:26 -0600
committerGitHub <noreply@github.com>2022-04-19 13:54:26 +0200
commite72afede173ab2db2f9c797a75f9d28d8a823f25 (patch)
tree2f9617dfeab085cd6ac2cf6911111939b7bf4052 /var
parent0d2044c659869ee71d883367baf942eeb719aa2b (diff)
downloadspack-e72afede173ab2db2f9c797a75f9d28d8a823f25.tar.gz
spack-e72afede173ab2db2f9c797a75f9d28d8a823f25.tar.bz2
spack-e72afede173ab2db2f9c797a75f9d28d8a823f25.tar.xz
spack-e72afede173ab2db2f9c797a75f9d28d8a823f25.zip
truchas: add new package (#29980)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/truchas/package.py109
1 files changed, 109 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/truchas/package.py b/var/spack/repos/builtin/packages/truchas/package.py
new file mode 100644
index 0000000000..a25db2d292
--- /dev/null
+++ b/var/spack/repos/builtin/packages/truchas/package.py
@@ -0,0 +1,109 @@
+# 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)
+
+from spack import *
+
+
+class Truchas(CMakePackage):
+ """Physics-based modeling and simulation of manufacturing processes.
+
+ Truchas includes coupled physics models for incompressible multi-material
+ flow with interface tracking, heat transfer, phase change, view factor
+ thermal radiation, species advection-diffusion, elastic/plastic mechanics
+ with contact, and electromagnetics. It employs finite volume, finite element,
+ and mimetic finite difference discretizations on 3-D unstructured meshes
+ composed of mixed cell types.
+ """
+
+ homepage = "https://www.truchas.org"
+ url = "https://gitlab.com/truchas/truchas/-/archive/22.04.1/truchas-22.04.1.tar.bz2"
+ git = "https://gitlab.com/truchas/truchas.git"
+
+ maintainers = ['pbrady']
+
+ version('develop', branch="master")
+ version('22.04.1', sha256="ed2000f27ee5c4bd3024063a374023878c61e8a3c76c37542fffd341d1226dc1")
+
+ # ------------------------------------------------------------ #
+ # Variants
+ # ------------------------------------------------------------ #
+
+ variant("portage", default=False, description="use the portage data mapping tool")
+ variant("metis", default=True, description="use metis for grid partitioning")
+ variant("std_name", default=False, description="enable std_mod_proc_name with intel")
+ variant("config", default=True, description="use proved truchas config files for cmake")
+
+ # ------------------------------------------------------------ #
+ # Build dependencies
+ # ------------------------------------------------------------ #
+ depends_on('cmake@3.16:', type='build')
+
+ # ------------------------------------------------------------ #
+ # Test suite and restart utils
+ # ------------------------------------------------------------ #
+ depends_on('python@3.5:')
+ depends_on('py-numpy@1.12:')
+ depends_on('py-h5py')
+
+ # ------------------------------------------------------------ #
+ # IO dependencies
+ # ------------------------------------------------------------ #
+ depends_on('exodusii@2020-05-12: +mpi')
+ depends_on('scorpio')
+ depends_on('petaca@22.03: +shared')
+ depends_on('petaca@22.03: +shared +std_name', when='+std_name')
+
+ # ------------------------------------------------------------ #
+ # Partitioning
+ # ------------------------------------------------------------ #
+ depends_on('chaco')
+ depends_on('metis@5:', when='+metis')
+
+ # ------------------------------------------------------------ #
+ # Radiation
+ # ------------------------------------------------------------ #
+ depends_on('chaparral +mpi')
+
+ # ------------------------------------------------------------ #
+ # Solvers
+ # ------------------------------------------------------------ #
+ depends_on('hypre@2.20: ~fortran')
+
+ # ------------------------------------------------------------ #
+ # Mapping
+ # ------------------------------------------------------------ #
+ depends_on('portage@3:', when='+portage')
+
+ def cmake_args(self):
+ # baseline config args
+ opts = [
+ self.define_from_variant('USE_METIS', 'metis'),
+ self.define_from_variant('USE_PORTAGE', 'portage'),
+ self.define_from_variant("ENABLE_STD_MOD_PROC_NAME", "std_name")
+ ]
+
+ spec = self.spec
+ if '+config' in spec:
+ root = self.root_cmakelists_dir
+
+ nag = 'nag' in self.compiler.fc
+
+ if spec.satisfies('platform=linux'):
+ if nag or '%nag' in spec:
+ opts.append("-C {}/config/linux-nag.cmake".format(root))
+ elif '%gcc' in spec:
+ opts.append("-C {}/config/linux-gcc.cmake".format(root))
+ elif '%intel' in spec:
+ opts.append("-C {}/config/linux-intel.cmake".format(root))
+
+ elif spec.satisfies('platform=darwin'):
+ if nag or '%nag' in spec:
+ opts.append("-C {}/config/mac-nag.cmake".format(root))
+
+ if self.spec.satisfies('%apple-clang@12:'):
+ opts.append(self.define("CMAKE_C_FLAGS",
+ "-Wno-error=implicit-function-declaration"))
+
+ return opts