46 int main(
int argc,
char *argv[])
50 MPI_Init(&argc, &argv);
51 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
52 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
55 const char *mesh_file =
"../data/star.mesh";
58 const char *device_config =
"cpu";
59 bool visualization =
true;
62 args.
AddOption(&mesh_file,
"-m",
"--mesh",
65 "Finite element order (polynomial degree).");
66 args.
AddOption(&pa,
"-pa",
"--partial-assembly",
"-no-pa",
67 "--no-partial-assembly",
"Enable Partial Assembly.");
68 args.
AddOption(&device_config,
"-d",
"--device",
69 "Device configuration string, see Device::Configure().");
70 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
72 "Enable or disable GLVis visualization.");
90 Device device(device_config);
91 if (myid == 0) { device.
Print(); }
96 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
112 ParMesh pmesh(MPI_COMM_WORLD, *mesh);
116 "Boundary attributes required in the mesh.");
144 char vishost[] =
"localhost";
150 sout.
open(vishost, visport);
155 cout <<
"Unable to connect to GLVis server at "
156 << vishost <<
':' << visport << endl;
157 cout <<
"GLVis visualization disabled.\n";
159 visualization =
false;
188 const int max_dofs = 100000;
189 for (
int it = 0; ; it++)
194 cout <<
"\nAMR iteration " << it << endl;
195 cout <<
"Number of unknowns: " << global_dofs << endl;
215 const int copy_interior = 1;
240 sout <<
"parallel " << num_procs <<
" " << myid <<
"\n";
241 sout <<
"solution\n" << pmesh << x << flush;
244 if (global_dofs > max_dofs)
248 cout <<
"Reached the maximum number of dofs. Stop." << endl;
257 refiner.
Apply(pmesh);
262 cout <<
"Stopping criterion satisfied. Stop." << endl;
int Size() const
Logical size of the array.
Class for domain integration L(v) := (f, v)
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
Conjugate gradient method.
Subclass constant coefficient.
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
virtual void Update(bool want_transform=true)
Pointer to an Operator of a specified type.
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
Abstract parallel finite element space.
int main(int argc, char *argv[])
The L2ZienkiewiczZhuEstimator class implements the Zienkiewicz-Zhu error estimation procedure where t...
The BoomerAMG solver in hypre.
bool Apply(Mesh &mesh)
Perform the mesh operation.
void Rebalance()
Load balance the mesh. NC meshes only.
bool Nonconforming() const
void SetPrintLevel(int print_lvl)
virtual void Update()
Transform by the Space UpdateMatrix (e.g., on Mesh change).
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetPrintLevel(int print_level)
Mesh refinement operator using an error threshold.
void SetMaxIter(int max_it)
void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
HYPRE_Int GlobalTrueVSize() const
void PrintUsage(std::ostream &out) const
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
int SpaceDimension() const
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
void SetRelTol(double rtol)
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)
NURBSExtension * NURBSext
Optional NURBS mesh extension.
void PrintOptions(std::ostream &out) const
void EnsureNCMesh(bool triangles_nonconforming=false)
int open(const char hostname[], int port)
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
Arbitrary order H1-conforming (continuous) finite elements.
Class for parallel grid function.
void SetTotalErrorFraction(double fraction)
Set the total fraction used in the computation of the threshold. The default value is 1/2...
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
Class for parallel meshes.
Arbitrary order "L2-conforming" discontinuous finite elements.