Skip to content

Commit 86aa5fa

Browse files
committed
Require PETSc >= 3.12.2 + hypre if using AMS/ADS in Vector FE Exs. 3, 4 and 10
1 parent 2998967 commit 86aa5fa

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

examples/vector_fe/vector_fe_ex10/vector_fe_ex10.C

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
// Basic utilities.
2929
#include "libmesh/string_to_enum.h"
30+
#include "libmesh/petsc_macro.h"
3031

3132
// The solver packages supported by libMesh.
3233
#include "libmesh/enum_solver_package.h"
@@ -95,6 +96,11 @@ int main (int argc, char ** argv)
9596
// But allow the command line to override it.
9697
infile.parse_command_line(argc, argv);
9798

99+
// hypre AMS/ADS requires PETSc 3.12.2 or above with hypre support enabled
100+
libmesh_example_requires((!infile.search("ams") && !infile.search("ads")) ||
101+
(!PETSC_VERSION_LESS_THAN(3, 12, 2) && LIBMESH_HAVE_PETSC_HYPRE),
102+
"PETSc 3.12.2 or above with hypre support enabled");
103+
98104
// Read in parameters from the command line and the input file.
99105
const unsigned int dimension = infile("dim", 2);
100106
const unsigned int grid_size = infile("grid_size", 15);

examples/vector_fe/vector_fe_ex3/vector_fe_ex3.C

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "libmesh/string_to_enum.h"
3737
#include "libmesh/enum_solver_package.h"
3838
#include "libmesh/enum_norm_type.h"
39+
#include "libmesh/petsc_macro.h"
3940

4041
// The systems and solvers we may use
4142
#include "curl_curl_system.h"
@@ -65,6 +66,11 @@ int main (int argc, char ** argv)
6566
// But allow the command line to override it.
6667
infile.parse_command_line(argc, argv);
6768

69+
// hypre AMS requires PETSc 3.12.2 or above with hypre support enabled
70+
libmesh_example_requires(!infile.search("ams") ||
71+
(!PETSC_VERSION_LESS_THAN(3, 12, 2) && LIBMESH_HAVE_PETSC_HYPRE),
72+
"PETSc 3.12.2 or above with hypre support enabled");
73+
6874
// Read in parameters from the input file
6975
const unsigned int grid_size = infile("grid_size", 2);
7076

examples/vector_fe/vector_fe_ex4/vector_fe_ex4.C

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "libmesh/string_to_enum.h"
3535
#include "libmesh/enum_solver_package.h"
3636
#include "libmesh/enum_norm_type.h"
37+
#include "libmesh/petsc_macro.h"
3738

3839
// The systems and solvers we may use
3940
#include "curl_curl_system.h"
@@ -60,6 +61,11 @@ int main (int argc, char ** argv)
6061
// But allow the command line to override it.
6162
infile.parse_command_line(argc, argv);
6263

64+
// hypre AMS requires PETSc 3.12.2 or above with hypre support enabled
65+
libmesh_example_requires(!infile.search("ams") ||
66+
(!PETSC_VERSION_LESS_THAN(3, 12, 2) && LIBMESH_HAVE_PETSC_HYPRE),
67+
"PETSc 3.12.2 or above with hypre support enabled");
68+
6369
// Read in parameters from the input file
6470
const unsigned int grid_size = infile("grid_size", 2);
6571

0 commit comments

Comments
 (0)