41 int main(
int argc,
char *argv[])
44 const char *mesh_file =
"../data/star.mesh";
46 bool visualization = 1;
49 args.
AddOption(&mesh_file,
"-m",
"--mesh",
52 "Finite element order (polynomial degree).");
53 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
55 "Enable or disable GLVis visualization.");
67 Mesh mesh(mesh_file, 1, 1);
76 for (
int i = 0; i < 2; i++)
108 "Boundary attributes required in the mesh.");
113 char vishost[] =
"localhost";
118 sol_sock.
open(vishost, visport);
139 const int max_dofs = 50000;
140 for (
int it = 0; ; it++)
143 cout <<
"\nAMR iteration " << it << endl;
144 cout <<
"Number of unknowns: " << cdofs << endl;
161 const int copy_interior = 1;
164 #ifndef MFEM_USE_SUITESPARSE
168 PCG(A, M, B, X, 3, 200, 1e-12, 0.0);
173 umf_solver.
Control[UMFPACK_ORDERING] = UMFPACK_ORDERING_METIS;
175 umf_solver.
Mult(B, X);
184 if (visualization && sol_sock.good())
186 sol_sock.precision(8);
187 sol_sock <<
"solution\n" << mesh << x << flush;
190 if (cdofs > max_dofs)
192 cout <<
"Reached the maximum number of dofs. Stop." << endl;
203 cout <<
"Stopping criterion satisfied. Stop." << endl;
int Size() const
Logical size of the array.
Class for domain integration L(v) := (f, v)
void SetAnisotropic(bool aniso=true)
Enable/disable anisotropic estimates. To enable this option, the BilinearFormIntegrator must support ...
Class for grid function - Vector with associated FE space.
virtual void Update(bool want_transform=true)
Subclass constant coefficient.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
int main(int argc, char *argv[])
Data type for Gauss-Seidel smoother of sparse matrix.
Direct sparse solver using UMFPACK.
bool Apply(Mesh &mesh)
Perform the mesh operation.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
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 PCG(const Operator &A, Solver &B, const Vector &b, Vector &x, int print_iter, int max_num_iter, double RTOLERANCE, double ATOLERANCE)
Preconditioned conjugate gradient method. (tolerances are squared)
virtual int GetTrueVSize() const
Return the number of vector true (conforming) dofs.
void PrintUsage(std::ostream &out) const
int SpaceDimension() const
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
double Control[UMFPACK_CONTROL]
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
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)
virtual void Update()
Transform by the Space UpdateMatrix (e.g., on Mesh change).
NURBSExtension * NURBSext
Optional NURBS mesh extension.
void PrintOptions(std::ostream &out) const
int open(const char hostname[], int port)
The ZienkiewiczZhuEstimator class implements the Zienkiewicz-Zhu error estimation procedure...
Arbitrary order H1-conforming (continuous) finite elements.
void SetTotalErrorFraction(double fraction)
Set the total fraction used in the computation of the threshold. The default value is 1/2...
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
void ProjectBdrCoefficient(Coefficient &coeff, Array< int > &attr)
virtual void SetOperator(const Operator &op)
Factorize the given Operator op which must be a SparseMatrix.