49 #include "../solvers/lor_mms.hpp" 56 int main(
int argc,
char *argv[])
58 Mpi::Init(argc, argv);
61 const char *mesh_file =
"../../data/star.mesh";
62 const char *device_config =
"cpu";
69 args.
AddOption(&device_config,
"-d",
"--device",
70 "Device configuration string, see Device::Configure().");
71 args.
AddOption(&mesh_file,
"-m",
"--mesh",
"Mesh file to use.");
72 args.
AddOption(&ser_ref,
"-rs",
"--serial-refine",
73 "Number of times to refine the mesh in serial.");
74 args.
AddOption(&par_ref,
"-rp",
"--parallel-refine",
75 "Number of times to refine the mesh in parallel.");
76 args.
AddOption(&order,
"-o",
"--order",
"Polynomial degree.");
77 args.
AddOption(&
alpha,
"-a",
"--alpha",
"Value of alpha coefficient.");
80 Device device(device_config);
81 if (Mpi::Root()) { device.
Print(); }
85 MFEM_VERIFY(
dim == 2 ||
dim == 3,
"Spatial dimension must be 2 or 3.");
87 const int b1 = BasisType::GaussLobatto, b2 = BasisType::GaussLegendre;
88 const int mt = FiniteElement::VALUE;
99 cout <<
"\nRT DOFs: " << ndofs_rt <<
"\nL2 DOFs: " << ndofs_l2 << endl;
120 if (Mpi::Root()) { cout <<
"\nSaddle point solver... " << flush; }
142 const auto solver_mode = HdivSaddlePointSolver::Mode::DARCY;
144 mesh, fes_rt, fes_l2, alpha_coeff, one, ess_rt_dofs, solver_mode);
154 saddle_point_solver.
Mult(B_block, X_block);
155 X_block.SyncToBlocks();
159 cout <<
"Done.\nIterations: " 167 if (Mpi::Root()) { cout <<
"L2 error: " << error << endl; }
174 Mesh serial_mesh = Mesh::LoadFromFile(mesh_file);
176 ParMesh mesh(MPI_COMM_WORLD, serial_mesh);
Class for domain integration L(v) := (f, v)
A class to handle Vectors in a block fashion.
A coefficient that is constant across space and time.
int Dimension() const
Dimension of the reference space used within the elements.
void SyncFromBlocks() const
Synchronize the memory location flags (i.e. the memory validity flags) of the big/monolithic block-ve...
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
double RealTime()
Return the number of real seconds elapsed since the stopwatch was started.
Abstract parallel finite element space.
void Mult(const Vector &b, Vector &x) const override
Solve the linear system for L2 (scalar) and RT (flux) unknowns.
virtual void SetFromTrueDofs(const Vector &tv)
Set the GridFunction from the given true-dof vector.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
virtual double ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[]=NULL, const Array< int > *elems=NULL) const
HYPRE_BigInt GlobalTrueVSize() const
void Start()
Start the stopwatch. The elapsed time is not cleared.
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
Solve the H(div) saddle-point system using MINRES with matrix-free block-diagonal preconditioning...
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...
int main(int argc, char *argv[])
void Clear()
Clear the contents of the Mesh.
A general function coefficient.
double u(const Vector &xvec)
Class for parallel grid function.
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
const Array< int > & GetOffsets() const
Return the offsets of the block system.
Class for parallel meshes.
void ParseCheck(std::ostream &out=mfem::out)
void Clear()
Clear the elapsed time on the stopwatch and restart it if it's running.
int GetNumIterations() const
Get the number of MINRES iterations.
ParMesh LoadParMesh(const char *mesh_file, int ser_ref=0, int par_ref=0)
Vector & GetBlock(int i)
Get the i-th vector in the block.
Arbitrary order "L2-conforming" discontinuous finite elements.
double f(const Vector &p)