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/star.mesh";
61 bool static_cond =
false;
62 bool hybridization =
false;
63 bool visualization = 1;
66 args.
AddOption(&mesh_file,
"-m",
"--mesh",
69 "Finite element order (polynomial degree).");
70 args.
AddOption(&set_bc,
"-bc",
"--impose-bc",
"-no-bc",
"--dont-impose-bc",
71 "Impose or not essential boundary conditions.");
72 args.
AddOption(&
freq,
"-f",
"--frequency",
"Set the frequency for the exact"
74 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
75 "--no-static-condensation",
"Enable static condensation.");
76 args.
AddOption(&hybridization,
"-hb",
"--hybridization",
"-no-hb",
77 "--no-hybridization",
"Enable hybridization.");
78 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
80 "Enable or disable GLVis visualization.");
100 Mesh *mesh =
new Mesh(mesh_file, 1, 1);
110 (int)floor(log(1000./mesh->
GetNE())/log(2.)/
dim);
111 for (
int l = 0; l < ref_levels; l++)
125 int par_ref_levels = 2;
126 for (
int l = 0; l < par_ref_levels; l++)
140 cout <<
"Number of finite element unknowns: " << size << endl;
151 ess_bdr = set_bc ? 1 : 0;
193 else if (hybridization)
209 cout <<
"Size of linear system: " << glob_size << endl;
226 if (dim == 2) { prec =
new HypreAMS(A, prec_fespace); }
227 else { prec =
new HypreADS(A, prec_fespace); }
241 cout <<
"\n|| F_h - F ||_{L^2} = " << err <<
'\n' << endl;
248 ostringstream mesh_name, sol_name;
249 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
250 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
252 ofstream mesh_ofs(mesh_name.str().c_str());
253 mesh_ofs.precision(8);
254 pmesh->
Print(mesh_ofs);
256 ofstream sol_ofs(sol_name.str().c_str());
257 sol_ofs.precision(8);
264 char vishost[] =
"localhost";
267 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
268 sol_sock.precision(8);
269 sol_sock <<
"solution\n" << *pmesh << x << flush;
319 f(0) = temp*cos(kappa*x)*sin(kappa*y);
320 f(1) = temp*cos(kappa*y)*sin(kappa*x);
int Size() const
Logical size of the array.
Conjugate gradient method.
MPI_Comm GetComm() const
MPI communicator.
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.
HYPRE_Int GlobalTrueVSize()
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)
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
int main(int argc, char *argv[])
(Q div u, div v) for RT elements
The BoomerAMG solver in hypre.
HYPRE_Int GetGlobalNumRows() const
void SetPrintLevel(int print_lvl)
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
void SetMaxIter(int max_it)
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void F_exact(const Vector &, Vector &)
void PrintUsage(std::ostream &out) const
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
int SpaceDimension() const
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
void SetRelTol(double rtol)
Base class Coefficient that may optionally depend on time.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list)
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 PrintOptions(std::ostream &out) const
Abstract class for hypre's solvers and preconditioners.
for VectorFiniteElements (Nedelec, Raviart-Thomas)
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
Class for parallel grid function.
Wrapper for hypre's ParCSR matrix class.
Class for parallel meshes.
Integrator for (Q u, v) for VectorFiniteElements.
virtual void Print(std::ostream &out=std::cout) const