Skip to content
Snippets Groups Projects
Commit d7e84fe0 authored by Ali Dorostkar's avatar Ali Dorostkar
Browse files

dealii, test for specific version

Specified that test case “step-40” is only to be run when using dealii
version 8.4.0 or later
parent 04061ece
Branches
Tags
No related merge requests found
...@@ -228,54 +228,55 @@ def install(self, spec, prefix): ...@@ -228,54 +228,55 @@ def install(self, spec, prefix):
# take step-40 which can use both PETSc and Trilinos # take step-40 which can use both PETSc and Trilinos
# FIXME: switch step-40 to MPI run # FIXME: switch step-40 to MPI run
with working_dir('examples/step-40'): if spec.satisfies('@8.4.0:'):
print('=====================================') with working_dir('examples/step-40'):
print('========== Step-40 PETSc ============') print('=====================================')
print('=====================================') print('========== Step-40 PETSc ============')
# list the number of cycles to speed up print('=====================================')
filter_file(r'(const unsigned int n_cycles = 8;)', # list the number of cycles to speed up
('const unsigned int n_cycles = 2;'), 'step-40.cc') filter_file(r'(const unsigned int n_cycles = 8;)',
cmake('.') ('const unsigned int n_cycles = 2;'), 'step-40.cc')
if '^petsc' in spec: cmake('.')
make('release') if '^petsc' in spec:
make('run', parallel=False) make('release')
make('run', parallel=False)
print('=====================================')
print('========= Step-40 Trilinos ==========') print('=====================================')
print('=====================================') print('========= Step-40 Trilinos ==========')
# change Linear Algebra to Trilinos print('=====================================')
filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', # change Linear Algebra to Trilinos
('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)',
if '^trilinos+hypre' in spec: ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc')
make('release') if '^trilinos+hypre' in spec:
make('run', parallel=False) make('release')
make('run', parallel=False)
print('=====================================') print('=====================================')
print('=== Step-40 Trilinos SuperluDist ====') print('=== Step-40 Trilinos SuperluDist ====')
print('=====================================') print('=====================================')
# change to direct solvers # change to direct solvers
filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc') # NOQA: ignore=E501 filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc') # NOQA: ignore=E501
filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)', filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)',
(''), 'step-40.cc') (''), 'step-40.cc')
filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)',
(''), 'step-40.cc') (''), 'step-40.cc')
filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', filter_file(r'(preconditioner.initialize\(system_matrix, data\);)',
(''), 'step-40.cc') (''), 'step-40.cc')
filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') # NOQA: ignore=E501 filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') # NOQA: ignore=E501
filter_file(r'(preconditioner\);)', (''), 'step-40.cc') filter_file(r'(preconditioner\);)', (''), 'step-40.cc')
if '^trilinos+superlu-dist' in spec: if '^trilinos+superlu-dist' in spec:
make('release') make('release')
make('run', paralle=False) make('run', paralle=False)
print('=====================================') print('=====================================')
print('====== Step-40 Trilinos MUMPS =======') print('====== Step-40 Trilinos MUMPS =======')
print('=====================================') print('=====================================')
# switch to Mumps # switch to Mumps
filter_file(r'(Amesos_Superludist)', filter_file(r'(Amesos_Superludist)',
('Amesos_Mumps'), 'step-40.cc') ('Amesos_Mumps'), 'step-40.cc')
if '^trilinos+mumps' in spec: if '^trilinos+mumps' in spec:
make('release') make('release')
make('run', parallel=False) make('run', parallel=False)
print('=====================================') print('=====================================')
print('============ Step-36 ================') print('============ Step-36 ================')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment