41 int main(
int argc,
char *argv[])
45 MPI_Init(&argc, &argv);
46 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
47 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
50 const char *mesh_file =
"../data/star.mesh";
52 bool visualization = 1;
55 args.
AddOption(&mesh_file,
"-m",
"--mesh",
58 "Finite element order (polynomial degree) or -1 for"
59 " isoparametric space.");
60 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
62 "Enable or disable GLVis visualization.");
78 ifstream imesh(mesh_file);
82 cerr <<
"\nCan not open mesh file: " << mesh_file <<
'\n' << endl;
86 mesh =
new Mesh(imesh, 1, 1);
96 (int)floor(log(10000./mesh->
GetNE())/log(2.)/dim);
97 for (
int l = 0; l < ref_levels; l++)
107 int par_ref_levels = 2;
108 for (
int l = 0; l < par_ref_levels; l++)
125 cout <<
"Number of unknowns: " << size << endl;
181 ostringstream mesh_name, sol_name;
182 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
183 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
185 ofstream mesh_ofs(mesh_name.str().c_str());
186 mesh_ofs.precision(8);
187 pmesh->
Print(mesh_ofs);
189 ofstream sol_ofs(sol_name.str().c_str());
190 sol_ofs.precision(8);
197 char vishost[] =
"localhost";
200 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
201 sol_sock.precision(8);
202 sol_sock <<
"solution\n" << *pmesh << x << flush;
Class for domain integration L(v) := (f, v)
Subclass constant coefficient.
int GetNE() const
Returns number of elements.
virtual void Save(std::ostream &out) const
Abstract parallel finite element space.
void SetPrintLevel(int print_lvl)
The BoomerAMG solver in hypre.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void PrintUsage(std::ostream &out) const
void SetMaxIter(int max_iter)
Wrapper for hypre's parallel vector class.
Array< int > bdr_attributes
int main(int argc, char *argv[])
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)
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.
void ParallelAverage(Vector &tv) const
Returns the vector averaged on the true dofs.
virtual void Print(std::ostream &out=std::cout) const