38 int main(
int argc,
char *argv[])
42 MPI_Init(&argc, &argv);
43 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
44 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
47 const char *mesh_file =
"../data/beam-tet.mesh";
49 bool visualization = 1;
52 args.
AddOption(&mesh_file,
"-m",
"--mesh",
55 "Finite element order (polynomial degree).");
56 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
58 "Enable or disable GLVis visualization.");
74 ifstream imesh(mesh_file);
78 cerr <<
"\nCan not open mesh file: " << mesh_file <<
'\n' << endl;
82 mesh =
new Mesh(imesh, 1, 1);
88 cerr <<
"\nThis example requires a 3D mesh\n" << endl;
99 (int)floor(log(1000./mesh->
GetNE())/log(2.)/dim);
100 for (
int l = 0; l < ref_levels; l++)
112 int par_ref_levels = 2;
113 for (
int l = 0; l < par_ref_levels; l++)
125 cout <<
"Number of unknowns: " << size << endl;
193 cout <<
"\n|| E_h - E ||_{L^2} = " << err <<
'\n' << endl;
199 ostringstream mesh_name, sol_name;
200 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
201 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
203 ofstream mesh_ofs(mesh_name.str().c_str());
204 mesh_ofs.precision(8);
205 pmesh->
Print(mesh_ofs);
207 ofstream sol_ofs(sol_name.str().c_str());
208 sol_ofs.precision(8);
215 char vishost[] =
"localhost";
218 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
219 sol_sock.precision(8);
220 sol_sock <<
"solution\n" << *pmesh << x << flush;
243 E(0) = sin(
kappa * x(1));
244 E(1) = sin(
kappa * x(2));
245 E(2) = sin(
kappa * x(0));
The Auxiliary-space Maxwell Solver in hypre.
double ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[]=NULL) const
Subclass constant coefficient.
virtual void ReorientTetMesh()
See the remarks for the serial version in mesh.hpp.
Integrator for (curl u, curl v) for Nedelec elements.
int GetNE() const
Returns number of elements.
virtual void Save(std::ostream &out) const
Abstract parallel finite element space.
void ProjectCoefficient(Coefficient &coeff)
void SetPrintLevel(int print_lvl)
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[])
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
void E_exact(const Vector &, Vector &)
Abstract class for hypre's solvers and preconditioners.
for VectorFiniteElements (Nedelec, Raviart-Thomas)
Arbitrary order H(curl)-conforming Nedelec 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.
Integrator for (Q u, v) for VectorFiniteElements.
virtual void Print(std::ostream &out=std::cout) const