49 int main(
int argc,
char *argv[])
53 MPI_Init(&argc, &argv);
54 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
55 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
58 const char *mesh_file =
"../data/beam-tet.mesh";
60 bool static_cond =
false;
61 bool visualization = 1;
64 args.
AddOption(&mesh_file,
"-m",
"--mesh",
67 "Finite element order (polynomial degree).");
68 args.
AddOption(&
freq,
"-f",
"--frequency",
"Set the frequency for the exact"
70 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
71 "--no-static-condensation",
"Enable static condensation.");
72 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
74 "Enable or disable GLVis visualization.");
95 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
105 (int)floor(log(1000./mesh->
GetNE())/log(2.)/
dim);
106 for (
int l = 0; l < ref_levels; l++)
120 int par_ref_levels = 2;
121 for (
int l = 0; l < par_ref_levels; l++)
135 cout <<
"Number of finite element unknowns: " << size << endl;
214 cout <<
"\n|| E_h - E ||_{L^2} = " << err <<
'\n' << endl;
221 ostringstream mesh_name, sol_name;
222 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
223 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
225 ofstream mesh_ofs(mesh_name.str().c_str());
226 mesh_ofs.precision(8);
227 pmesh->
Print(mesh_ofs);
229 ofstream sol_ofs(sol_name.str().c_str());
230 sol_ofs.precision(8);
237 char vishost[] =
"localhost";
240 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
241 sol_sock.precision(8);
242 sol_sock <<
"solution\n" << *pmesh << x << flush;
266 E(0) = sin(
kappa * x(1));
267 E(1) = sin(
kappa * x(2));
268 E(2) = sin(
kappa * x(0));
272 E(0) = sin(
kappa * x(1));
273 E(1) = sin(
kappa * x(0));
274 if (x.
Size() == 3) { E(2) = 0.0; }
290 if (x.
Size() == 3) { f(2) = 0.0; }
int Size() const
Logical size of the array.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
The Auxiliary-space Maxwell Solver in hypre.
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 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.
virtual void ProjectCoefficient(Coefficient &coeff)
void SetPrintLevel(int print_lvl)
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)
int SpaceDimension() const
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
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 &)
virtual double ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[]=NULL) const
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.
Integrator for (Q u, v) for VectorFiniteElements.