45 int main(
int argc,
char *argv[])
49 MPI_Init(&argc, &argv);
50 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
51 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
54 const char *mesh_file =
"../data/star.mesh";
56 bool static_cond =
false;
57 bool visualization = 1;
60 args.
AddOption(&mesh_file,
"-m",
"--mesh",
63 "Finite element order (polynomial degree) or -1 for"
64 " isoparametric space.");
65 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
66 "--no-static-condensation",
"Enable static condensation.");
67 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
69 "Enable or disable GLVis visualization.");
88 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
97 (int)floor(log(10000./mesh->
GetNE())/log(2.)/
dim);
98 for (
int l = 0; l < ref_levels; l++)
110 int par_ref_levels = 2;
111 for (
int l = 0; l < par_ref_levels; l++)
130 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
141 cout <<
"Number of finite element unknowns: " << size << endl;
209 ostringstream mesh_name, sol_name;
210 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
211 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
213 ofstream mesh_ofs(mesh_name.str().c_str());
214 mesh_ofs.precision(8);
215 pmesh->
Print(mesh_ofs);
217 ofstream sol_ofs(sol_name.str().c_str());
218 sol_ofs.precision(8);
225 char vishost[] =
"localhost";
228 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
229 sol_sock.precision(8);
230 sol_sock <<
"solution\n" << *pmesh << x << flush;
239 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)
Subclass constant coefficient.
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 *)
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
void SetMaxIter(int max_iter)
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
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.