51 v(0) =
p(0) +
s*
p(1) +
s*
p(2);
52 v(1) =
p(1) +
s*
p(2) +
s*
p(0);
55 else if (
p.Size() == 2)
73 return std::max(std::max(x - (
real_t) 0.25, -y), y - (
real_t) 1.0);
80 real_t y =
p.Size() > 1 ?
p(1) : 0.0;
81 real_t z =
p.Size() > 2 ?
p(2) : 0.0;
87 const real_t r_small = 1.0;
88 return hypot(r_big - hypot(x, y), z) - r_small;
94 return hypot(hypot(x, y), z) - r;
105 for (
int p = 0;
p < np;
p++)
108 fname << mesh_prefix <<
'.' << setfill(
'0') << setw(6) <<
p;
112 cerr <<
"Can not open mesh file: " << fname.str().c_str()
114 for (
p--;
p >= 0;
p--)
116 delete mesh_array[
p];
120 mesh_array[
p] =
new Mesh(meshin, 1, 0);
122 for (
int i = 0; i < mesh_array[
p]->GetNE(); i++)
126 for (
int i = 0; i < mesh_array[
p]->GetNBE(); i++)
131 mesh =
new Mesh(mesh_array, np);
133 for (
int p = 0;
p < np;
p++)
135 delete mesh_array[np-1-
p];
149 for (
int i = 0; i < mesh->
GetNBE(); i++)
154 for (
int j = 0; j < nv; j++)
160 for (
int i = 0; i < v2v.
Size(); i++)
174 for (
int i = 0; i < v2v.
Size(); i++)
186 for (
int i = 0; i < mesh->
GetNBE(); i++)
192 for (
int j = 0; j < nv; j++)
234 for (
int i=0; i<mesh->
GetNBE(); i++)
237 mesh->
GetNodes()->GetSubVector(vdofs, v);
245 cout <<
"\nDiscontinuous nodes not yet supported" << endl;
257 for (
int be = 0; be < mesh->
GetNBE(); be++)
260 bdr_partitioning[be] = partitioning[e];
264int main (
int argc,
char *argv[])
267 const char *mesh_file =
"../../data/beam-hex.mesh";
271 args.
AddOption(&mesh_file,
"-m",
"--mesh",
272 "Mesh file to visualize.");
274 "Load mesh from multiple processors.");
275 args.
AddOption(&refine,
"-ref",
"--refinement",
"-no-ref",
"--no-refinement",
276 "Prepare the mesh for refinement or not.");
285 cout <<
"Visualize and manipulate a serial mesh:\n"
286 <<
" mesh-explorer -m <mesh_file>\n"
287 <<
"Visualize and manipulate a parallel mesh:\n"
288 <<
" mesh-explorer -np <#proc> -m <mesh_prefix>\n" << endl
296 Mesh *bdr_mesh = NULL;
299 const bool use_par_mesh = np > 0;
306 mesh =
new Mesh(mesh_file, 1, refine);
310 bdr_partitioning = 0;
315 mesh =
read_par_mesh(np, mesh_file, partitioning, bdr_partitioning);
343 cout <<
"boundary attribs :";
348 cout <<
'\n' <<
"material attribs :";
354 cout <<
"mesh curvature : ";
361 cout <<
"NONE" << endl;
366 cout <<
"What would you like to do?\n"
368 "c) Change curvature\n"
373 "P) View partitioning\n"
374 "m) View materials\n"
376 "B) View boundary partitioning\n"
378 "h) View element sizes, h\n"
379 "k) View element ratios, kappa\n"
380 "J) View scaled Jacobian\n"
381 "l) Plot a function\n"
382 "x) Print sub-element stats\n"
383 "f) Find physical point in reference space\n"
384 "p) Generate a partitioning\n"
385 "o) Reorder elements\n"
386 "S) Save in MFEM serial format\n"
387 "T) Save in MFEM parallel format using the current partitioning\n"
388 "V) Save in VTK format (only linear and quadratic meshes)\n"
389 "D) Save as a DataCollection\n"
392 "Z) Save in MFEM format with compression\n"
407 "Choose type of refinement:\n"
408 "s) standard refinement with Mesh::UniformRefinement()\n"
409 "b) Mesh::UniformRefinement() (bisection for tet meshes)\n"
410 "u) uniform refinement with a factor\n"
411 "g) non-uniform refinement (Gauss-Lobatto) with a factor\n"
412 "n) NURBS refinement (uniform or by formula) with a factor\n"
413 "c) NURBS coarsening (uniform or by formula) with a factor\n"
414 "l) refine locally using the region() function\n"
415 "r) random refinement with a probability\n"
432 cout <<
"enter refinement factor --> " << flush;
435 if (ref_factor <= 1 || ref_factor > 32) {
break; }
444 cout <<
"enter refinement factor, 1st dimension --> " << flush;
445 cin >> ref_factors[0];
446 cout <<
"enter refinement factor, 2nd dimension --> " << flush;
447 cin >> ref_factors[1];
450 cout <<
"enter refinement factor, 3rd dimension --> "
452 cin >> ref_factors[2];
454 for (
auto ref_factor : ref_factors)
455 if (ref_factor <= 1 || ref_factor > 32) {
break; }
457 char input_tol =
'n';
458 cout <<
"enter NURBS tolerance? [y/n] ---> " << flush;
462 if (input_tol ==
'y')
464 cout <<
"enter NURBS tolerance ---> " << flush;
473 cout <<
"enter coarsening factor --> " << flush;
475 cin >> coarsen_factor;
476 if (coarsen_factor <= 1 || coarsen_factor > 32) {
break; }
478 char input_tol =
'n';
479 cout <<
"enter NURBS tolerance? [y/n] ---> " << flush;
483 if (input_tol ==
'y')
485 cout <<
"enter NURBS tolerance ---> " << flush;
496 for (
int i = 0; i < mesh->
GetNE(); i++)
506 marked_elements.
Append(i);
516 bool nc_simplices =
true;
518 cout <<
"enter probability --> " << flush;
521 if (probability < 0.0 || probability > 1.0) {
break; }
532 cout <<
"enter new order for mesh curvature --> " << flush;
541 cout <<
"scaling factor ---> " << flush;
547 for (
int i = 0; i < mesh->
GetNV(); i++)
569 cout <<
"Choose a transformation:\n"
570 "u) User-defined transform through mesh-explorer::transformation()\n"
571 "k) Kershaw transform\n"<<
"---> " << flush;
577 else if (type ==
'k')
579 cout <<
"Note: For Kershaw transformation, the input must be "
580 "Cartesian aligned with nx multiple of 6 and "
581 "both ny and nz multiples of 2."
582 "Kershaw transform works for 2D meshes also.\n" << flush;
585 cout <<
"Kershaw transform factor, epsy in (0, 1]) ---> " << flush;
589 cout <<
"Kershaw transform factor, epsz in (0, 1]) ---> " << flush;
597 MFEM_ABORT(
"Transformation type not supported.");
605 cout <<
"jitter factor ---> " << flush;
612 cerr <<
"The mesh should have nodes, introduce curvature first!\n";
628 for (
int i = 0; i < fespace->
GetNE(); i++)
631 for (
int j = 0; j < dofs.
Size(); j++)
639 for (
int i = 0; i < fespace->
GetNDofs(); i++)
641 for (
int d = 0; d <
dim; d++)
648 cout <<
"move boundary nodes? [y/n] ---> " << flush;
655 for (
int i = 0; i < fespace->
GetNBE(); i++)
658 for (
int j = 0; j < vdofs.
Size(); j++)
675 real_t min_det_J, max_det_J, min_det_J_z, max_det_J_z;
676 real_t min_kappa, max_kappa, max_ratio_det_J_z;
678 max_det_J = max_kappa = max_ratio_det_J_z = -
infinity();
679 cout <<
"subdivision factor ---> " << flush;
682 bad_elems_by_geom = 0;
684 const int max_to_print = 10;
685 for (
int i = 0; i < mesh->
GetNE(); i++)
704 min_det_J_z = std::min(min_det_J_z, det_J);
705 max_det_J_z = std::max(max_det_J_z, det_J);
707 min_kappa = std::min(min_kappa,
kappa);
708 max_kappa = std::max(max_kappa,
kappa);
711 std::max(max_ratio_det_J_z, max_det_J_z/min_det_J_z);
712 min_det_J = std::min(min_det_J, min_det_J_z);
713 max_det_J = std::max(max_det_J, max_det_J_z);
714 if (min_det_J_z <= 0.0)
716 if (nz < max_to_print)
720 cout <<
"det(J) < 0 = " << min_det_J_z <<
" in element "
721 << i <<
", centered at: ";
725 bad_elems_by_geom[geom]++;
728 if (nz >= max_to_print)
730 cout <<
"det(J) < 0 for " << nz - max_to_print <<
" more elements "
733 cout <<
"\nbad elements = " << nz;
739 cout <<
"\nmin det(J) = " << min_det_J
740 <<
"\nmax det(J) = " << max_det_J
741 <<
"\nglobal ratio = " << max_det_J/min_det_J
742 <<
"\nmax el ratio = " << max_ratio_det_J_z
743 <<
"\nmin kappa = " << min_kappa
744 <<
"\nmax kappa = " << max_kappa << endl;
750 cout <<
"\npoint in physical space ---> " << flush;
751 for (
int i = 0; i < sdim; i++)
753 cin >> point_mat(i,0);
761 cout <<
"point in reference space:";
762 if (elem_ids[0] == -1)
764 cout <<
" NOT FOUND!\n";
768 cout <<
" element " << elem_ids[0] <<
", ip =";
769 cout <<
" " << ips[0].x;
772 cout <<
" " << ips[0].y;
775 cout <<
" " << ips[0].z;
784 cout <<
"What type of reordering?\n"
785 "g) Gecko edge-product minimization\n"
786 "h) Hilbert spatial sort\n"
799 int outer, inner, window, period;
800 cout <<
"Enter number of outer iterations (default 5): " << flush;
802 cout <<
"Enter number of inner iterations (default 4): " << flush;
804 cout <<
"Enter window size (default 4, beware of exponential cost): "
807 cout <<
"Enter period for window size increment (default 2): "
812 for (
int i = 0; i < outer; i++)
816 tentative, inner, window, period, seed,
true);
818 if (cost < best_cost)
820 ordering = tentative;
824 cout <<
"Final cost: " << best_cost << endl;
831 if (mk ==
'm' || mk ==
'b' || mk ==
'e' || mk ==
'v' || mk ==
'h' ||
832 mk ==
'k' || mk ==
'J' || mk ==
'p' || mk ==
'B' || mk ==
'P')
842 for (
int i = 0; i < mesh->
GetNE(); i++)
850 for (
int i = 0; i < mesh->
GetNE(); i++)
852 attr(i) = partitioning[i] + 1;
856 if (mk ==
'b' || mk ==
'B')
864 bdr_attr.
SetSpace(bdr_attr_fespace);
867 for (
int i = 0; i < bdr_mesh->
GetNE(); i++)
874 for (
int i = 0; i < bdr_mesh->
GetNE(); i++)
876 bdr_attr(i) = bdr_partitioning[i] + 1;
881 MFEM_WARNING(
"Unimplemented case.");
886 MFEM_WARNING(
"Unsupported mesh dimension.");
901 int el0 = (int)floor(
a * mesh->
GetNE());
902 cout <<
"Generating coloring starting with element " << el0+1
903 <<
" / " << mesh->
GetNE() << endl;
905 for (
int i = 0; i < coloring.
Size(); i++)
907 attr(i) = coloring[i];
909 cout <<
"Number of colors: " << attr.
Max() + 1 << endl;
910 for (
int i = 0; i < mesh->
GetNE(); i++)
922 for (
int i = 0; i < mesh->
GetNE(); i++)
932 attr(i) = -pow(-attr(i), 1.0/
real_t(
dim));
938 h_min = min(h_min, attr(i));
939 h_max = max(h_max, attr(i));
941 cout <<
"h_min = " << h_min <<
", h_max = " << h_max << endl;
947 for (
int i = 0; i < mesh->
GetNE(); i++)
965 cout <<
"subdivision factor ---> " << flush;
967 for (
int i = 0; i < mesh->
GetNE(); i++)
986 for (
int k = 0; k < J.
Width(); k++)
994 attr(i) = std::min(sJ, attr(i));
1001 cout <<
"What type of partitioning?\n"
1003 "s) Simple 1D split of the element sequence\n"
1004 "0) METIS_PartGraphRecursive (sorted neighbor lists)\n"
1005 "1) METIS_PartGraphKway (sorted neighbor lists)"
1007 "2) METIS_PartGraphVKway (sorted neighbor lists)\n"
1008 "3) METIS_PartGraphRecursive\n"
1009 "4) METIS_PartGraphKway\n"
1010 "5) METIS_PartGraphVKway\n"
1017 cout <<
"Enter nx: " << flush;
1018 cin >> nxyz[0]; np = nxyz[0];
1021 cout <<
"Enter ny: " << flush;
1022 cin >> nxyz[1]; np *= nxyz[1];
1025 cout <<
"Enter nz: " << flush;
1026 cin >> nxyz[2]; np *= nxyz[2];
1036 cout <<
"Enter number of processors: " << flush;
1040 for (
int i = 0; i < mesh->
GetNE(); i++)
1042 partitioning[i] = (
long long)i * np / mesh->
GetNE();
1048 int part_method = pk -
'0';
1049 if (part_method < 0 || part_method > 5)
1053 cout <<
"Enter number of processors: " << flush;
1062 const char part_file[] =
"partitioning.txt";
1063 ofstream opart(part_file);
1064 opart <<
"number_of_elements " << mesh->
GetNE() <<
'\n'
1065 <<
"number_of_processors " << np <<
'\n';
1066 for (
int i = 0; i < mesh->
GetNE(); i++)
1068 opart << partitioning[i] <<
'\n';
1070 cout <<
"Partitioning file: " << part_file << endl;
1074 for (
int i = 0; i < mesh->
GetNE(); i++)
1076 proc_el[partitioning[i]]++;
1078 int min_el = proc_el[0], max_el = proc_el[0];
1079 for (
int i = 1; i < np; i++)
1081 if (min_el > proc_el[i])
1083 min_el = proc_el[i];
1085 if (max_el < proc_el[i])
1087 max_el = proc_el[i];
1090 cout <<
"Partitioning stats:\n"
1092 << setw(12) <<
"minimum"
1093 << setw(12) <<
"average"
1094 << setw(12) <<
"maximum"
1095 << setw(12) <<
"total" <<
'\n';
1096 cout <<
" elements "
1097 << setw(12) << min_el
1099 << setw(12) << max_el
1100 << setw(12) << mesh->
GetNE() << endl;
1107 for (
int i = 0; i < mesh->
GetNE(); i++)
1109 attr(i) = partitioning[i] + 1;
1118 sol_sock.precision(14);
1121 sol_sock <<
"fem2d_gf_data_keys\n";
1124 mesh->
Print(sol_sock);
1131 mesh->
Print(sol_sock);
1132 for (
int i = 0; i < mesh->
GetNE(); i++)
1134 attr(i) = partitioning[i];
1142 attr.
Save(sol_sock);
1143 sol_sock <<
"RjlmAb***********";
1155 sol_sock <<
"fem3d_gf_data_keys\n";
1156 if (mk ==
'v' || mk ==
'h' || mk ==
'k' || mk ==
'J')
1158 mesh->
Print(sol_sock);
1160 else if (mk ==
'b' || mk ==
'B')
1162 bdr_mesh->
Print(sol_sock);
1163 bdr_attr.
Save(sol_sock);
1164 sol_sock <<
"mcaaA";
1166 sol_sock <<
"pppppp" <<
"pppppp" <<
"pppppp";
1173 mesh->
Print(sol_sock);
1174 for (
int i = 0; i < mesh->
GetNE(); i++)
1176 attr(i) = partitioning[i];
1184 if (mk !=
'b' && mk !=
'B')
1186 attr.
Save(sol_sock);
1202 cout <<
"Unable to connect to "
1205 delete attr_fespace;
1206 delete bdr_attr_fespace;
1214 cout <<
"Enter projection space order: " << flush;
1235 sol_sock.precision(14);
1236 sol_sock <<
"solution\n" << *mesh << level << flush;
1240 cout <<
"Unable to connect to "
1248 const char omesh_file[] =
"mesh-explorer.mesh";
1249 ofstream omesh(omesh_file);
1250 omesh.precision(14);
1252 cout <<
"New mesh file: " << omesh_file << endl;
1257 string mesh_prefix(
"mesh-explorer.mesh."), line;
1260 cout <<
"Enter mesh file prefix or press <enter> to use \""
1261 << mesh_prefix <<
"\": " << flush;
1264 cin.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
1266 if (!line.empty()) { mesh_prefix = line; }
1268 cout <<
"Enter floating point output precision (num. digits): "
1271 for (
int i = 0; i < np; i++)
1276 omesh.precision(precision);
1277 mesh_part.
Print(omesh);
1279 cout <<
"New parallel mesh files: " << mesh_prefix <<
"<rank>" << endl;
1284 const char omesh_file[] =
"mesh-explorer.vtk";
1285 ofstream omesh(omesh_file);
1286 omesh.precision(14);
1288 cout <<
"New VTK mesh file: " << omesh_file << endl;
1293 cout <<
"What type of DataCollection?\n"
1294 "p) ParaView Data Collection\n"
1295 "v) VisIt Data Collection\n"
1299 if (dk ==
'p' || dk ==
'P')
1301 const char omesh_file[] =
"mesh-explorer-paraview";
1305 int order = mesh->
GetNodes()->FESpace()->GetMaxElementOrder();
1313 cout <<
"New ParaView mesh file: " << omesh_file << endl;
1315 else if (dk ==
'v' || dk ==
'V')
1317 const char omesh_file[] =
"mesh-explorer-visit";
1321 cout <<
"New VisIt mesh file: " << omesh_file <<
"_000000.mfem_root"
1326 cout <<
"Unrecognized DataCollection type: \"" << dk <<
"\""
1334 const char omesh_file[] =
"mesh-explorer.mesh.gz";
1336 omesh.precision(14);
1338 cout <<
"New mesh file: " << omesh_file << endl;
1344 delete bdr_attr_fec;
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
void DeleteAll()
Delete the whole array.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
@ GaussLobatto
Closed type.
@ GaussLegendre
Open type.
@ ClosedUniform
Nodes: x_i = i/(n-1), i=0,...,n-1.
Piecewise-constant discontinuous finite elements in 2D. This class is kept only for backward compatib...
Piecewise-constant discontinuous finite elements in 3D. This class is kept only for backward compatib...
void SetPrecision(int prec)
Set the precision (number of digits) used for the text output of doubles.
Data type dense matrix using column-major storage.
void GetColumnReference(int c, Vector &col)
real_t CalcSingularvalue(const int i) const
Return the i-th singular value (decreasing order) of NxN matrix, N=1,2,3.
Abstract data type element.
Geometry::Type GetGeometryType() const
virtual void GetVertices(Array< int > &v) const =0
Get the indices defining the vertices.
int GetAttribute() const
Return element's attribute.
virtual int GetNVertices() const =0
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name.
virtual const char * Name() const
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
DofTransformation * GetElementDofs(int elem, Array< int > &dofs) const
Returns indices of degrees of freedom of element 'elem'. The returned indices are offsets into an ldo...
int GetNDofs() const
Returns number of degrees of freedom. This is the number of Local Degrees of Freedom.
int GetNBE() const
Returns number of boundary elements in the mesh.
DofTransformation * GetElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for the i'th element. The returned indices are offsets into an ...
int GetNE() const
Returns number of elements in the mesh.
const FiniteElementCollection * FEColl() const
DofTransformation * GetBdrElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for i'th boundary element. The returned indices are offsets int...
int DofToVDof(int dof, int vd, int ndofs=-1) const
Compute a single vdof corresponding to the index dof and the vector index vd.
A general function coefficient.
RefinedGeometry * Refine(Geometry::Type Geom, int Times, int ETimes=1)
const IntegrationPoint & GetCenter(int GeomType) const
Return the center of the given Geometry::Type, GeomType.
void JacToPerfJac(int GeomType, const DenseMatrix &J, DenseMatrix &PJ) const
Class for grid function - Vector with associated FE space.
virtual void Save(std::ostream &out) const
Save the GridFunction to an output stream.
void MakeOwner(FiniteElementCollection *fec_)
Make the GridFunction the owner of fec and fes.
FiniteElementSpace * FESpace()
virtual void ProjectCoefficient(Coefficient &coeff)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
virtual void SetSpace(FiniteElementSpace *f)
Associate a new FiniteElementSpace with the GridFunction.
Arbitrary order H1-conforming (continuous) finite elements.
Class for an integration rule - an Array of IntegrationPoint.
int GetNPoints() const
Returns the number of the points in the integration rule.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
Class containing a minimal description of a part (a subset of the elements) of a Mesh and its connect...
void Print(std::ostream &os) const
Write the MeshPart to a stream using the parallel format "MFEM mesh v1.2".
Class that allows serial meshes to be partitioned into MeshPart objects, typically one MeshPart at a ...
void ExtractPart(int part_id, MeshPart &mesh_part) const
Construct a MeshPart corresponding to the given part_id.
void NURBSCoarsening(int cf=2, real_t tol=1.0e-12)
int AddSegment(int v1, int v2, int attr=1)
Adds a segment to the mesh given by 2 vertices v1 and v2.
void GetElementColoring(Array< int > &colors, int el0=0)
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
NURBSExtension * NURBSext
Optional NURBS mesh extension.
int * CartesianPartitioning(int nxyz[])
void GeneralRefinement(const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0)
int GetAttribute(int i) const
Return the attribute of element i.
int AddQuad(int v1, int v2, int v3, int v4, int attr=1)
Adds a quadrilateral to the mesh given by 4 vertices v1 through v4.
const FiniteElementSpace * GetNodalFESpace() const
void PrintCharacteristics(Vector *Vh=NULL, Vector *Vk=NULL, std::ostream &os=mfem::out)
Compute and print mesh characteristics such as number of vertices, number of elements,...
int AddTriangle(int v1, int v2, int v3, int attr=1)
Adds a triangle to the mesh given by 3 vertices v1 through v3.
real_t GetGeckoElementOrdering(Array< int > &ordering, int iterations=4, int window=4, int period=2, int seed=0, bool verbose=false, real_t time_limit=0)
void FinalizeTopology(bool generate_bdr=true)
Finalize the construction of the secondary topology (connectivity) data of a Mesh.
virtual void Print(std::ostream &os=mfem::out, const std::string &comments="") const
void PrintWithPartitioning(int *partitioning, std::ostream &os, int elem_attr=0) const
Prints the mesh with boundary elements given by the boundary of the subdomains, so that the boundary ...
int AddVertex(real_t x, real_t y=0.0, real_t z=0.0)
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
void RandomRefinement(real_t prob, bool aniso=false, int nonconforming=-1, int nc_limit=0)
Refine each element with given probability. Uses GeneralRefinement.
const Element * GetBdrElement(int i) const
Return pointer to the i'th boundary element object.
void ReorderElements(const Array< int > &ordering, bool reorder_vertices=true)
static Mesh MakeRefined(Mesh &orig_mesh, int ref_factor, int ref_type)
Create a refined (by any factor) version of orig_mesh.
real_t GetElementSize(int i, int type=0)
Get the size of the i-th element relative to the perfect reference element.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr) const
Builds the transformation defining the i-th element in ElTr. ElTr must be allocated in advance and wi...
int SpaceDimension() const
Dimension of the physical space containing the mesh.
void GetNodes(Vector &node_coord) const
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
void GetHilbertElementOrdering(Array< int > &ordering)
void GetBdrElementAdjacentElement(int bdr_el, int &el, int &info) const
For the given boundary element, bdr_el, return its adjacent element and its info, i....
void GetElementCenter(int i, Vector ¢er)
static void PrintElementsByGeometry(int dim, const Array< int > &num_elems_by_geom, std::ostream &os)
Auxiliary method used by PrintCharacteristics().
int GetNBE() const
Returns number of boundary elements.
virtual void Finalize(bool refine=false, bool fix_orientation=false)
Finalize the construction of a general Mesh.
virtual int FindPoints(DenseMatrix &point_mat, Array< int > &elem_ids, Array< IntegrationPoint > &ips, bool warn=true, InverseElementTransformation *inv_trans=NULL)
Find the ids of the elements that contain the given points, and their corresponding reference coordin...
void NewNodes(GridFunction &nodes, bool make_owner=false)
Replace the internal node GridFunction with the given GridFunction.
virtual void NURBSUniformRefinement(int rf=2, real_t tol=1.0e-12)
Refine NURBS mesh, with an optional refinement factor, generally anisotropic.
void EnsureNCMesh(bool simplices_nonconforming=false)
void PrintVTK(std::ostream &os)
virtual void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
Set the curvature of the mesh nodes using the given polynomial degree.
void Transform(void(*f)(const Vector &, Vector &))
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
Geometry::Type GetElementBaseGeometry(int i) const
int * GeneratePartitioning(int nparts, int part_method=1)
Array< int > attributes
A list of all unique element attributes used by the Mesh.
const real_t * GetVertex(int i) const
Return pointer to vertex i's coordinates.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void PrintOptions(std::ostream &out) const
Print the options.
void PrintHelp(std::ostream &out) const
Print the help message.
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...
bool Good() const
Return true if the command line options were parsed successfully.
bool Help() const
Return true if we are flagged to print the help message.
void PrintError(std::ostream &out) const
Print the error message.
Helper class for ParaView visualization data.
void SetHighOrderOutput(bool high_order_output_)
void SetLevelsOfDetail(int levels_of_detail_)
virtual void Save() override
void Randomize(int seed=0)
Set random values in the vector.
void Print(std::ostream &out=mfem::out, int width=8) const
Prints vector to stream out.
void SetSubVector(const Array< int > &dofs, const real_t value)
Set the entries listed in dofs to the given value.
real_t Norml2() const
Returns the l2 norm of the vector.
real_t Max() const
Returns the maximal element of the vector.
Data collection with VisIt I/O routines.
virtual void Save() override
Save the collection and a VisIt root file.
bool is_open()
True if the socketstream is open, false otherwise.
Mesh * skin_mesh(Mesh *mesh)
real_t f(const Vector &p)
Mesh * read_par_mesh(int np, const char *mesh_prefix, Array< int > &partitioning, Array< int > &bdr_partitioning)
void transformation(const Vector &p, Vector &v)
void recover_bdr_partitioning(const Mesh *mesh, const Array< int > &partitioning, Array< int > &bdr_partitioning)
real_t region(const Vector &p)
real_t infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
std::string MakeParFilename(const std::string &prefix, const int myid, const std::string suffix, const int width)
Construct a string of the form "<prefix><myid><suffix>" where the integer myid is padded with leading...
GeometryRefiner GlobGeometryRefiner
real_t rand_real()
Generate a random real_t number in the interval [0,1) using rand().
L2_FECollection DG_FECollection
Declare an alternative name for L2_FECollection = DG_FECollection.
real_t p(const Vector &x, real_t t)