43 int main(
int argc,
char *argv[])
47 MPI_Init(&argc, &argv);
48 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
49 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
52 const char *mesh_file =
"../data/star.mesh";
55 bool visualization = 1;
58 args.
AddOption(&mesh_file,
"-m",
"--mesh",
61 "Finite element order (polynomial degree).");
62 args.
AddOption(&set_bc,
"-bc",
"--impose-bc",
"-no-bc",
"--dont-impose-bc",
63 "Impose or not essential boundary conditions.");
64 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
66 "Enable or disable GLVis visualization.");
82 ifstream imesh(mesh_file);
86 cerr <<
"\nCan not open mesh file: " << mesh_file <<
'\n' << endl;
90 mesh =
new Mesh(imesh, 1, 1);
100 (int)floor(log(1000./mesh->
GetNE())/log(2.)/dim);
101 for (
int l = 0; l < ref_levels; l++)
113 int par_ref_levels = 2;
114 for (
int l = 0; l < par_ref_levels; l++)
126 cout <<
"Number of unknowns: " << size << endl;
201 cout <<
"\n|| F_h - F ||_{L^2} = " << err <<
'\n' << endl;
207 ostringstream mesh_name, sol_name;
208 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
209 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
211 ofstream mesh_ofs(mesh_name.str().c_str());
212 mesh_ofs.precision(8);
213 pmesh->
Print(mesh_ofs);
215 ofstream sol_ofs(sol_name.str().c_str());
216 sol_ofs.precision(8);
223 char vishost[] =
"localhost";
226 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
227 sol_sock.precision(8);
228 sol_sock <<
"solution\n" << *pmesh << x << flush;
256 F(0) = cos(M_PI*x)*sin(M_PI*y);
257 F(1) = cos(M_PI*y)*sin(M_PI*x);
271 double temp = 1 + 2*M_PI*M_PI;
273 f(0) = temp*cos(M_PI*x)*sin(M_PI*y);
274 f(1) = temp*cos(M_PI*y)*sin(M_PI*x);
int Size() const
Logical size of the array.
The Auxiliary-space Maxwell Solver in hypre.
double ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[]=NULL) const
The Auxiliary-space Divergence Solver in hypre.
Subclass constant coefficient.
virtual void ReorientTetMesh()
See the remarks for the serial version in mesh.hpp.
int Size() const
Returns the size of the vector.
int GetNE() const
Returns number of elements.
virtual void Save(std::ostream &out) const
Abstract parallel finite element space.
void ProjectCoefficient(Coefficient &coeff)
(Q div u, div v) for RT elements
void SetPrintLevel(int print_lvl)
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void F_exact(const Vector &, Vector &)
void PrintUsage(std::ostream &out) const
void SetMaxIter(int max_iter)
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
Wrapper for hypre's parallel vector class.
Array< int > bdr_attributes
int main(int argc, char *argv[])
Base class Coefficient that may optionally depend on time.
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 f_exact(const Vector &, Vector &)
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.
for VectorFiniteElements (Nedelec, Raviart-Thomas)
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.
Integrator for (Q u, v) for VectorFiniteElements.
virtual void Print(std::ostream &out=std::cout) const