69 int main(
int argc,
char *argv[])
72 const char *mesh_file =
"../data/star.mesh";
74 bool static_cond =
false;
76 const char *device_config =
"cpu";
77 bool visualization =
true;
78 bool algebraic_ceed =
false;
81 args.
AddOption(&mesh_file,
"-m",
"--mesh",
84 "Finite element order (polynomial degree) or -1 for"
85 " isoparametric space.");
86 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
87 "--no-static-condensation",
"Enable static condensation.");
88 args.
AddOption(&pa,
"-pa",
"--partial-assembly",
"-no-pa",
89 "--no-partial-assembly",
"Enable Partial Assembly.");
90 args.
AddOption(&device_config,
"-d",
"--device",
91 "Device configuration string, see Device::Configure().");
93 args.
AddOption(&algebraic_ceed,
"-a",
"--algebraic",
"-no-a",
"--no-algebraic",
94 "Use algebraic Ceed solver");
96 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
98 "Enable or disable GLVis visualization.");
109 Device device(device_config);
115 Mesh mesh(mesh_file, 1, 1);
125 for (
int l = 0; l < ref_levels; l++)
145 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
153 cout <<
"Number of finite element unknowns: "
200 cout <<
"Size of linear system: " << A->
Height() << endl;
205 #ifndef MFEM_USE_SUITESPARSE
208 PCG(*A, M, B, X, 1, 200, 1e-12, 0.0);
212 umf_solver.
Control[UMFPACK_ORDERING] = UMFPACK_ORDERING_METIS;
214 umf_solver.
Mult(B, X);
223 ceed::AlgebraicSolver M(a, ess_tdof_list);
224 PCG(*A, M, B, X, 1, 400, 1e-12, 0.0);
229 PCG(*A, M, B, X, 1, 400, 1e-12, 0.0);
234 CG(*A, B, X, 1, 400, 1e-12, 0.0);
243 ofstream mesh_ofs(
"refined.mesh");
244 mesh_ofs.precision(8);
245 mesh.
Print(mesh_ofs);
246 ofstream sol_ofs(
"sol.gf");
247 sol_ofs.precision(8);
256 sol_sock.precision(8);
257 sol_sock <<
"solution\n" << mesh << x << flush;
int Size() const
Return the logical size of the array.
Class for domain integration L(v) := (f, v)
Class for grid function - Vector with associated FE space.
A coefficient that is constant across space and time.
Pointer to an Operator of a specified type.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
Get a list of essential true dofs, ess_tdof_list, corresponding to the boundary attributes marked in ...
int GetNE() const
Returns number of elements.
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
bool UsesTensorBasis(const FiniteElementSpace &fes)
Data type for Gauss-Seidel smoother of sparse matrix.
Direct sparse solver using UMFPACK.
virtual void Save(std::ostream &out) const
Save the GridFunction to an output stream.
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
Jacobi smoothing for a given bilinear form (no matrix necessary).
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.
void CG(const Operator &A, const Vector &b, Vector &x, int print_iter, int max_num_iter, double RTOLERANCE, double ATOLERANCE)
Conjugate gradient method. (tolerances are squared)
void PCG(const Operator &A, Solver &B, const Vector &b, Vector &x, int print_iter, int max_num_iter, double RTOLERANCE, double ATOLERANCE)
Preconditioned conjugate gradient method. (tolerances are squared)
virtual int GetTrueVSize() const
Return the number of vector true (conforming) dofs.
void PrintUsage(std::ostream &out) const
Print the usage message.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
double Control[UMFPACK_CONTROL]
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
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)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
FDualNumber< tbase > log(const FDualNumber< tbase > &f)
log([dual number])
virtual const char * Name() const
virtual void Print(std::ostream &os=mfem::out) const
void PrintOptions(std::ostream &out) const
Print the options.
void GetNodes(Vector &node_coord) const
Arbitrary order H1-conforming (continuous) finite elements.
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
virtual void SetOperator(const Operator &op)
Factorize the given Operator op which must be a SparseMatrix.
bool Good() const
Return true if the command line options were parsed successfully.