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[])
74 MPI_Init(&argc, &argv);
75 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
76 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
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");
122 #ifdef MFEM_USE_SIMMETRIX
123 Sim_readLicenseFile(0);
129 apf::Mesh2* pumi_mesh;
130 pumi_mesh = apf::loadMdsMesh(model_file, mesh_file);
135 int dim = pumi_mesh->getDimension();
136 int nEle = pumi_mesh->count(dim);
137 int ref_levels = (int)floor(log(10000./nEle)/log(2.)/
dim);
141 crv::BezierCurver bc(pumi_mesh, geom_order, 2);
148 ma::Input* uniInput = ma::configureUniformRefine(pumi_mesh, ref_levels);
152 crv::adapt(uniInput);
180 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
191 cout <<
"Number of finite element unknowns: " << size << endl;
259 ostringstream mesh_name, sol_name;
260 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
261 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
263 ofstream mesh_ofs(mesh_name.str().c_str());
264 mesh_ofs.precision(8);
265 pmesh->
Print(mesh_ofs);
267 ofstream sol_ofs(sol_name.str().c_str());
268 sol_ofs.precision(8);
278 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
279 sol_sock.precision(8);
280 sol_sock <<
"solution\n" << *pmesh << x << flush;
289 if (order > 0) {
delete fec; }
292 pumi_mesh->destroyNative();
293 apf::destroyMesh(pumi_mesh);
296 #ifdef MFEM_USE_SIMMETRIX
298 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.
virtual void Save(std::ostream &out) const
Abstract parallel finite element space.
int main(int argc, char *argv[])
void SetPrintLevel(int print_lvl)
Class for PUMI parallel meshes.
The BoomerAMG solver in hypre.
HYPRE_Int GetGlobalNumRows() const
Return the global number of rows.
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.
HYPRE_Int GlobalTrueVSize() const
virtual void Print(std::ostream &out=mfem::out) const
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
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.
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.