41 #include "mfem-performance.hpp"
72 int main(
int argc,
char *argv[])
76 MPI_Init(&argc, &argv);
77 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
78 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
81 const char *mesh_file =
"../../data/fichera.mesh";
83 bool static_cond =
false;
84 bool visualization = 1;
88 args.
AddOption(&mesh_file,
"-m",
"--mesh",
91 "Finite element order (polynomial degree) or -1 for"
92 " isoparametric space.");
93 args.
AddOption(&perf,
"-perf",
"--hpc-version",
"-std",
"--standard-version",
94 "Enable high-performance, tensor-based, assembly.");
95 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
96 "--no-static-condensation",
"Enable static condensation.");
97 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
99 "Enable or disable GLVis visualization.");
118 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
126 cout <<
"High-performance version using integration rule with "
127 << int_rule_t::qpts <<
" points ..." << endl;
129 if (!mesh_t::MatchesGeometry(*mesh))
133 cout <<
"The given mesh does not match the optimized 'geom' parameter.\n"
134 <<
"Recompile with suitable 'geom' value." << endl;
140 else if (!mesh_t::MatchesNodes(*mesh))
144 cout <<
"Switching the mesh curvature to match the "
145 <<
"optimized value (order " <<
mesh_p <<
") ..." << endl;
157 (int)floor(log(10000./mesh->
GetNE())/log(2.)/
dim);
158 for (
int l = 0; l < ref_levels; l++)
170 int par_ref_levels = 1;
171 for (
int l = 0; l < par_ref_levels; l++)
190 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
201 cout <<
"Number of finite element unknowns: " << size << endl;
205 if (perf && !sol_fes_t::Matches(*fespace))
209 cout <<
"The given order does not match the optimized parameter.\n"
210 <<
"Recompile with suitable 'sol_p' value." << endl;
257 cout <<
"Assembling the matrix ..." << flush;
307 ostringstream mesh_name, sol_name;
308 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
309 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
311 ofstream mesh_ofs(mesh_name.str().c_str());
312 mesh_ofs.precision(8);
313 pmesh->
Print(mesh_ofs);
315 ofstream sol_ofs(sol_name.str().c_str());
316 sol_ofs.precision(8);
323 char vishost[] =
"localhost";
326 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
327 sol_sock.precision(8);
328 sol_sock <<
"solution\n" << *pmesh << x << flush;
337 if (order > 0) {
delete fec; }
int Size() const
Logical size of the array.
Class for domain integration L(v) := (f, v)
Subclass constant coefficient.
HYPRE_Int GlobalTrueVSize()
int GetNE() const
Returns number of elements.
virtual void Save(std::ostream &out) const
Abstract parallel finite element space.
int main(int argc, char *argv[])
void SetPrintLevel(int print_lvl)
The BoomerAMG solver in hypre.
HYPRE_Int GetGlobalNumRows() const
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
void PrintUsage(std::ostream &out) const
void SetMaxIter(int max_iter)
Array< int > bdr_attributes
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)
virtual const char * Name() const
void SetPreconditioner(HypreSolver &precond)
Set the hypre solver to be used as a preconditioner.
void PrintOptions(std::ostream &out) const
Abstract class for hypre's solvers and preconditioners.
void GetNodes(Vector &node_coord) const
Arbitrary order H1-conforming (continuous) finite elements.
Class for parallel grid function.
Wrapper for hypre's ParCSR matrix class.
virtual void Mult(const HypreParVector &b, HypreParVector &x) const
Solve Ax=b with hypre's PCG.
Class for parallel meshes.
virtual void Print(std::ostream &out=std::cout) const