|
| 1 | +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other |
| 2 | +# Spack Project Developers. See the top-level COPYRIGHT file for details. |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: (Apache-2.0 OR MIT) |
| 5 | + |
| 6 | +from spack import * |
| 7 | + |
| 8 | + |
| 9 | +class Goma(CMakePackage): |
| 10 | + """A Full-Newton Finite Element Program for Free and Moving Boundary Problems with |
| 11 | + Coupled Fluid/Solid Momentum, Energy, Mass, and Chemical Species Transport """ |
| 12 | + |
| 13 | + homepage = "https://www.gomafem.com" |
| 14 | + url = "https://github.com/goma/goma/archive/v7.0.0.tar.gz" |
| 15 | + git = "https://github.com/goma/goma.git" |
| 16 | + |
| 17 | + maintainers = ['wortiz'] |
| 18 | + |
| 19 | + version('7.0.0', commit='5166896f273e5853e1f32885e20f68317b24979c') |
| 20 | + version('main', branch='main') |
| 21 | + version('develop', branch='develop') |
| 22 | + |
| 23 | + # Problem size variants |
| 24 | + variant('max_conc', default='4', values=('4', '8', '10', '15', '20'), |
| 25 | + description="Set internal maximum number of species") |
| 26 | + variant('max_external_field', default='4', values=('4', '8', '10', '15', '20'), |
| 27 | + description="Set internal maximum number of external fields") |
| 28 | + variant('max_prob_var', default='15', values=('10', '15', '20', '25', '28', '34', '40', '46', '64'), |
| 29 | + description="Set internal maximum number of active equations") |
| 30 | + variant('mde', default='27', values=('8', '9', '10', '16', '20', '27', '54'), |
| 31 | + description="Set internal maximum DOF per element") |
| 32 | + |
| 33 | + # Floating point checks |
| 34 | + variant('check_finite', default=True, description="Enable finite computation check") |
| 35 | + variant('fpe', default=False, description="Enable floating point exception") |
| 36 | + |
| 37 | + # Optional third party libraries |
| 38 | + variant('arpack-ng', default=True, description="Build with ARPACK support") |
| 39 | + variant('metis', default=True, description="Build with metis decomposition") |
| 40 | + variant('omega-h', default=True, description="Build with Omega_h support") |
| 41 | + variant('petsc', default=True, description="Build with PETSc solver support") |
| 42 | + variant('sparse', default=True, description="Build with legacy sparse solver") |
| 43 | + variant('suite-sparse', default=True, description="Build with UMFPACK support") |
| 44 | + |
| 45 | + # Required dependencies |
| 46 | + depends_on('mpi') |
| 47 | + depends_on('seacas+applications') |
| 48 | + depends_on('trilinos+mpi+epetra+aztec+amesos+stratimikos+teko+mumps+superlu-dist+ml~exodus') |
| 49 | + |
| 50 | + # Optional dependencies |
| 51 | + depends_on('arpack-ng', when='+arpack-ng') |
| 52 | + depends_on('metis', when='+metis') |
| 53 | + depends_on('omega-h+mpi', when='+omega-h') |
| 54 | + depends_on('petsc+hypre+mpi~exodusii', when='+petsc') |
| 55 | + depends_on('sparse', when='+sparse') |
| 56 | + depends_on('suite-sparse', when='+suite-sparse') |
| 57 | + |
| 58 | + def cmake_args(self): |
| 59 | + args = [] |
| 60 | + |
| 61 | + # Problem sizes |
| 62 | + args.append(self.define_from_variant('MAX_CONC', 'max_conc')) |
| 63 | + args.append( |
| 64 | + self.define_from_variant('MAX_EXTERNAL_FIELD', 'max_external_field')) |
| 65 | + args.append(self.define_from_variant('MAX_PROB_VAR', 'max_prob_var')) |
| 66 | + args.append(self.define_from_variant('MDE', 'mde')) |
| 67 | + |
| 68 | + # Floating point error checks |
| 69 | + args.append(self.define_from_variant('CHECK_FINITE', 'check_finite')) |
| 70 | + args.append(self.define_from_variant('FP_EXCEPT', 'fpe')) |
| 71 | + |
| 72 | + # Configure optional libraries |
| 73 | + args.append(self.define_from_variant('ENABLE_ARPACK', 'arpack-ng')) |
| 74 | + args.append(self.define_from_variant('ENABLE_METIS', 'metis')) |
| 75 | + args.append(self.define_from_variant('ENABLE_OMEGA_H', 'omega-h')) |
| 76 | + args.append(self.define_from_variant('ENABLE_PETSC', 'petsc')) |
| 77 | + args.append(self.define_from_variant('ENABLE_SPARSE', 'sparse')) |
| 78 | + args.append(self.define_from_variant('ENABLE_UMFPACK', 'suite-sparse')) |
| 79 | + |
| 80 | + return args |
0 commit comments