35 #include "../common/mfem-common.hpp" 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)
71 const double x =
p(0), y =
p(1);
73 return std::max(std::max(x - 0.25, -y), y - 1.0);
80 double y =
p.Size() > 1 ?
p(1) : 0.0;
81 double z =
p.Size() > 2 ?
p(2) : 0.0;
86 const double r_big = 2.0;
87 const double 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++)
220 if (dynamic_cast<const H1_FECollection*>(fec))
234 for (
int i=0; i<mesh->
GetNBE(); i++)
237 mesh->
GetNodes()->GetSubVector(vdofs, v);
239 fes_copy->GetElementVDofs(i, bvdofs);
245 cout <<
"\nDiscontinuous nodes not yet supported" << endl;
257 for (
int be = 0; be < mesh->
GetNBE(); be++)
260 bdr_partitioning[be] = partitioning[e];
264 int 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;
314 mesh =
read_par_mesh(np, mesh_file, partitioning, bdr_partitioning);
342 cout <<
"boundary attribs :";
347 cout <<
'\n' <<
"material attribs :";
353 cout <<
"mesh curvature : ";
360 cout <<
"NONE" << endl;
365 cout <<
"What would you like to do?\n" 367 "c) Change curvature\n" 372 "P) View partitioning\n" 373 "m) View materials\n" 375 "B) View boundary partitioning\n" 377 "h) View element sizes, h\n" 378 "k) View element ratios, kappa\n" 379 "J) View scaled Jacobian\n" 380 "l) Plot a function\n" 381 "x) Print sub-element stats\n" 382 "f) Find physical point in reference space\n" 383 "p) Generate a partitioning\n" 384 "o) Reorder elements\n" 385 "S) Save in MFEM format\n" 386 "V) Save in VTK format (only linear and quadratic meshes)\n" 387 "D) Save as a DataCollection\n" 390 "Z) Save in MFEM format with compression\n" 405 "Choose type of refinement:\n" 406 "s) standard refinement with Mesh::UniformRefinement()\n" 407 "b) Mesh::UniformRefinement() (bisection for tet meshes)\n" 408 "u) uniform refinement with a factor\n" 409 "g) non-uniform refinement (Gauss-Lobatto) with a factor\n" 410 "l) refine locally using the region() function\n" 411 "r) random refinement with a probability\n" 428 cout <<
"enter refinement factor --> " << flush;
431 if (ref_factor <= 1 || ref_factor > 32) {
break; }
441 for (
int i = 0; i < mesh->
GetNE(); i++)
446 for (
int j = 0; j < T.GetPointMat().Width(); j++)
448 T.GetPointMat().GetColumnReference(j, pt);
451 marked_elements.
Append(i);
461 bool nc_simplices =
true;
463 cout <<
"enter probability --> " << flush;
466 if (probability < 0.0 || probability > 1.0) {
break; }
477 cout <<
"enter new order for mesh curvature --> " << flush;
486 cout <<
"scaling factor ---> " << flush;
492 for (
int i = 0; i < mesh->
GetNV(); i++)
514 cout <<
"Choose a transformation:\n" 515 "u) User-defined transform through mesh-explorer::transformation()\n" 516 "k) Kershaw transform\n"<<
"---> " << flush;
522 else if (type ==
'k')
524 cout <<
"Note: For Kershaw transformation, the input must be " 525 "Cartesian aligned with nx multiple of 6 and " 526 "both ny and nz multiples of 2." 527 "Kershaw transform works for 2D meshes also.\n" << flush;
529 double epsy, epsz = 0.0;
530 cout <<
"Kershaw transform factor, epsy in (0, 1]) ---> " << flush;
534 cout <<
"Kershaw transform factor, epsz in (0, 1]) ---> " << flush;
542 MFEM_ABORT(
"Transformation type not supported.");
550 cout <<
"jitter factor ---> " << flush;
557 cerr <<
"The mesh should have nodes, introduce curvature first!\n";
573 for (
int i = 0; i < fespace->
GetNE(); i++)
576 for (
int j = 0; j < dofs.
Size(); j++)
584 for (
int i = 0; i < fespace->
GetNDofs(); i++)
586 for (
int d = 0; d <
dim; d++)
593 cout <<
"move boundary nodes? [y/n] ---> " << flush;
600 for (
int i = 0; i < fespace->
GetNBE(); i++)
603 for (
int j = 0; j < vdofs.
Size(); j++)
620 double min_det_J, max_det_J, min_det_J_z, max_det_J_z;
621 double min_kappa, max_kappa, max_ratio_det_J_z;
623 max_det_J = max_kappa = max_ratio_det_J_z = -
infinity();
624 cout <<
"subdivision factor ---> " << flush;
627 bad_elems_by_geom = 0;
629 const int max_to_print = 10;
630 for (
int i = 0; i < mesh->
GetNE(); i++)
645 double det_J = J.
Det();
649 min_det_J_z = fmin(min_det_J_z, det_J);
650 max_det_J_z = fmax(max_det_J_z, det_J);
652 min_kappa = fmin(min_kappa,
kappa);
653 max_kappa = fmax(max_kappa,
kappa);
656 fmax(max_ratio_det_J_z, max_det_J_z/min_det_J_z);
657 min_det_J = fmin(min_det_J, min_det_J_z);
658 max_det_J = fmax(max_det_J, max_det_J_z);
659 if (min_det_J_z <= 0.0)
661 if (nz < max_to_print)
665 cout <<
"det(J) < 0 = " << min_det_J_z <<
" in element " 666 << i <<
", centered at: ";
670 bad_elems_by_geom[geom]++;
673 if (nz >= max_to_print)
675 cout <<
"det(J) < 0 for " << nz - max_to_print <<
" more elements " 678 cout <<
"\nbad elements = " << nz;
684 cout <<
"\nmin det(J) = " << min_det_J
685 <<
"\nmax det(J) = " << max_det_J
686 <<
"\nglobal ratio = " << max_det_J/min_det_J
687 <<
"\nmax el ratio = " << max_ratio_det_J_z
688 <<
"\nmin kappa = " << min_kappa
689 <<
"\nmax kappa = " << max_kappa << endl;
695 cout <<
"\npoint in physical space ---> " << flush;
696 for (
int i = 0; i < sdim; i++)
698 cin >> point_mat(i,0);
706 cout <<
"point in reference space:";
707 if (elem_ids[0] == -1)
709 cout <<
" NOT FOUND!\n";
713 cout <<
" element " << elem_ids[0] <<
", ip =";
714 cout <<
" " << ips[0].x;
717 cout <<
" " << ips[0].y;
720 cout <<
" " << ips[0].z;
729 cout <<
"What type of reordering?\n" 730 "g) Gecko edge-product minimization\n" 731 "h) Hilbert spatial sort\n" 744 int outer, inner, window, period;
745 cout <<
"Enter number of outer iterations (default 5): " << flush;
747 cout <<
"Enter number of inner iterations (default 4): " << flush;
749 cout <<
"Enter window size (default 4, beware of exponential cost): " 752 cout <<
"Enter period for window size increment (default 2): " 757 for (
int i = 0; i < outer; i++)
761 tentative, inner, window, period, seed,
true);
763 if (cost < best_cost)
765 ordering = tentative;
769 cout <<
"Final cost: " << best_cost << endl;
776 if (mk ==
'm' || mk ==
'b' || mk ==
'e' || mk ==
'v' || mk ==
'h' ||
777 mk ==
'k' || mk ==
'J' || mk ==
'p' || mk ==
'B' || mk ==
'P')
787 for (
int i = 0; i < mesh->
GetNE(); i++)
795 for (
int i = 0; i < mesh->
GetNE(); i++)
797 attr(i) = partitioning[i] + 1;
801 if (mk ==
'b' || mk ==
'B')
809 bdr_attr.
SetSpace(bdr_attr_fespace);
812 for (
int i = 0; i < bdr_mesh->
GetNE(); i++)
819 for (
int i = 0; i < bdr_mesh->
GetNE(); i++)
821 bdr_attr(i) = bdr_partitioning[i] + 1;
826 MFEM_WARNING(
"Unimplemented case.");
831 MFEM_WARNING(
"Unsupported mesh dimension.");
845 double a = double(rand()) / (double(RAND_MAX) + 1.);
846 int el0 = (int)floor(
a * mesh->
GetNE());
847 cout <<
"Generating coloring starting with element " << el0+1
848 <<
" / " << mesh->
GetNE() << endl;
850 for (
int i = 0; i < coloring.
Size(); i++)
852 attr(i) = coloring[i];
854 cout <<
"Number of colors: " << attr.
Max() + 1 << endl;
855 for (
int i = 0; i < mesh->
GetNE(); i++)
867 for (
int i = 0; i < mesh->
GetNE(); i++)
877 attr(i) = -pow(-attr(i), 1.0/
double(
dim));
881 attr(i) = pow(attr(i), 1.0/
double(
dim));
883 h_min = min(h_min, attr(i));
884 h_max = max(h_max, attr(i));
886 cout <<
"h_min = " << h_min <<
", h_max = " << h_max << endl;
892 for (
int i = 0; i < mesh->
GetNE(); i++)
910 cout <<
"subdivision factor ---> " << flush;
912 for (
int i = 0; i < mesh->
GetNE(); i++)
931 for (
int k = 0; k < J.
Width(); k++)
939 attr(i) = fmin(sJ, attr(i));
946 cout <<
"What type of partitioning?\n" 948 "s) Simple 1D split of the element sequence\n" 949 "0) METIS_PartGraphRecursive (sorted neighbor lists)\n" 950 "1) METIS_PartGraphKway (sorted neighbor lists)" 952 "2) METIS_PartGraphVKway (sorted neighbor lists)\n" 953 "3) METIS_PartGraphRecursive\n" 954 "4) METIS_PartGraphKway\n" 955 "5) METIS_PartGraphVKway\n" 962 cout <<
"Enter nx: " << flush;
963 cin >> nxyz[0]; np = nxyz[0];
966 cout <<
"Enter ny: " << flush;
967 cin >> nxyz[1]; np *= nxyz[1];
970 cout <<
"Enter nz: " << flush;
971 cin >> nxyz[2]; np *= nxyz[2];
981 cout <<
"Enter number of processors: " << flush;
985 for (
int i = 0; i < mesh->
GetNE(); i++)
987 partitioning[i] = i * np / mesh->
GetNE();
993 int part_method = pk -
'0';
994 if (part_method < 0 || part_method > 5)
998 cout <<
"Enter number of processors: " << flush;
1007 const char part_file[] =
"partitioning.txt";
1008 ofstream opart(part_file);
1009 opart <<
"number_of_elements " << mesh->
GetNE() <<
'\n' 1010 <<
"number_of_processors " << np <<
'\n';
1011 for (
int i = 0; i < mesh->
GetNE(); i++)
1013 opart << partitioning[i] <<
'\n';
1015 cout <<
"Partitioning file: " << part_file << endl;
1019 for (
int i = 0; i < mesh->
GetNE(); i++)
1021 proc_el[partitioning[i]]++;
1023 int min_el = proc_el[0], max_el = proc_el[0];
1024 for (
int i = 1; i < np; i++)
1026 if (min_el > proc_el[i])
1028 min_el = proc_el[i];
1030 if (max_el < proc_el[i])
1032 max_el = proc_el[i];
1035 cout <<
"Partitioning stats:\n" 1037 << setw(12) <<
"minimum" 1038 << setw(12) <<
"average" 1039 << setw(12) <<
"maximum" 1040 << setw(12) <<
"total" <<
'\n';
1041 cout <<
" elements " 1042 << setw(12) << min_el
1043 << setw(12) << double(mesh->
GetNE())/np
1044 << setw(12) << max_el
1045 << setw(12) << mesh->
GetNE() << endl;
1052 for (
int i = 0; i < mesh->
GetNE(); i++)
1054 attr(i) = partitioning[i] + 1;
1063 sol_sock.precision(14);
1066 sol_sock <<
"fem2d_gf_data_keys\n";
1069 mesh->
Print(sol_sock);
1076 mesh->
Print(sol_sock);
1077 for (
int i = 0; i < mesh->
GetNE(); i++)
1079 attr(i) = partitioning[i];
1087 attr.
Save(sol_sock);
1088 sol_sock <<
"RjlmAb***********";
1100 sol_sock <<
"fem3d_gf_data_keys\n";
1101 if (mk ==
'v' || mk ==
'h' || mk ==
'k' || mk ==
'J')
1103 mesh->
Print(sol_sock);
1105 else if (mk ==
'b' || mk ==
'B')
1107 bdr_mesh->
Print(sol_sock);
1108 bdr_attr.
Save(sol_sock);
1109 sol_sock <<
"mcaaA";
1111 sol_sock <<
"pppppp" <<
"pppppp" <<
"pppppp";
1118 mesh->
Print(sol_sock);
1119 for (
int i = 0; i < mesh->
GetNE(); i++)
1121 attr(i) = partitioning[i];
1129 if (mk !=
'b' && mk !=
'B')
1131 attr.
Save(sol_sock);
1147 cout <<
"Unable to connect to " 1150 delete attr_fespace;
1151 delete bdr_attr_fespace;
1159 cout <<
"Enter projection space order: " << flush;
1180 sol_sock.precision(14);
1181 sol_sock <<
"solution\n" << *mesh << level << flush;
1185 cout <<
"Unable to connect to " 1193 const char omesh_file[] =
"mesh-explorer.mesh";
1194 ofstream omesh(omesh_file);
1195 omesh.precision(14);
1197 cout <<
"New mesh file: " << omesh_file << endl;
1202 const char omesh_file[] =
"mesh-explorer.vtk";
1203 ofstream omesh(omesh_file);
1204 omesh.precision(14);
1206 cout <<
"New VTK mesh file: " << omesh_file << endl;
1211 cout <<
"What type of DataCollection?\n" 1212 "p) ParaView Data Collection\n" 1213 "v) VisIt Data Collection\n" 1217 if (dk ==
'p' || dk ==
'P')
1219 const char omesh_file[] =
"mesh-explorer-paraview";
1223 int order = mesh->
GetNodes()->FESpace()->GetMaxElementOrder();
1231 cout <<
"New ParaView mesh file: " << omesh_file << endl;
1233 else if (dk ==
'v' || dk ==
'V')
1235 const char omesh_file[] =
"mesh-explorer-visit";
1239 cout <<
"New VisIt mesh file: " << omesh_file <<
"_000000.mfem_root" 1244 cout <<
"Unrecognized DataCollection type: \"" << dk <<
"\"" 1249 #ifdef MFEM_USE_ZLIB 1252 const char omesh_file[] =
"mesh-explorer.mesh.gz";
1254 omesh.precision(14);
1256 cout <<
"New mesh file: " << omesh_file << endl;
1262 delete bdr_attr_fec;
void SetPrecision(int prec)
Set the precision (number of digits) used for the text output of doubles.
double GetGeckoElementOrdering(Array< int > &ordering, int iterations=4, int window=4, int period=2, int seed=0, bool verbose=false, double time_limit=0)
void SetSubVector(const Array< int > &dofs, const double value)
Set the entries listed in dofs to the given value.
int * CartesianPartitioning(int nxyz[])
int GetNPoints() const
Returns the number of the points in the integration rule.
Class for an integration rule - an Array of IntegrationPoint.
const FiniteElementSpace * GetNodalFESpace() const
Class for grid function - Vector with associated FE space.
int AddQuad(int v1, int v2, int v3, int v4, int attr=1)
virtual void GetVertices(Array< int > &v) const =0
Returns element's vertices.
void PrintOptions(std::ostream &out) const
Print the options.
Geometry::Type GetElementBaseGeometry(int i) const
static void PrintElementsByGeometry(int dim, const Array< int > &num_elems_by_geom, std::ostream &out)
Auxiliary method used by PrintCharacteristics().
int Dimension() const
Dimension of the reference space used within the elements.
int * GeneratePartitioning(int nparts, int part_method=1)
Helper class for ParaView visualization data.
void NewNodes(GridFunction &nodes, bool make_owner=false)
Replace the internal node GridFunction with the given GridFunction.
void Print(std::ostream &out=mfem::out, int width=8) const
Prints vector to stream out.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
int GetAttribute() const
Return element's attribute.
static Mesh MakeRefined(Mesh &orig_mesh, int ref_factor, int ref_type)
Create a refined (by any factor) version of orig_mesh.
int AddTriangle(int v1, int v2, int v3, int attr=1)
Data type dense matrix using column-major storage.
void Transform(void(*f)(const Vector &, Vector &))
int GetNDofs() const
Returns number of degrees of freedom. This is the number of Local Degrees of Freedom.
double CalcSingularvalue(const int i) const
Return the i-th singular value (decreasing order) of NxN matrix, N=1,2,3.
void PrintError(std::ostream &out) const
Print the error message.
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, number of boundary elements, minimal and maximal element sizes, minimal and maximal element aspect ratios, etc.
bool Good() const
Return true if the command line options were parsed successfully.
void MakeOwner(FiniteElementCollection *fec_)
Make the GridFunction the owner of fec and fes.
void Randomize(int seed=0)
Set random values in the vector.
const IntegrationPoint & GetCenter(int GeomType)
Return the center of the given Geometry::Type, GeomType.
Mesh * read_par_mesh(int np, const char *mesh_prefix, Array< int > &partitioning, Array< int > &bdr_partitioning)
int GetNBE() const
Returns number of boundary elements.
void DeleteAll()
Delete the whole array.
Mesh * skin_mesh(Mesh *mesh)
bool Help() const
Return true if we are flagged to print the help message.
std::function< double(const Vector &)> f(double mass_coeff)
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
int GetAttribute(int i) const
Return the attribute of element i.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
int AddVertex(double x, double y=0.0, double z=0.0)
GeometryRefiner GlobGeometryRefiner
double GetElementSize(ElementTransformation *T, int type=0)
Geometry::Type GetGeometryType() const
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void PrintVTK(std::ostream &os)
int Append(const T &el)
Append element 'el' to array, resize if necessary.
void EnsureNCMesh(bool simplices_nonconforming=false)
const FiniteElementCollection * FEColl() const
void transformation(const Vector &p, Vector &v)
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
Data collection with VisIt I/O routines.
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.
const double * GetVertex(int i) const
Return pointer to vertex i's coordinates.
virtual const char * Name() const
void GetHilbertElementOrdering(Array< int > &ordering)
Piecewise-constant discontinuous finite elements in 3D. This class is kept only for backward compatib...
void RandomRefinement(double prob, bool aniso=false, int nonconforming=-1, int nc_limit=0)
Refine each element with given probability. Uses GeneralRefinement.
void GetElementCenter(int i, Vector ¢er)
void SetHighOrderOutput(bool high_order_output_)
RefinedGeometry * Refine(Geometry::Type Geom, int Times, int ETimes=1)
Piecewise-constant discontinuous finite elements in 2D. This class is kept only for backward compatib...
FiniteElementSpace * FESpace()
int GetNE() const
Returns number of elements in the mesh.
L2_FECollection DG_FECollection
Declare an alternative name for L2_FECollection = DG_FECollection.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
bool is_open()
True if the socketstream is open, false otherwise.
double p(const Vector &x, double t)
int AddSegment(int v1, int v2, int attr=1)
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...
virtual void Save() override
Save the collection and a VisIt root file.
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...
void FinalizeTopology(bool generate_bdr=true)
Finalize the construction of the secondary topology (connectivity) data of a Mesh.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
void GetColumnReference(int c, Vector &col)
void JacToPerfJac(int GeomType, const DenseMatrix &J, DenseMatrix &PJ) const
virtual 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...
double Max() const
Returns the maximal element of the vector.
int main(int argc, char *argv[])
int SpaceDimension() const
Dimension of the physical space containing the mesh.
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name...
int GetNE() const
Returns number of elements.
NURBSExtension * NURBSext
Optional NURBS mesh extension.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
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...
virtual void Finalize(bool refine=false, bool fix_orientation=false)
Finalize the construction of a general Mesh.
void ReorderElements(const Array< int > &ordering, bool reorder_vertices=true)
void PrintHelp(std::ostream &out) const
Print the help message.
int GetNBE() const
Returns number of boundary elements in the mesh.
double infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
virtual int GetNVertices() const =0
virtual void ProjectCoefficient(Coefficient &coeff)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
double Norml2() const
Returns the l2 norm of the vector.
virtual void SetSpace(FiniteElementSpace *f)
Associate a new FiniteElementSpace with the GridFunction.
int Size() const
Return the logical size of the array.
void SetLevelsOfDetail(int levels_of_detail_)
A general function coefficient.
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...
int DofToVDof(int dof, int vd, int ndofs=-1) const
Compute a single vdof corresponding to the index dof and the vector index vd.
Nodes: x_i = i/(n-1), i=0,...,n-1.
virtual void Print(std::ostream &os=mfem::out) const
Arbitrary order H1-conforming (continuous) finite elements.
void GetElementColoring(Array< int > &colors, int el0=0)
void GetNodes(Vector &node_coord) const
virtual void Save() override
const Element * GetBdrElement(int i) const
Return pointer to the i'th boundary element object.
virtual void Save(std::ostream &out) const
Save the GridFunction to an output stream.
void GeneralRefinement(const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0)
double region(const Vector &p)
Abstract data type element.
Array< int > attributes
A list of all unique element attributes used by the Mesh.
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 ...
void recover_bdr_partitioning(const Mesh *mesh, const Array< int > &partitioning, Array< int > &bdr_partitioning)
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...