50int main(
int argc,
char *argv[])
57 const char *mesh_file =
"../data/compass.msh";
59 string source_name =
"Rose Even";
60 string ess_name =
"Boundary";
61 bool visualization =
true;
64 args.
AddOption(&mesh_file,
"-m",
"--mesh",
67 "Finite element order (polynomial degree) or -1 for"
68 " isoparametric space.");
69 args.
AddOption(&source_name,
"-src",
"--source-attr-name",
70 "Name of attribute set containing source.");
71 args.
AddOption(&ess_name,
"-ess",
"--ess-attr-name",
72 "Name of attribute set containing essential BC.");
73 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
75 "Enable or disable GLVis visualization.");
79 Mesh mesh(mesh_file, 1, 1);
88 (int)floor(log(10000./mesh.
GetNE())/log(2.)/
dim);
89 for (
int l = 0; l < ref_levels; l++)
98 ParMesh pmesh(MPI_COMM_WORLD, mesh);
101 int par_ref_levels = 2;
102 for (
int l = 0; l < par_ref_levels; l++)
114 cout <<
"Element Attribute Set Names: ";
115 for (
auto const &set_name : names)
117 cout <<
" \"" << set_name <<
"\"";
122 cout <<
"Boundary Attribute Set Names: ";
123 for (
auto const &bdr_set_name : bdr_names)
125 cout <<
" \"" << bdr_set_name <<
"\"";
201 (
"Northern Boundary"));
204 (
"Southern Boundary"));
207 (
"Eastern Boundary"));
210 (
"Western Boundary"));
221 cout <<
"Number of finite element unknowns: " << size << endl;
279 a.FormLinearSystem(ess_tdof_list, x,
b, A, X, B);
293 a.RecoverFEMSolution(X,
b, x);
308 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
309 sol_sock.precision(8);
310 sol_sock <<
"solution\n" << pmesh << x <<
"keys Rjmm" << flush;
void SetAttributeSet(const std::string &set_name, const Array< int > &attr)
Create a new attribute set.
Array< int > GetAttributeSetMarker(const std::string &set_name)
Return a marker array corresponding to a named attribute set.
bool AttributeSetExists(const std::string &name) const
Return true is the named attribute set is present.
Array< int > & GetAttributeSet(const std::string &set_name)
Access a named attribute set.
void AddToAttributeSet(const std::string &set_name, int attr)
Add a single entry to an existing attribute set.
std::set< std::string > GetAttributeSetNames() const
Return all attribute set names as an STL set.
Conjugate gradient method.
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
virtual void Mult(const Vector &b, Vector &x) const
Iterative solution of the linear system using the Conjugate Gradient method.
A coefficient that is constant across space and time.
Class for domain integration .
Arbitrary order H1-conforming (continuous) finite elements.
The BoomerAMG solver in hypre.
Wrapper for hypre's ParCSR matrix class.
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
void SetRelTol(real_t rtol)
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
virtual void SetPrintLevel(int print_lvl)
Legacy method to set the level of verbosity of the solver output.
void SetMaxIter(int max_it)
AttributeSets bdr_attribute_sets
Named sets of boundary element attributes.
void Clear()
Clear the contents of the Mesh.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
AttributeSets attribute_sets
Named sets of element attributes.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
static bool Root()
Return true if the rank in MPI_COMM_WORLD is zero.
static int WorldRank()
Return the MPI rank in MPI_COMM_WORLD.
static int WorldSize()
Return the size of MPI_COMM_WORLD.
static void Init(int &argc, char **&argv, int required=default_thread_required, int *provided=nullptr)
Singleton creation with Mpi::Init(argc, argv).
void ParseCheck(std::ostream &out=mfem::out)
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...
Abstract parallel finite element space.
void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1) const override
HYPRE_BigInt GlobalTrueVSize() const
Class for parallel grid function.
void Save(std::ostream &out) const override
Class for parallel meshes.
void Save(const std::string &fname, int precision=16) const override