41 #include "mfem-performance.hpp"
72 int main(
int argc,
char *argv[])
75 const char *mesh_file =
"../../data/fichera.mesh";
77 bool static_cond =
false;
78 bool visualization = 1;
82 args.
AddOption(&mesh_file,
"-m",
"--mesh",
85 "Finite element order (polynomial degree) or -1 for"
86 " isoparametric space.");
87 args.
AddOption(&perf,
"-perf",
"--hpc-version",
"-std",
"--standard-version",
88 "Enable high-performance, tensor-based, assembly.");
89 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
90 "--no-static-condensation",
"Enable static condensation.");
91 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
93 "Enable or disable GLVis visualization.");
105 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
111 cout <<
"High-performance version using integration rule with "
112 << int_rule_t::qpts <<
" points ..." << endl;
113 if (!mesh_t::MatchesGeometry(*mesh))
115 cout <<
"The given mesh does not match the optimized 'geom' parameter.\n"
116 <<
"Recompile with suitable 'geom' value." << endl;
120 else if (!mesh_t::MatchesNodes(*mesh))
122 cout <<
"Switching the mesh curvature to match the "
123 <<
"optimized value (order " <<
mesh_p <<
") ..." << endl;
134 (int)floor(log(50000./mesh->
GetNE())/log(2.)/
dim);
135 for (
int l = 0; l < ref_levels; l++)
152 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
159 cout <<
"Number of finite element unknowns: "
163 if (perf && !sol_fes_t::Matches(*fespace))
165 cout <<
"The given order does not match the optimized parameter.\n"
166 <<
"Recompile with suitable 'sol_p' value." << endl;
209 cout <<
"Assembling the matrix ..." << flush;
233 cout <<
"Size of linear system: " << A.
Height() << endl;
235 #ifndef MFEM_USE_SUITESPARSE
239 PCG(A, M, B, X, 1, 500, 1e-12, 0.0);
243 umf_solver.
Control[UMFPACK_ORDERING] = UMFPACK_ORDERING_METIS;
245 umf_solver.
Mult(B, X);
253 ofstream mesh_ofs(
"refined.mesh");
254 mesh_ofs.precision(8);
255 mesh->
Print(mesh_ofs);
256 ofstream sol_ofs(
"sol.gf");
257 sol_ofs.precision(8);
263 char vishost[] =
"localhost";
266 sol_sock.precision(8);
267 sol_sock <<
"solution\n" << *mesh << x << flush;
274 if (order > 0) {
delete fec; }
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.
int main(int argc, char *argv[])
Data type for Gauss-Seidel smoother of sparse matrix.
Direct sparse solver using UMFPACK.
virtual void Save(std::ostream &out) const
Save the GridFunction to an output stream.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows.
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
virtual void Print(std::ostream &out=std::cout) const
Print the mesh to the given stream using the default MFEM mesh format.
Array< int > bdr_attributes
double Control[UMFPACK_CONTROL]
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 int GetTrueVSize()
Return the number of vector true (conforming) dofs.
virtual const char * Name() const
void PrintOptions(std::ostream &out) const
void GetNodes(Vector &node_coord) const
Arbitrary order H1-conforming (continuous) finite elements.
virtual void Mult(const Vector &b, Vector &x) const
Operator application.
virtual void SetOperator(const Operator &op)
Set/update the solver for the given operator.