52 #ifdef MFEM_USE_SIMMETRIX
59 #include <apfConvert.h>
64 #error This example requires that MFEM is built with MFEM_USE_PUMI=YES
70 int main(
int argc,
char *argv[])
73 Mpi::Init(argc, argv);
74 int num_procs = Mpi::WorldSize();
75 int myid = Mpi::WorldRank();
79 const char *mesh_file =
"../../data/pumi/parallel/Kova/Kova100k_8.smb";
80 #ifdef MFEM_USE_SIMMETRIX
81 const char *model_file =
"../../data/pumi/geom/Kova.x_t";
83 const char *model_file =
"../../data/pumi/geom/Kova.dmg";
86 bool static_cond =
false;
87 bool visualization = 1;
91 args.
AddOption(&mesh_file,
"-m",
"--mesh",
94 "Finite element order (polynomial degree) or -1 for"
95 " isoparametric space.");
96 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
97 "--no-static-condensation",
"Enable static condensation.");
98 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
100 "Enable or disable GLVis visualization.");
101 args.
AddOption(&model_file,
"-p",
"--parasolid",
102 "Parasolid model to use.");
103 args.
AddOption(&geom_order,
"-go",
"--geometry_order",
104 "Geometric order of the model");
121 #ifdef MFEM_USE_SIMMETRIX
122 Sim_readLicenseFile(0);
128 apf::Mesh2* pumi_mesh;
129 pumi_mesh = apf::loadMdsMesh(model_file, mesh_file);
134 int dim = pumi_mesh->getDimension();
135 int nEle = pumi_mesh->count(dim);
136 int ref_levels = (int)floor(log(10000./nEle)/log(2.)/
dim);
140 crv::BezierCurver bc(pumi_mesh, geom_order, 2);
147 auto uniInput = ma::configureUniformRefine(pumi_mesh, ref_levels);
151 crv::adapt(uniInput);
179 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
190 cout <<
"Number of finite element unknowns: " << size << endl;
258 ostringstream mesh_name, sol_name;
259 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
260 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
262 ofstream mesh_ofs(mesh_name.str().c_str());
263 mesh_ofs.precision(8);
264 pmesh->
Print(mesh_ofs);
266 ofstream sol_ofs(sol_name.str().c_str());
267 sol_ofs.precision(8);
277 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
278 sol_sock.precision(8);
279 sol_sock <<
"solution\n" << *pmesh << x << flush;
288 if (order > 0) {
delete fec; }
291 pumi_mesh->destroyNative();
292 apf::destroyMesh(pumi_mesh);
295 #ifdef MFEM_USE_SIMMETRIX
297 Sim_unregisterAllKeys();
int Size() const
Return the logical size of the array.
Class for domain integration L(v) := (f, v)
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
A coefficient that is constant across space and time.
HYPRE_BigInt GlobalTrueVSize() const
virtual void Save(std::ostream &out) const
Abstract parallel finite element space.
void SetPrintLevel(int print_lvl)
Class for PUMI parallel meshes.
The BoomerAMG solver in hypre.
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void PrintUsage(std::ostream &out) const
Print the usage message.
void SetMaxIter(int max_iter)
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
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...
virtual const char * Name() const
HYPRE_BigInt GetGlobalNumRows() const
Return the global number of rows.
void SetPreconditioner(HypreSolver &precond)
Set the hypre solver to be used as a preconditioner.
void PrintOptions(std::ostream &out) const
Print the options.
Abstract class for hypre's solvers and preconditioners.
void GetNodes(Vector &node_coord) const
Arbitrary order H1-conforming (continuous) finite elements.
void Print(std::ostream &out=mfem::out) const override
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.
bool Good() const
Return true if the command line options were parsed successfully.