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 ifstream imesh(mesh_file);
70 cerr <<
"\nCan not open mesh file: " << mesh_file <<
'\n' << endl;
73 Mesh mesh(imesh, 1, 1);
83 for (
int i = 0; i < 2; i++)
114 "Boundary attributes required in the mesh.");
119 char vishost[] =
"localhost";
124 sol_sock.
open(vishost, visport);
131 const int max_dofs = 50000;
132 for (
int it = 0; ; it++)
135 cout <<
"\nIteration " << it << endl;
136 cout <<
"Number of unknowns: " << cdofs << endl;
158 #ifndef MFEM_USE_SUITESPARSE
162 PCG(A, M, B, X, 2, 200, 1e-12, 0.0);
167 umf_solver.
Control[UMFPACK_ORDERING] = UMFPACK_ORDERING_METIS;
169 umf_solver.
Mult(B, X);
178 if (visualization && sol_sock.good())
180 sol_sock.precision(8);
181 sol_sock <<
"solution\n" << mesh << x << flush;
184 if (cdofs > max_dofs)
204 const double frac = 0.7;
206 double threshold = (frac*frac) * errors.
Max();
207 for (
int i = 0; i < errors.Size(); i++)
209 if (errors[i] >= threshold)
int Size() const
Logical size of the array.
Class for domain integration L(v) := (f, v)
Class for grid function - Vector with associated FE space.
Subclass constant coefficient.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list)
int GetNE() const
Returns number of elements.
Data type for Gauss-Seidel smoother of sparse matrix.
Direct sparse solver using UMFPACK.
int Append(const T &el)
Append element to array, resize if necessary.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
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)
void PrintUsage(std::ostream &out) const
void ZZErrorEstimator(BilinearFormIntegrator &blfi, GridFunction &u, GridFunction &flux, Vector &error_estimates, Array< int > *aniso_flags, int with_subdomains)
int SpaceDimension() const
Array< int > bdr_attributes
void UseTwoLevelState(int use)
int main(int argc, char *argv[])
double Control[UMFPACK_CONTROL]
Abstract finite element space.
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
virtual int GetTrueVSize()
Return the number of vector true (conforming) dofs.
virtual void UpdateAndInterpolate(int num_grid_fns,...)
void PrintOptions(std::ostream &out) const
int open(const char hostname[], int port)
Arbitrary order H1-conforming (continuous) finite elements.
void GeneralRefinement(const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0)
virtual void Mult(const Vector &b, Vector &x) const
Operator application.
void ProjectBdrCoefficient(Coefficient &coeff, Array< int > &attr)
virtual void SetOperator(const Operator &op)
Set/update the solver for the given operator.