73int main(
int argc,
char *argv[])
82 const char *mesh_file =
"../data/star.mesh";
84 bool static_cond =
false;
87 const char *device_config =
"cpu";
88 bool visualization =
true;
89 bool algebraic_ceed =
false;
91 bool cudss_solver =
false;
95 args.
AddOption(&mesh_file,
"-m",
"--mesh",
98 "Finite element order (polynomial degree) or -1 for"
99 " isoparametric space.");
100 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
101 "--no-static-condensation",
"Enable static condensation.");
102 args.
AddOption(&pa,
"-pa",
"--partial-assembly",
"-no-pa",
103 "--no-partial-assembly",
"Enable Partial Assembly.");
104 args.
AddOption(&fa,
"-fa",
"--full-assembly",
"-no-fa",
105 "--no-full-assembly",
"Enable Full Assembly.");
106 args.
AddOption(&device_config,
"-d",
"--device",
107 "Device configuration string, see Device::Configure().");
109 args.
AddOption(&algebraic_ceed,
"-a",
"--algebraic",
110 "-no-a",
"--no-algebraic",
111 "Use algebraic Ceed solver");
114 args.
AddOption(&cudss_solver,
"-cudss",
"--cudss-solver",
"-no-cudss",
115 "--no-cudss-solver",
"Use the cuDSS Solver.");
117 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
118 "--no-visualization",
119 "Enable or disable GLVis visualization.");
136 Device device(device_config);
137 if (myid == 0) { device.
Print(); }
142 Mesh mesh(mesh_file, 1, 1);
151 (int)floor(log(10000./mesh.
GetNE())/log(2.)/
dim);
152 for (
int l = 0; l < ref_levels; l++)
161 ParMesh pmesh(MPI_COMM_WORLD, mesh);
164 int par_ref_levels = 2;
165 for (
int l = 0; l < par_ref_levels; l++)
188 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
199 cout <<
"Number of finite element unknowns: " << size << endl;
237 if (pa) {
a.SetAssemblyLevel(AssemblyLevel::PARTIAL); }
240 a.SetAssemblyLevel(AssemblyLevel::FULL);
252 if (static_cond) {
a.EnableStaticCondensation(); }
271 cudss_solver.
Mult(B, X);
301 cg.SetPreconditioner(*prec);
315 ostringstream mesh_name, sol_name;
316 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
317 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
319 ofstream mesh_ofs(mesh_name.str().c_str());
320 mesh_ofs.precision(8);
321 pmesh.
Print(mesh_ofs);
323 ofstream sol_ofs(sol_name.str().c_str());
324 sol_ofs.precision(8);
334 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
335 sol_sock.precision(8);
336 sol_sock <<
"solution\n" << pmesh << x << flush;
340 if (order > 0) {
delete fec; }
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
int Size() const
Return the logical size of the array.
@ GaussLobatto
Closed type.
@ Positive
Bernstein polynomials.
Conjugate gradient method.
A coefficient that is constant across space and time.
cuDSS: A high-performance CUDA Library for Direct Sparse Solvers
void Mult(const Vector &x, Vector &y) const override
Solve .
void SetOperator(const Operator &op) override
Set/update the solver for the given operator.
@ SYMMETRIC_POSITIVE_DEFINITE
CUDSS_MTYPE_SPD: Symmetric positive-definite matrix.
@ UPPER
CUDSS_MVIEW_UPPER: Upper-triangular matrix (including the diagonal).
void SetMatrixViewType(MatViewType mvtype)
Set the matrix view type.
void SetMatrixSymType(MatType mtype_)
Set the matrix type.
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
void Print(std::ostream &os=mfem::out)
Print the configuration of the MFEM virtual device object.
static bool Allows(unsigned long b_mask)
Return true if any of the backends in the backend mask, b_mask, are allowed.
static bool IsEnabled()
Return true if any backend other than Backend::CPU is enabled.
Class for domain integration .
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
virtual const char * Name() const
Arbitrary order H1-conforming (continuous) finite elements.
The BoomerAMG solver in hypre.
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
void Clear()
Clear the contents of the Mesh.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
bool IsSimplexMesh() const
Returns true if the mesh is a simplex mesh, false otherwise.
void GetNodes(Vector &node_coord) const
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
static int WorldRank()
Return the MPI rank in MPI_COMM_WORLD.
static int WorldSize()
Return the size of MPI_COMM_WORLD.
static void Init(int &argc, char **&argv, int required=default_thread_required, int *provided=nullptr)
Singleton creation with Mpi::Init(argc, argv).
Pointer to an Operator of a specified type.
Jacobi smoothing for a given bilinear form (no matrix necessary).
virtual void RecoverFEMSolution(const Vector &X, const Vector &b, Vector &x)
Reconstruct a solution vector x (e.g. a GridFunction) from the solution X of a constrained linear sys...
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void PrintUsage(std::ostream &out) const
Print the usage message.
void PrintOptions(std::ostream &out) const
Print the options.
void AddOption(bool *var, const char *enable_short_name, const char *enable_long_name, const char *disable_short_name, const char *disable_long_name, const char *description, bool required=false)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
bool Good() const
Return true if the command line options were parsed successfully.
Abstract parallel finite element space.
void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1) const override
HYPRE_BigInt GlobalTrueVSize() const
Class for parallel grid function.
void Save(std::ostream &out) const override
Class for parallel meshes.
void MarkExternalBoundaries(Array< int > &bdr_marker, bool excl=true) const override
Mark boundary attributes of external boundaries.
void Print(std::ostream &out=mfem::out, const std::string &comments="") const override
Wrapper for AlgebraicMultigrid object.
const int * ess_tdof_list
bool UsesTensorBasis(const FiniteElementSpace &fes)
Return true if the mesh contains only one topology and the elements are tensor elements.
@ CUDA_MASK
Biwise-OR of all CUDA backends.