41 int main(
int argc,
char *argv[])
45 MPI_Init(&argc, &argv);
46 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
47 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
50 const char *mesh_file =
"../data/star.mesh";
52 bool visualization =
true;
55 args.
AddOption(&mesh_file,
"-m",
"--mesh",
58 "Finite element order (polynomial degree).");
59 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
61 "Enable or disable GLVis visualization.");
80 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
96 ParMesh pmesh(MPI_COMM_WORLD, *mesh);
100 "Boundary attributes required in the mesh.");
127 char vishost[] =
"localhost";
133 sout.
open(vishost, visport);
138 cout <<
"Unable to connect to GLVis server at "
139 << vishost <<
':' << visport << endl;
140 cout <<
"GLVis visualization disabled.\n";
142 visualization =
false;
171 const int max_dofs = 100000;
172 for (
int it = 0; ; it++)
177 cout <<
"\nAMR iteration " << it << endl;
178 cout <<
"Number of unknowns: " << global_dofs << endl;
196 const int copy_interior = 1;
208 pcg.SetPrintLevel(3);
218 sout <<
"parallel " << num_procs <<
" " << myid <<
"\n";
219 sout <<
"solution\n" << pmesh << x << flush;
222 if (global_dofs > max_dofs)
226 cout <<
"Reached the maximum number of dofs. Stop." << endl;
235 refiner.
Apply(pmesh);
240 cout <<
"Stopping criterion satisfied. Stop." << endl;
int Size() const
Logical size of the array.
Class for domain integration L(v) := (f, v)
Conjugate gradient method.
MPI_Comm GetComm() const
MPI communicator.
Subclass constant coefficient.
virtual void Update(bool want_transform=true)
HYPRE_Int GlobalTrueVSize()
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
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 UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetPrintLevel(int print_level)
Mesh refinement operator using an error threshold.
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.
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.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list)
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 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...
Wrapper for hypre's ParCSR matrix class.
Class for parallel meshes.
Arbitrary order "L2-conforming" discontinuous finite elements.