55 int main(
int argc,
char *argv[])
59 MPI_Init(&argc, &argv);
60 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
61 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
64 const char *mesh_file =
"../data/star.mesh";
66 bool static_cond =
false;
68 const char *device_config =
"cpu";
69 bool visualization =
true;
72 args.
AddOption(&mesh_file,
"-m",
"--mesh",
75 "Finite element order (polynomial degree) or -1 for"
76 " isoparametric space.");
77 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
78 "--no-static-condensation",
"Enable static condensation.");
79 args.
AddOption(&pa,
"-pa",
"--partial-assembly",
"-no-pa",
80 "--no-partial-assembly",
"Enable Partial Assembly.");
81 args.
AddOption(&device_config,
"-d",
"--device",
82 "Device configuration string, see Device::Configure().");
83 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
85 "Enable or disable GLVis visualization.");
103 Device device(device_config);
104 if (myid == 0) { device.
Print(); }
109 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
118 (int)floor(log(10000./mesh->
GetNE())/log(2.)/
dim);
119 for (
int l = 0; l < ref_levels; l++)
131 int par_ref_levels = 2;
132 for (
int l = 0; l < par_ref_levels; l++)
151 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
162 cout <<
"Number of finite element unknowns: " << size << endl;
230 ostringstream mesh_name, sol_name;
231 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
232 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
234 ofstream mesh_ofs(mesh_name.str().c_str());
235 mesh_ofs.precision(8);
236 pmesh->
Print(mesh_ofs);
238 ofstream sol_ofs(sol_name.str().c_str());
239 sol_ofs.precision(8);
246 char vishost[] =
"localhost";
249 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
250 sol_sock.precision(8);
251 sol_sock <<
"solution\n" << *pmesh << x << flush;
258 if (order > 0) {
delete fec; }
int Size() const
Logical size of the array.
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.
Subclass constant coefficient.
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
Pointer to an Operator of a specified type.
int GetNE() const
Returns number of elements.
virtual void Save(std::ostream &out) const
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
Abstract parallel finite element space.
int main(int argc, char *argv[])
The BoomerAMG solver in hypre.
void SetPrintLevel(int print_lvl)
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetMaxIter(int max_it)
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
HYPRE_Int GlobalTrueVSize() const
virtual void Print(std::ostream &out=mfem::out) const
void PrintUsage(std::ostream &out) const
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
void SetRelTol(double rtol)
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 PrintOptions(std::ostream &out) const
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
void GetNodes(Vector &node_coord) const
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
Arbitrary order H1-conforming (continuous) finite elements.
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.