59 int main(
int argc,
char *argv[])
62 Mpi::Init(argc, argv);
63 int num_procs = Mpi::WorldSize();
64 int myid = Mpi::WorldRank();
67 cali::ConfigManager mgr;
72 const char *mesh_file =
"../../data/star.mesh";
74 bool static_cond =
false;
76 const char *device_config =
"cpu";
77 bool visualization =
true;
78 const char* cali_config =
"runtime-report";
81 args.
AddOption(&mesh_file,
"-m",
"--mesh",
84 "Finite element order (polynomial degree) or -1 for" 85 " isoparametric space.");
86 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
87 "--no-static-condensation",
"Enable static condensation.");
88 args.
AddOption(&pa,
"-pa",
"--partial-assembly",
"-no-pa",
89 "--no-partial-assembly",
"Enable Partial Assembly.");
90 args.
AddOption(&device_config,
"-d",
"--device",
91 "Device configuration string, see Device::Configure().");
92 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
94 "Enable or disable GLVis visualization.");
95 args.
AddOption(&cali_config,
"-p",
"--caliper",
96 "Caliper configuration string.");
113 Device device(device_config);
114 if (myid == 0) { device.
Print(); }
117 mgr.add(cali_config);
123 Mesh mesh(mesh_file, 1, 1);
132 (int)floor(log(10000./mesh.
GetNE())/log(2.)/
dim);
133 for (
int l = 0; l < ref_levels; l++)
142 ParMesh pmesh(MPI_COMM_WORLD, mesh);
145 int par_ref_levels = 2;
146 for (
int l = 0; l < par_ref_levels; l++)
168 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
180 cout <<
"Number of finite element unknowns: " << size << endl;
198 MFEM_PERF_BEGIN(
"Set up the linear form");
203 MFEM_PERF_END(
"Set up the linear form");
214 MFEM_PERF_BEGIN(
"Set up the bilinear form");
216 if (pa) {
a.SetAssemblyLevel(AssemblyLevel::PARTIAL); }
223 if (static_cond) {
a.EnableStaticCondensation(); }
228 a.FormLinearSystem(ess_tdof_list, x,
b, A, X, B);
229 MFEM_PERF_END(
"Set up the bilinear form");
234 MFEM_PERF_SCOPE(
"Solve A X=B");
258 a.RecoverFEMSolution(X,
b, x);
262 MFEM_PERF_BEGIN(
"Save the results");
264 ostringstream mesh_name, sol_name;
265 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
266 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
268 ofstream mesh_ofs(mesh_name.str().c_str());
269 mesh_ofs.precision(8);
270 pmesh.
Print(mesh_ofs);
272 ofstream sol_ofs(sol_name.str().c_str());
273 sol_ofs.precision(8);
276 MFEM_PERF_END(
"Save the results");
283 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
284 sol_sock.precision(8);
285 sol_sock <<
"solution\n" << pmesh << x << flush;
Class for domain integration L(v) := (f, v)
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
Conjugate gradient method.
A coefficient that is constant across space and time.
void PrintOptions(std::ostream &out) const
Print the options.
void PrintUsage(std::ostream &out) const
Print the usage message.
Pointer to an Operator of a specified type.
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
bool Good() const
Return true if the command line options were parsed successfully.
Abstract parallel finite element space.
bool UsesTensorBasis(const FiniteElementSpace &fes)
Return true if the mesh contains only one topology and the elements are tensor elements.
The BoomerAMG solver in hypre.
virtual void SetPrintLevel(int print_lvl)
Legacy method to set the level of verbosity of the solver output.
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
Jacobi smoothing for a given bilinear form (no matrix necessary).
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetMaxIter(int max_it)
virtual const char * Name() const
HYPRE_BigInt GlobalTrueVSize() const
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
void SetRelTol(double rtol)
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
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)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
int main(int argc, char *argv[])
virtual void Save(std::ostream &out) const
int GetNE() const
Returns number of elements.
int Size() const
Return the logical size of the array.
void Clear()
Clear the contents of the Mesh.
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
Arbitrary order H1-conforming (continuous) finite elements.
void GetNodes(Vector &node_coord) const
void Print(std::ostream &out=mfem::out) const override
Class for parallel grid function.
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
Class for parallel meshes.