MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
pmesh.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced
2// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3// LICENSE and NOTICE for details. LLNL-CODE-806117.
4//
5// This file is part of the MFEM library. For more information and source code
6// availability visit https://mfem.org.
7//
8// MFEM is free software; you can redistribute it and/or modify it under the
9// terms of the BSD-3 license. We welcome feedback and contributions, see file
10// CONTRIBUTING.md for details.
11
12#ifndef MFEM_PMESH
13#define MFEM_PMESH
14
15#include "../config/config.hpp"
16
17#ifdef MFEM_USE_MPI
18
21#include "mesh.hpp"
22#include "pncmesh.hpp"
23#include <iostream>
24
25namespace mfem
26{
27
28#ifdef MFEM_USE_PUMI
29class ParPumiMesh;
30#endif
31
32/// Class for parallel meshes
33class ParMesh : public Mesh
34{
35 friend class ParNCMesh;
36 friend class ParSubMesh;
37#ifdef MFEM_USE_PUMI
38 friend class ParPumiMesh;
39#endif
40#ifdef MFEM_USE_ADIOS2
41 friend class adios2stream;
42#endif
43
44protected:
45 MPI_Comm MyComm;
47
48 struct Vert3
49 {
50 int v[3];
51 Vert3() = default;
52 Vert3(int v0, int v1, int v2) { v[0] = v0; v[1] = v1; v[2] = v2; }
53 void Set(int v0, int v1, int v2) { v[0] = v0; v[1] = v1; v[2] = v2; }
54 void Set(const int *w) { v[0] = w[0]; v[1] = w[1]; v[2] = w[2]; }
55 };
56
57 struct Vert4
58 {
59 int v[4];
60 Vert4() = default;
61 Vert4(int v0, int v1, int v2, int v3)
62 { v[0] = v0; v[1] = v1; v[2] = v2; v[3] = v3; }
63 void Set(int v0, int v1, int v2, int v3)
64 { v[0] = v0; v[1] = v1; v[2] = v2; v[3] = v3; }
65 void Set(const int *w)
66 { v[0] = w[0]; v[1] = w[1]; v[2] = w[2]; v[3] = w[3]; }
67 };
68
70 // shared face id 'i' is:
71 // * triangle id 'i', if i < shared_trias.Size()
72 // * quad id 'i-shared_trias.Size()', otherwise
75
76 /// Shared objects in each group.
79 Table group_stria; // contains shared triangle indices
80 Table group_squad; // contains shared quadrilateral indices
81
82 /// Shared to local index mapping.
85 // sface ids: all triangles first, then all quads
87
88 /// Table that maps from face neighbor element number, to the face numbers of
89 /// that element.
90 std::unique_ptr<Table> face_nbr_el_to_face;
91 /// orientations for each face (from nbr processor)
92 std::unique_ptr<Table> face_nbr_el_ori;
93
94 // glob_elem_offset + local element number defines a global element numbering
95 mutable long long glob_elem_offset;
97 void ComputeGlobalElementOffset() const;
98
99 // Enable Print() to add the parallel interface as boundary (typically used
100 // for visualization purposes)
101 bool print_shared = true;
102
103 /// Create from a nonconforming mesh.
104 ParMesh(const ParNCMesh &pncmesh);
105
106 // Convert the local 'meshgen' to a global one.
107 void ReduceMeshGen();
108
109 // Determine sedge_ledge and sface_lface.
110 void FinalizeParTopo();
111
112 // Mark all tets to ensure consistency across MPI tasks; also mark the shared
113 // and boundary triangle faces using the consistently marked tets.
114 void MarkTetMeshForRefinement(const DSTable &v_to_v) override;
115
116 /// Return a number(0-1) identifying how the given edge has been split
117 int GetEdgeSplittings(Element *edge, const DSTable &v_to_v, int *middle);
118 /// Append codes identifying how the given face has been split to @a codes
119 void GetFaceSplittings(const int *fv, const HashTable<Hashed2> &v_to_v,
120 Array<unsigned> &codes);
121
122 bool DecodeFaceSplittings(HashTable<Hashed2> &v_to_v, const int *v,
123 const Array<unsigned> &codes, int &pos);
124
125 // Given a completed FacesTable and SharedFacesTable, construct a table that
126 // maps from face neighbor element number, to the set of faces of that
127 // element. Store the resulting data in the member variable
128 // face_nbr_el_to_face. If the mesh is nonconforming, this also builds the
129 // the face_nbr_el_ori variable from the faces_info.
131
132 /**
133 * @brief Helper function for adding triangle face neighbor element to face
134 * table entries. Have to use a template here rather than lambda capture
135 * because the FaceVert entries in Geometry have inner size of 3 for tets and
136 * 4 for everything else.
137 *
138 * @tparam N Inner dimension on the fvert variable, 3 for tet, 4 otherwise
139 * @param[in] v Set of vertices for this element
140 * @param[in] faces Table of faces interior to this rank
141 * @param[in] shared_faces Table of faces shared by this rank and another
142 * @param[in] elem The face neighbor element
143 * @param[in] start Starting index into fverts
144 * @param[in] end End index into fverts
145 * @param[in] fverts Array of face vertices for this particular geometry.
146 */
147 template <int N>
148 void AddTriFaces(const Array<int> &v, const std::unique_ptr<STable3D> &faces,
149 const std::unique_ptr<STable3D> &shared_faces,
150 int elem, int start, int end, const int fverts[][N]);
151
154 Geometry::Type face_geom) const;
157 Geometry::Type face_geom) const
158 {
159 MFEM_ASSERT(FElTr, "Missing FaceElementTransformations object!");
160 GetGhostFaceTransformation(*FElTr, face_type, face_geom);
161 }
162
163 /// Update the groups after triangle refinement
164 void RefineGroups(const DSTable &v_to_v, int *middle);
165
166 /// Update the groups after tetrahedron refinement
167 void RefineGroups(int old_nv, const HashTable<Hashed2> &v_to_v);
168
169 void UniformRefineGroups2D(int old_nv);
170
171 // f2qf can be NULL if all faces are quads or there are no quad faces
172 void UniformRefineGroups3D(int old_nv, int old_nedges,
173 const DSTable &old_v_to_v,
174 const STable3D &old_faces,
175 Array<int> *f2qf);
176
177 void ExchangeFaceNbrData(Table *gr_sface, int *s2l_face);
178
179 /// Refine a mixed 2D mesh uniformly.
180 void UniformRefinement2D() override;
181
182 /// Refine a mixed 3D mesh uniformly.
183 void UniformRefinement3D() override;
184
185 /** @brief Refine NURBS mesh, with an optional refinement factor.
186
187 @param[in] rf Optional refinement factor. If scalar, the factor is used
188 for all dimensions. If an array, factors can be specified
189 for each dimension.
190 @param[in] tol NURBS geometry deviation tolerance. */
191 void NURBSUniformRefinement(int rf = 2, real_t tol=1.0e-12) override;
192 void NURBSUniformRefinement(const Array<int> &rf, real_t tol=1.e-12) override;
193
194 void RefineNURBSWithKVFactors(int rf, const std::string &kvf) override;
195
196 /// This function is not public anymore. Use GeneralRefinement instead.
197 void LocalRefinement(const Array<int> &marked_el, int type = 3) override;
198
199 /// This function is not public anymore. Use GeneralRefinement instead.
200 void NonconformingRefinement(const Array<Refinement> &refinements,
201 int nc_limit = 0) override;
202
204 real_t threshold, int nc_limit = 0,
205 int op = 1) override;
206
207 void RebalanceImpl(const Array<int> *partition);
208
209 void DeleteFaceNbrData();
210
211 bool WantSkipSharedMaster(const NCMesh::Master &master) const;
212
213 /// Fills out partitioned Mesh::vertices
214 int BuildLocalVertices(const Mesh& global_mesh, const int *partitioning,
215 Array<int> &vert_global_local);
216
217 /// Fills out partitioned Mesh::elements
218 int BuildLocalElements(const Mesh& global_mesh, const int *partitioning,
219 const Array<int> &vert_global_local);
220
221 /// Fills out partitioned Mesh::boundary
222 int BuildLocalBoundary(const Mesh& global_mesh, const int *partitioning,
223 const Array<int> &vert_global_local,
224 Array<bool>& activeBdrElem,
225 Table* &edge_element);
226
227 void FindSharedFaces(const Mesh &mesh, const int* partition,
228 Array<int>& face_group,
229 ListOfIntegerSets& groups);
230
231 int FindSharedEdges(const Mesh &mesh, const int* partition,
232 Table* &edge_element, ListOfIntegerSets& groups);
233
234 int FindSharedVertices(const int *partition, Table* vertex_element,
235 ListOfIntegerSets& groups);
236
237 void BuildFaceGroup(int ngroups, const Mesh &mesh,
238 const Array<int>& face_group,
239 int &nstria, int &nsquad);
240
241 void BuildEdgeGroup(int ngroups, const Table& edge_element);
242
243 void BuildVertexGroup(int ngroups, const Table& vert_element);
244
245 void BuildSharedFaceElems(int ntri_faces, int nquad_faces,
246 const Mesh &mesh, const int *partitioning,
247 const STable3D *faces_tbl,
248 const Array<int> &face_group,
249 const Array<int> &vert_global_local);
250
251 void BuildSharedEdgeElems(int nedges, Mesh &mesh,
252 const Array<int> &vert_global_local,
253 const Table *edge_element);
254
255 void BuildSharedVertMapping(int nvert, const Table* vert_element,
256 const Array<int> &vert_global_local);
257
258 /**
259 * @brief Get the shared edges GroupCommunicator.
260 *
261 * The output of the shared edges is chosen by the @a ordering parameter with
262 * the following options
263 * 0: Internal ordering. Not exposed to public interfaces.
264 * 1: Contiguous ordering.
265 *
266 * @param[in] ordering Ordering for the shared edges.
267 * @param[out] sedge_comm
268 */
269 void GetSharedEdgeCommunicator(int ordering,
270 GroupCommunicator& sedge_comm) const;
271
272 /**
273 * @brief Get the shared vertices GroupCommunicator.
274 *
275 * The output of the shared vertices is chosen by the @a ordering parameter
276 * with the following options
277 * 0: Internal ordering. Not exposed to public interfaces.
278 * 1: Contiguous ordering.
279 *
280 * @param[in] ordering
281 * @param[out] svert_comm
282 */
283 void GetSharedVertexCommunicator(int ordering,
284 GroupCommunicator& svert_comm) const;
285
286 /**
287 * @brief Get the shared face quadrilaterals GroupCommunicator.
288 *
289 * The output of the shared face quadrilaterals is chosen by the @a ordering
290 * parameter with the following options
291 * 0: Internal ordering. Not exposed to public interfaces.
292 * 1: Contiguous ordering.
293 *
294 * @param[in] ordering
295 * @param[out] squad_comm
296 */
297 void GetSharedQuadCommunicator(int ordering,
298 GroupCommunicator& squad_comm) const;
299
300 /**
301 * @brief Get the shared face triangles GroupCommunicator.
302 *
303 * The output of the shared face triangles is chosen by the @a ordering
304 * parameter with the following options
305 * 0: Internal ordering. Not exposed to public interfaces.
306 * 1: Contiguous ordering.
307 *
308 * @param[in] ordering
309 * @param[out] stria_comm
310 */
311 void GetSharedTriCommunicator(int ordering,
312 GroupCommunicator& stria_comm) const;
313
314 // Similar to Mesh::GetFacesTable()
316
317 /// Ensure that bdr_attributes and attributes agree across processors
319
320 void LoadSharedEntities(std::istream &input);
321
322 /// If the mesh is curved, make sure 'Nodes' is ParGridFunction.
323 /** Note that this method is not related to the public 'Mesh::EnsureNodes`.*/
324 void EnsureParNodes();
325
326 /// Internal function used in ParMesh::MakeRefined (and related constructor)
327 void MakeRefined_(ParMesh &orig_mesh, int ref_factor, int ref_type);
328
329 // Mark Mesh::Swap as protected, should use ParMesh::Swap to swap @a ParMesh
330 // objects.
331 using Mesh::Swap;
332
333 void Destroy();
334
335public:
336 /// Default constructor. Create an empty @a ParMesh.
337 ParMesh() : MyComm(0), NRanks(0), MyRank(-1),
339 have_face_nbr_data(false), pncmesh(NULL) { }
340
341 /// Create a parallel mesh by partitioning a serial Mesh.
342 /** The mesh is partitioned automatically or using external partitioning data
343 (the optional parameter 'partitioning_[i]' contains the desired MPI rank
344 for element 'i'). Automatic partitioning uses METIS for conforming meshes
345 and quick space-filling curve equipartitioning for nonconforming meshes
346 (elements of nonconforming meshes should ideally be ordered as a sequence
347 of face-neighbors). */
348 ParMesh(MPI_Comm comm, Mesh &mesh, const int *partitioning_ = nullptr,
349 int part_method = 1);
350
351 /** Copy constructor. Performs a deep copy of (almost) all data, so that the
352 source mesh can be modified (e.g. deleted, refined) without affecting the
353 new mesh. If 'copy_nodes' is false, use a shallow (pointer) copy for the
354 nodes, if present. */
355 explicit ParMesh(const ParMesh &pmesh, bool copy_nodes = true);
356
357 /// Read a parallel mesh, each MPI rank from its own file/stream.
358 /** The @a generate_edges parameter is passed to Mesh::Loader. The @a refine
359 and @a fix_orientation parameters are passed to the method
360 Mesh::Finalize().
361
362 @note The order of arguments and their default values are different than
363 for the Mesh class. */
364 ParMesh(MPI_Comm comm, std::istream &input, bool refine = true,
365 int generate_edges = 1, bool fix_orientation = true);
366
367 /// Deprecated: see @a ParMesh::MakeRefined
368 MFEM_DEPRECATED
369 ParMesh(ParMesh *orig_mesh, int ref_factor, int ref_type);
370
371 /// Move constructor. Used for named constructors.
372 ParMesh(ParMesh &&mesh);
373
374 /// Move assignment operator.
375 ParMesh& operator=(ParMesh &&mesh);
376
377 /// Explicitly delete the copy assignment operator.
378 ParMesh& operator=(const ParMesh &mesh) = delete;
379
380 /// Create a uniformly refined (by any factor) version of @a orig_mesh.
381 /** @param[in] orig_mesh The starting coarse mesh.
382 @param[in] ref_factor The refinement factor, an integer > 1.
383 @param[in] ref_type Specify the positions of the new vertices. The
384 options are BasisType::ClosedUniform or
385 BasisType::GaussLobatto.
386
387 The refinement data which can be accessed with GetRefinementTransforms()
388 is set to reflect the performed refinements.
389
390 @note The constructed ParMesh is linear, i.e. it does not have nodes. */
391 static ParMesh MakeRefined(ParMesh &orig_mesh, int ref_factor, int ref_type);
392
393 /** Create a mesh by splitting each element of @a orig_mesh into simplices.
394 See @a Mesh::MakeSimplicial for more details. */
395 static ParMesh MakeSimplicial(ParMesh &orig_mesh);
396
397 void Finalize(bool refine = false, bool fix_orientation = false) override;
398
399 void SetAttributes(bool elem_attrs_changed = true,
400 bool bdr_attrs_changed = true) override;
401
402 /// Checks if any rank in the mesh has boundary elements
403 bool HasBoundaryElements() const override;
404
405 MPI_Comm GetComm() const { return MyComm; }
406 int GetNRanks() const { return NRanks; }
407 int GetMyRank() const { return MyRank; }
408
409 /** Map a global element number to a local element number. If the global
410 element is not on this processor, return -1. */
411 int GetLocalElementNum(long long global_element_num) const;
412
413 /// Map a local element number to a global element number.
414 long long GetGlobalElementNum(int local_element_num) const;
415
416 /** The following functions define global indices for all local vertices,
417 edges, faces, or elements. The global indices have no meaning or
418 significance for ParMesh, but can be used for purposes beyond this class.
419 */
420 /// AMR meshes are not supported.
422 /// AMR meshes are not supported.
424 /// AMR meshes are not supported.
426 /// AMR meshes are supported.
428
429 /// @brief Populate a marker array identifying exterior faces
430 ///
431 /// @param[in,out] face_marker Resized if necessary to the number of
432 /// local faces. The array entries will be
433 /// zero for interior faces and 1 for exterior
434 /// faces.
435 void GetExteriorFaceMarker(Array<int> & face_marker) const override;
436
437 /// @brief Unmark boundary attributes of internal boundaries
438 ///
439 /// @param[in,out] bdr_marker Array of length bdr_attributes.Max().
440 /// Entries associated with internal boundaries
441 /// will be set to zero. Other entries will remain
442 /// unchanged.
443 /// @param[in] excl Only unmark entries which exclusively contain
444 /// internal faces [default: true].
445 void UnmarkInternalBoundaries(Array<int> &bdr_marker,
446 bool excl = true) const override;
447
448 /// @brief Mark boundary attributes of external boundaries
449 ///
450 /// @param[in,out] bdr_marker Array of length bdr_attributes.Max().
451 /// Entries associated with external boundaries
452 /// will be set to one. Other entries will remain
453 /// unchanged.
454 /// @param[in] excl Only mark entries which exclusively contain
455 /// external faces [default: true].
456 void MarkExternalBoundaries(Array<int> &bdr_marker,
457 bool excl = true) const override;
458
460
461 // Face-neighbor elements and vertices
468 // Local face-neighbor elements and vertices ordered by face-neighbor
471
473
474 int GetNGroups() const { return gtopo.NGroups(); }
475
476 ///@{ @name These methods require group > 0
477 int GroupNVertices(int group) const { return group_svert.RowSize(group-1); }
478 int GroupNEdges(int group) const { return group_sedge.RowSize(group-1); }
479 int GroupNTriangles(int group) const { return group_stria.RowSize(group-1); }
480 int GroupNQuadrilaterals(int group) const { return group_squad.RowSize(group-1); }
481
482 /**
483 * @brief Accessors for entities within a shared group structure.
484 * @details For all vertex/edge/face the two argument version returns the
485 * local index, for those entities with an orientation. The two out parameter
486 * version additionally returns an orientation to use in manipulating the
487 * entity.
488 *
489 * @param group The communicator group's indices
490 * @param i the index within the group
491 * @return int The local index of the entity
492 */
493 int GroupVertex(int group, int i) const
494 { return svert_lvert[group_svert.GetRow(group-1)[i]]; }
495 void GroupEdge(int group, int i, int &edge, int &o) const;
496 void GroupTriangle(int group, int i, int &face, int &o) const;
497 void GroupQuadrilateral(int group, int i, int &face, int &o) const;
498 int GroupEdge(int group, int i) const
499 {
500 int e, o;
501 GroupEdge(group, i, e, o);
502 return e;
503 }
504 int GroupTriangle(int group, int i) const
505 {
506 int f, o;
507 GroupTriangle(group, i, f, o);
508 return f;
509 }
510 int GroupQuadrilateral(int group, int i) const
511 {
512 int f, o;
513 GroupQuadrilateral(group, i, f, o);
514 return f;
515 }
516
517
518 ///@}
519
520 /**
521 * @brief Get the shared edges GroupCommunicator.
522 *
523 * @param[out] sedge_comm
524 */
526 {
527 GetSharedEdgeCommunicator(1, sedge_comm);
528 }
529
530 /**
531 * @brief Get the shared vertices GroupCommunicator.
532 *
533 * @param[out] svert_comm
534 */
536 {
537 GetSharedVertexCommunicator(1, svert_comm);
538 }
539
540 /**
541 * @brief Get the shared face quadrilaterals GroupCommunicator.
542 *
543 * @param[out] squad_comm
544 */
546 {
547 GetSharedQuadCommunicator(1, squad_comm);
548 }
549
550 /**
551 * @brief Get the shared face triangles GroupCommunicator.
552 *
553 * @param[out] stria_comm
554 */
556 {
557 GetSharedTriCommunicator(1, stria_comm);
558 }
559
560 void GenerateOffsets(int N, HYPRE_BigInt loc_sizes[],
561 Array<HYPRE_BigInt> *offsets[]) const;
562
564 void ExchangeFaceNbrData();
566
567 void SetCurvature(int order, bool discont = false, int space_dim = -1,
568 int ordering = 1) override;
569
570 /** Replace the internal node GridFunction with a new GridFunction defined on
571 the given FiniteElementSpace. The new node coordinates are projected
572 (derived) from the current nodes/vertices. */
573 void SetNodalFESpace(FiniteElementSpace *nfes) override;
575
576 int GetNFaceNeighbors() const { return face_nbr_group.Size(); }
577 int GetNFaceNeighborElements() const { return face_nbr_elements.Size(); }
578 int GetFaceNbrGroup(int fn) const { return face_nbr_group[fn]; }
579 int GetFaceNbrRank(int fn) const;
580
581 /** Similar to Mesh::GetElementFaces */
583 Array<int> &orientation) const;
584
585 /** Similar to Mesh::GetFaceToElementTable with added face-neighbor elements
586 with indices offset by the local number of elements. */
587 /// @note The returned Table should be deleted by the caller
589
590 /// Returns (a pointer to an object containing) the following data:
591 ///
592 /// 1) Elem1No - the index of the first element that contains this face this
593 /// is the element that has the same outward unit normal vector as the
594 /// face;
595 ///
596 /// 2) Elem2No - the index of the second element that contains this face this
597 /// element has outward unit normal vector as the face multiplied with -1;
598 ///
599 /// 3) Elem1, Elem2 - pointers to the ElementTransformation's of the first
600 /// and the second element respectively;
601 ///
602 /// 4) Face - pointer to the ElementTransformation of the face;
603 ///
604 /// 5) Loc1, Loc2 - IntegrationPointTransformation's mapping the face
605 /// coordinate system to the element coordinate system (both in their
606 /// reference elements). Used to transform IntegrationPoints from face to
607 /// element. More formally, let:
608 /// TL1, TL2 be the transformations represented by Loc1, Loc2,
609 /// TE1, TE2 - the transformations represented by Elem1, Elem2,
610 /// TF - the transformation represented by Face, then
611 /// TF(x) = TE1(TL1(x)) = TE2(TL2(x)) for all x in the reference face.
612 ///
613 /// 6) FaceGeom - the base geometry for the face.
614 ///
615 /// The mask specifies which fields in the structure to return:
616 /// mask & 1 - Elem1, mask & 2 - Elem2
617 /// mask & 4 - Loc1, mask & 8 - Loc2, mask & 16 - Face.
618 /// These mask values are defined in the ConfigMasks enum type as part of the
619 /// FaceElementTransformations class in fem/eltrans.hpp.
620 ///
621 /// @note The returned object is owned by the class and is shared, i.e.,
622 /// calling this function resets pointers obtained from previous calls.
623 /// Also, the returned object should NOT be deleted by the caller.
625 GetFaceElementTransformations(int FaceNo, int mask = 31) override;
626
627 /// @brief Variant of GetFaceElementTransformations using a user allocated
628 /// FaceElementTransformations object.
629 void GetFaceElementTransformations(int FaceNo,
633 int mask = 31) const override;
634
635 /// @brief Get the FaceElementTransformations for the given shared face (edge
636 /// 2D) using the shared face index @a sf. @a fill2 specifies whether
637 /// information for elem2 of the face should be computed. In the returned
638 /// object, 1 and 2 refer to the local and the neighbor elements,
639 /// respectively.
640 ///
641 /// @note The returned object is owned by the class and is shared, i.e.,
642 /// calling this function resets pointers obtained from previous calls. Also,
643 /// the returned object should NOT be deleted by the caller.
645 GetSharedFaceTransformations(int sf, bool fill2 = true);
646
647 /// @brief Variant of GetSharedFaceTransformations using a user allocated
648 /// FaceElementTransformations object.
653 bool fill2 = true) const;
654
655 /// @brief Get the FaceElementTransformations for the given shared face (edge
656 /// 2D) using the face index @a FaceNo. @a fill2 specifies whether
657 /// information for elem2 of the face should be computed. In the returned
658 /// object, 1 and 2 refer to the local and the neighbor elements,
659 /// respectively.
660 ///
661 /// @note The returned object is owned by the class and is shared, i.e.,
662 /// calling this function resets pointers obtained from previous calls. Also,
663 /// the returned object should NOT be deleted by the caller.
665 GetSharedFaceTransformationsByLocalIndex(int FaceNo, bool fill2 = true);
666
667 /// @brief Variant of GetSharedFaceTransformationsByLocalIndex using a user
668 /// allocated FaceElementTransformations object.
673 bool fill2 = true) const;
674
675 /// @brief Returns a pointer to the transformation defining the i-th face
676 /// neighbor.
677 ///
678 /// @note The returned object is owned by the class and is shared, i.e.,
679 /// calling this function resets pointers obtained from previous calls. Also,
680 /// the returned object should NOT be deleted by the caller.
682
683 /// @brief Variant of GetFaceNbrElementTransformation using a user allocated
684 /// IsoparametricTransformation object.
685 void GetFaceNbrElementTransformation(int FaceNo,
686 IsoparametricTransformation &ElTr) const;
687
688 /// Get the size of the i-th face neighbor element relative to the reference
689 /// element.
690 real_t GetFaceNbrElementSize(int i, int type = 0);
691
692 /// Return the number of shared faces (3D), edges (2D), vertices (1D)
693 int GetNSharedFaces() const;
694
695 /// Return the local face index for the given shared face.
696 int GetSharedFace(int sface) const;
697
698 /** @brief Returns the number of local faces according to the requested type,
699 does not count master non-conforming faces.
700
701 If type==Boundary returns only the number of true boundary faces contrary
702 to GetNBE() that returns all "boundary" elements which may include actual
703 interior faces. Similarly, if type==Interior, only the true interior
704 faces (including shared faces) are counted excluding all master
705 non-conforming faces. */
706 int GetNFbyType(FaceType type) const override;
707
709 { MFEM_ABORT("Generation of boundary elements works properly only on serial meshes."); }
710
711 /// See the remarks for the serial version in mesh.hpp
712 MFEM_DEPRECATED void ReorientTetMesh() override;
713
714 /// Utility function: sum integers from all processors (Allreduce).
715 long long ReduceInt(int value) const override;
716
717 /** Load balance the mesh by equipartitioning the global space-filling
718 sequence of elements. Works for nonconforming meshes only. */
719 void Rebalance();
720
721 /** Load balance a nonconforming mesh using a user-defined partition. Each
722 local element 'i' is migrated to processor rank 'partition[i]', for 0 <=
723 i < GetNE(). */
724 void Rebalance(const Array<int> &partition);
725
726 /** Save the mesh in a parallel mesh format. If @a comments is non-empty, it
727 will be printed after the first line of the file, and each line should
728 begin with '#'. */
729 void ParPrint(std::ostream &out, const std::string &comments = "") const;
730
731 // Enable Print() to add the parallel interface as boundary (typically used
732 // for visualization purposes)
733 void SetPrintShared(bool print) { print_shared = print; }
734
735 /** Print the part of the mesh in the calling processor using the mfem v1.0
736 format. Depending on SetPrintShared(), the parallel interface can be
737 added as boundary for visualization (true by default). If @a comments is
738 non-empty, it will be printed after the first line of the file, and each
739 line should begin with '#'. */
740 void Print(std::ostream &out = mfem::out,
741 const std::string &comments = "") const override;
742
743 /// Save the ParMesh to files (one for each MPI rank). The files will be
744 /// given suffixes according to the MPI rank. The mesh will be written to the
745 /// files using ParMesh::Print. The given @a precision will be used for ASCII
746 /// output.
747 void Save(const std::string &fname, int precision=16) const override;
748
749#ifdef MFEM_USE_ADIOS2
750 /** Print the part of the mesh in the calling processor using adios2 bp
751 format. */
752 void Print(adios2stream &out) const override;
753#endif
754
755 /** Print the part of the mesh in the calling processor adding the interface
756 as boundary (for visualization purposes) using Netgen/Truegrid format .*/
757 void PrintXG(std::ostream &out = mfem::out) const override;
758
759 /** Write the mesh to the stream 'out' on Process 0 in a form suitable for
760 visualization: the mesh is written as a disjoint mesh and the shared
761 boundary is added to the actual boundary; both the element and boundary
762 attributes are set to the processor number. If @a comments is non-empty,
763 it will be printed after the first line of the file, and each line should
764 begin with '#'. */
765 void PrintAsOne(std::ostream &out = mfem::out,
766 const std::string &comments = "") const;
767
768 /** Write the mesh to the stream 'out' on Process 0 as a serial mesh. The
769 output mesh does not have any duplication of vertices/nodes at processor
770 boundaries. If @a comments is non-empty, it will be printed after the
771 first line of the file, and each line should begin with '#'. */
772 void PrintAsSerial(std::ostream &out = mfem::out,
773 const std::string &comments = "") const;
774
775 /** Returns a Serial mesh on MPI rank @a save_rank that does not have any
776 duplication of vertices/nodes at processor boundaries. */
777 Mesh GetSerialMesh(int save_rank) const;
778
779 /// Save the mesh as a single file (using ParMesh::PrintAsOne). The given
780 /// @a precision is used for ASCII output.
781 void SaveAsOne(const std::string &fname, int precision=16) const;
782
783 /// Old mesh format (Netgen/Truegrid) version of 'PrintAsOne'
784 void PrintAsOneXG(std::ostream &out = mfem::out);
785
786 /** Print the mesh in parallel PVTU format. The PVTU and VTU files will be
787 stored in the directory specified by @a pathname. If the directory does
788 not exist, it will be created. */
789 void PrintVTU(std::string pathname,
791 bool high_order_output=false,
792 int compression_level=0,
793 bool bdr_elements=false) override;
794
795 /// Parallel version of Mesh::Load().
796 void Load(std::istream &input, int generate_edges = 0,
797 int refine = 1, bool fix_orientation = true) override;
798
799 /// Returns the minimum and maximum corners of the mesh bounding box. For
800 /// high-order meshes, the geometry is refined first "ref" times.
801 void GetBoundingBox(Vector &p_min, Vector &p_max, int ref = 2);
802
803 void GetCharacteristics(real_t &h_min, real_t &h_max,
804 real_t &kappa_min, real_t &kappa_max);
805
806 /// Swaps internal data with another ParMesh, including non-geometry members.
807 /// See @a Mesh::Swap
808 void Swap(ParMesh &other);
809
810 /// Print various parallel mesh stats
811 void PrintInfo(std::ostream &out = mfem::out) override;
812
813 int FindPoints(DenseMatrix& point_mat, Array<int>& elem_ids,
814 Array<IntegrationPoint>& ips, bool warn = true,
815 InverseElementTransformation *inv_trans = NULL) override;
816
817 /// Debugging method
818 void PrintSharedEntities(const std::string &fname_prefix) const;
819
820 /** @brief Return true if the input array of refinements to be performed would
821 result in conflicting anisotropic directions on a face. Indices of
822 @a refinements entries are contained in @a conflicts, for marked elements
823 neighboring a face with a conflict.
824
825 The return value is globally MPI-reduced (true if any MPI process has a
826 conflict), whereas @a conflicts contains local indices of conflicting
827 entries of @a refinements. Conflicts are defined as anisotropic
828 refinements in different directions on a face shared by two elements.
829 Conflicts are checked for the mesh that would result from the input
830 refinements. If there are no conflicts, then the refinements can be
831 performed without forced refinements. This function is supported only for
832 3D meshes with all hexahedral elements. */
833 bool AnisotropicConflict(const Array<Refinement> &refinements,
834 std::set<int> &conflicts) const;
835
836 virtual ~ParMesh();
837};
838
839}
840
841#endif // MFEM_USE_MPI
842
843#endif
int Size() const
Return the logical size of the array.
Definition array.hpp:166
Data type dense matrix using column-major storage.
Definition densemat.hpp:24
Abstract data type element.
Definition element.hpp:29
Type
Constants for the classes derived from Element.
Definition element.hpp:41
A specialized ElementTransformation class representing a face and its two neighboring elements.
Definition eltrans.hpp:750
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:208
Communicator performing operations within groups defined by a GroupTopology with arbitrary-size data ...
int NGroups() const
Return the number of groups.
The inverse transformation of a given ElementTransformation.
Definition eltrans.hpp:200
A standard isoparametric element transformation.
Definition eltrans.hpp:629
List of integer sets.
Definition sets.hpp:51
Mesh data type.
Definition mesh.hpp:65
Array< Element * > faces
Definition mesh.hpp:109
bool FaceIsTrueInterior(int FaceNo) const
Definition mesh.hpp:610
void Swap(Mesh &other, bool non_geometry)
Definition mesh.cpp:11036
Abstract parallel finite element space.
Definition pfespace.hpp:31
Class for parallel meshes.
Definition pmesh.hpp:34
Mesh GetSerialMesh(int save_rank) const
Definition pmesh.cpp:5319
void GetCharacteristics(real_t &h_min, real_t &h_max, real_t &kappa_min, real_t &kappa_max)
Definition pmesh.cpp:6201
void NonconformingRefinement(const Array< Refinement > &refinements, int nc_limit=0) override
This function is not public anymore. Use GeneralRefinement instead.
Definition pmesh.cpp:3907
int GroupNQuadrilaterals(int group) const
Definition pmesh.hpp:480
ElementTransformation * GetFaceNbrElementTransformation(int FaceNo)
Returns a pointer to the transformation defining the i-th face neighbor.
Definition pmesh.cpp:3098
void GetFaceSplittings(const int *fv, const HashTable< Hashed2 > &v_to_v, Array< unsigned > &codes)
Append codes identifying how the given face has been split to codes.
Definition pmesh.cpp:1882
void GetGhostFaceTransformation(FaceElementTransformations *FElTr, Element::Type face_type, Geometry::Type face_geom) const
Definition pmesh.hpp:155
Table send_face_nbr_elements
Definition pmesh.hpp:469
Array< int > face_nbr_vertices_offset
Definition pmesh.hpp:465
void BuildVertexGroup(int ngroups, const Table &vert_element)
Definition pmesh.cpp:705
void NURBSUniformRefinement(int rf=2, real_t tol=1.0e-12) override
Refine NURBS mesh, with an optional refinement factor.
Definition pmesh.cpp:4588
void SetAttributes(bool elem_attrs_changed=true, bool bdr_attrs_changed=true) override
Determine the sets of unique attribute values in domain if elem_attrs_changed and boundary elements i...
Definition pmesh.cpp:1593
MPI_Comm GetComm() const
Definition pmesh.hpp:405
void PrintXG(std::ostream &out=mfem::out) const override
Definition pmesh.cpp:4612
Array< Element * > shared_edges
Definition pmesh.hpp:69
int GroupEdge(int group, int i) const
Definition pmesh.hpp:498
int GetMyRank() const
Definition pmesh.hpp:407
int GetEdgeSplittings(Element *edge, const DSTable &v_to_v, int *middle)
Return a number(0-1) identifying how the given edge has been split.
Definition pmesh.cpp:1867
void RefineGroups(const DSTable &v_to_v, int *middle)
Update the groups after triangle refinement.
Definition pmesh.cpp:4079
void ParPrint(std::ostream &out, const std::string &comments="") const
Definition pmesh.cpp:6341
void GetSharedTriCommunicator(int ordering, GroupCommunicator &stria_comm) const
Get the shared face triangles GroupCommunicator.
Definition pmesh.cpp:1728
bool NonconformingDerefinement(Array< real_t > &elem_error, real_t threshold, int nc_limit=0, int op=1) override
NC version of GeneralDerefinement.
Definition pmesh.cpp:3965
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
Definition pmesh.cpp:3164
Array< int > sface_lface
Definition pmesh.hpp:86
void SaveAsOne(const std::string &fname, int precision=16) const
Definition pmesh.cpp:5636
void ExchangeFaceNbrData()
Definition pmesh.cpp:2079
Table group_sedge
Definition pmesh.hpp:78
int GetNRanks() const
Definition pmesh.hpp:406
void BuildEdgeGroup(int ngroups, const Table &edge_element)
Definition pmesh.cpp:679
Table group_svert
Shared objects in each group.
Definition pmesh.hpp:77
MFEM_DEPRECATED void ReorientTetMesh() override
See the remarks for the serial version in mesh.hpp.
Definition pmesh.cpp:3237
int GroupVertex(int group, int i) const
Accessors for entities within a shared group structure.
Definition pmesh.hpp:493
void UniformRefinement2D() override
Refine a mixed 2D mesh uniformly.
Definition pmesh.cpp:4536
bool WantSkipSharedMaster(const NCMesh::Master &master) const
Definition pmesh.cpp:4814
FaceElementTransformations * GetFaceElementTransformations(int FaceNo, int mask=31) override
Definition pmesh.cpp:2907
void BuildSharedVertMapping(int nvert, const Table *vert_element, const Array< int > &vert_global_local)
Definition pmesh.cpp:845
long long GetGlobalElementNum(int local_element_num) const
Map a local element number to a global element number.
Definition pmesh.cpp:1551
bool AnisotropicConflict(const Array< Refinement > &refinements, std::set< int > &conflicts) const
Return true if the input array of refinements to be performed would result in conflicting anisotropic...
Definition pmesh.cpp:3900
Table * GetFaceToAllElementTable() const
Definition pmesh.cpp:2849
virtual ~ParMesh()
Definition pmesh.cpp:6885
void ReduceMeshGen()
Definition pmesh.cpp:891
void GetGlobalElementIndices(Array< HYPRE_BigInt > &gi) const
AMR meshes are supported.
Definition pmesh.cpp:6696
void AddTriFaces(const Array< int > &v, const std::unique_ptr< STable3D > &faces, const std::unique_ptr< STable3D > &shared_faces, int elem, int start, int end, const int fverts[][N])
Helper function for adding triangle face neighbor element to face table entries. Have to use a templa...
Definition pmesh.cpp:2687
void FindSharedFaces(const Mesh &mesh, const int *partition, Array< int > &face_group, ListOfIntegerSets &groups)
Definition pmesh.cpp:515
long long glob_elem_offset
Definition pmesh.hpp:95
void GetSharedEdgeCommunicator(int ordering, GroupCommunicator &sedge_comm) const
Get the shared edges GroupCommunicator.
Definition pmesh.cpp:1656
void PrintInfo(std::ostream &out=mfem::out) override
Print various parallel mesh stats.
Definition pmesh.cpp:6218
int GetNFbyType(FaceType type) const override
Returns the number of local faces according to the requested type, does not count master non-conformi...
Definition pmesh.cpp:3205
void GetGlobalVertexIndices(Array< HYPRE_BigInt > &gi) const
AMR meshes are not supported.
Definition pmesh.cpp:6629
int GetNFaceNeighborElements() const
Definition pmesh.hpp:577
bool HasBoundaryElements() const override
Checks if any rank in the mesh has boundary elements.
Definition pmesh.cpp:1617
bool print_shared
Definition pmesh.hpp:101
void LocalRefinement(const Array< int > &marked_el, int type=3) override
This function is not public anymore. Use GeneralRefinement instead.
Definition pmesh.cpp:3396
void GetFaceNbrElementFaces(int i, Array< int > &faces, Array< int > &orientation) const
Definition pmesh.cpp:2824
void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1) override
Set the curvature of the mesh nodes using the given polynomial degree.
Definition pmesh.cpp:2017
void SetPrintShared(bool print)
Definition pmesh.hpp:733
void GetSharedTriCommunicator(GroupCommunicator &stria_comm) const
Get the shared face triangles GroupCommunicator.
Definition pmesh.hpp:555
long glob_offset_sequence
Definition pmesh.hpp:96
int GetLocalElementNum(long long global_element_num) const
Definition pmesh.cpp:1543
void MarkExternalBoundaries(Array< int > &bdr_marker, bool excl=true) const override
Mark boundary attributes of external boundaries.
Definition pmesh.cpp:6773
int FindPoints(DenseMatrix &point_mat, Array< int > &elem_ids, Array< IntegrationPoint > &ips, bool warn=true, InverseElementTransformation *inv_trans=NULL) override
Find the ids of the elements that contain the given points, and their corresponding reference coordin...
Definition pmesh.cpp:6493
void GetSharedQuadCommunicator(int ordering, GroupCommunicator &squad_comm) const
Get the shared face quadrilaterals GroupCommunicator.
Definition pmesh.cpp:1704
void BuildFaceNbrElementToFaceTable()
Definition pmesh.cpp:2720
void MakeRefined_(ParMesh &orig_mesh, int ref_factor, int ref_type)
Internal function used in ParMesh::MakeRefined (and related constructor)
Definition pmesh.cpp:1139
void GetGlobalFaceIndices(Array< HYPRE_BigInt > &gi) const
AMR meshes are not supported.
Definition pmesh.cpp:6668
Array< Vertex > face_nbr_vertices
Definition pmesh.hpp:467
void UniformRefineGroups2D(int old_nv)
Definition pmesh.cpp:4336
void GetGlobalEdgeIndices(Array< HYPRE_BigInt > &gi) const
AMR meshes are not supported.
Definition pmesh.cpp:6645
void ExchangeFaceNbrNodes()
Definition pmesh.cpp:2562
void SetNodalFESpace(FiniteElementSpace *nfes) override
Definition pmesh.cpp:2038
void UniformRefinement3D() override
Refine a mixed 3D mesh uniformly.
Definition pmesh.cpp:4560
void PrintVTU(std::string pathname, VTKFormat format=VTKFormat::ASCII, bool high_order_output=false, int compression_level=0, bool bdr_elements=false) override
Definition pmesh.cpp:6425
void Rebalance()
Definition pmesh.cpp:4027
bool have_face_nbr_data
Definition pmesh.hpp:462
long long ReduceInt(int value) const override
Utility function: sum integers from all processors (Allreduce).
Definition pmesh.cpp:6334
Table send_face_nbr_vertices
Definition pmesh.hpp:470
ParMesh()
Default constructor. Create an empty ParMesh.
Definition pmesh.hpp:337
void GetExteriorFaceMarker(Array< int > &face_marker) const override
Populate a marker array identifying exterior faces.
Definition pmesh.cpp:6710
int BuildLocalElements(const Mesh &global_mesh, const int *partitioning, const Array< int > &vert_global_local)
Fills out partitioned Mesh::elements.
Definition pmesh.cpp:365
MPI_Comm MyComm
Definition pmesh.hpp:45
bool DecodeFaceSplittings(HashTable< Hashed2 > &v_to_v, const int *v, const Array< unsigned > &codes, int &pos)
Definition pmesh.cpp:1917
static ParMesh MakeSimplicial(ParMesh &orig_mesh)
Definition pmesh.cpp:1381
Array< Vert4 > shared_quads
Definition pmesh.hpp:74
void GenerateBoundaryElements() override
Definition pmesh.hpp:708
void LoadSharedEntities(std::istream &input)
Definition pmesh.cpp:985
void Finalize(bool refine=false, bool fix_orientation=false) override
Finalize the construction of a general Mesh.
Definition pmesh.cpp:1528
int GetFaceNbrGroup(int fn) const
Definition pmesh.hpp:578
Table group_squad
Definition pmesh.hpp:80
void GetSharedEdgeCommunicator(GroupCommunicator &sedge_comm) const
Get the shared edges GroupCommunicator.
Definition pmesh.hpp:525
void BuildFaceGroup(int ngroups, const Mesh &mesh, const Array< int > &face_group, int &nstria, int &nsquad)
Definition pmesh.cpp:633
void BuildSharedEdgeElems(int nedges, Mesh &mesh, const Array< int > &vert_global_local, const Table *edge_element)
Definition pmesh.cpp:808
Array< int > svert_lvert
Shared to local index mapping.
Definition pmesh.hpp:83
Array< int > sedge_ledge
Definition pmesh.hpp:84
Array< Element * > face_nbr_elements
Definition pmesh.hpp:466
GroupTopology gtopo
Definition pmesh.hpp:459
void Destroy()
Definition pmesh.cpp:6869
FaceElementTransformations * GetSharedFaceTransformationsByLocalIndex(int FaceNo, bool fill2=true)
Get the FaceElementTransformations for the given shared face (edge 2D) using the face index FaceNo....
Definition pmesh.cpp:2952
void PrintSharedEntities(const std::string &fname_prefix) const
Debugging method.
Definition pmesh.cpp:6542
int GroupNTriangles(int group) const
Definition pmesh.hpp:479
void GetSharedVertexCommunicator(int ordering, GroupCommunicator &svert_comm) const
Get the shared vertices GroupCommunicator.
Definition pmesh.cpp:1680
int GetSharedFace(int sface) const
Return the local face index for the given shared face.
Definition pmesh.cpp:3183
void EnsureParNodes()
If the mesh is curved, make sure 'Nodes' is ParGridFunction.
Definition pmesh.cpp:2059
int GroupNEdges(int group) const
Definition pmesh.hpp:478
void BuildSharedFaceElems(int ntri_faces, int nquad_faces, const Mesh &mesh, const int *partitioning, const STable3D *faces_tbl, const Array< int > &face_group, const Array< int > &vert_global_local)
Definition pmesh.cpp:731
void GenerateOffsets(int N, HYPRE_BigInt loc_sizes[], Array< HYPRE_BigInt > *offsets[]) const
Definition pmesh.cpp:1953
void MarkTetMeshForRefinement(const DSTable &v_to_v) override
Definition pmesh.cpp:1752
Array< int > face_nbr_group
Definition pmesh.hpp:463
Array< int > face_nbr_elements_offset
Definition pmesh.hpp:464
ParMesh & operator=(ParMesh &&mesh)
Move assignment operator.
Definition pmesh.cpp:100
void DeleteFaceNbrData()
Definition pmesh.cpp:1996
void Load(std::istream &input, int generate_edges=0, int refine=1, bool fix_orientation=true) override
Parallel version of Mesh::Load().
Definition pmesh.cpp:949
int GetNFaceNeighbors() const
Definition pmesh.hpp:576
void UniformRefineGroups3D(int old_nv, int old_nedges, const DSTable &old_v_to_v, const STable3D &old_faces, Array< int > *f2qf)
Definition pmesh.cpp:4387
void GetGhostFaceTransformation(FaceElementTransformations &FElTr, Element::Type face_type, Geometry::Type face_geom) const
Definition pmesh.cpp:3066
void RebalanceImpl(const Array< int > *partition)
Definition pmesh.cpp:4037
int FindSharedEdges(const Mesh &mesh, const int *partition, Table *&edge_element, ListOfIntegerSets &groups)
Definition pmesh.cpp:542
void FinalizeParTopo()
Definition pmesh.cpp:897
void PrintAsOneXG(std::ostream &out=mfem::out)
Old mesh format (Netgen/Truegrid) version of 'PrintAsOne'.
Definition pmesh.cpp:5647
std::unique_ptr< Table > face_nbr_el_to_face
Definition pmesh.hpp:90
Array< Vert3 > shared_trias
Definition pmesh.hpp:73
int GroupTriangle(int group, int i) const
Definition pmesh.hpp:504
void GroupQuadrilateral(int group, int i, int &face, int &o) const
Definition pmesh.cpp:1645
void Save(const std::string &fname, int precision=16) const override
Definition pmesh.cpp:4966
void DistributeAttributes(Array< int > &attr)
Ensure that bdr_attributes and attributes agree across processors.
Definition pmesh.cpp:1557
ParMesh & operator=(const ParMesh &mesh)=delete
Explicitly delete the copy assignment operator.
STable3D * GetSharedFacesTable()
Definition pmesh.cpp:2622
static ParMesh MakeRefined(ParMesh &orig_mesh, int ref_factor, int ref_type)
Create a uniformly refined (by any factor) version of orig_mesh.
Definition pmesh.cpp:1374
int GetNGroups() const
Definition pmesh.hpp:474
real_t GetFaceNbrElementSize(int i, int type=0)
Definition pmesh.cpp:3159
ParNCMesh * pncmesh
Definition pmesh.hpp:472
void UnmarkInternalBoundaries(Array< int > &bdr_marker, bool excl=true) const override
Unmark boundary attributes of internal boundaries.
Definition pmesh.cpp:6717
std::unique_ptr< Table > face_nbr_el_ori
orientations for each face (from nbr processor)
Definition pmesh.hpp:92
int GetFaceNbrRank(int fn) const
Definition pmesh.cpp:2806
int FindSharedVertices(const int *partition, Table *vertex_element, ListOfIntegerSets &groups)
Definition pmesh.cpp:596
void GroupTriangle(int group, int i, int &face, int &o) const
Definition pmesh.cpp:1634
FaceElementTransformations * GetSharedFaceTransformations(int sf, bool fill2=true)
Get the FaceElementTransformations for the given shared face (edge 2D) using the shared face index sf...
Definition pmesh.cpp:2933
void PrintAsSerial(std::ostream &out=mfem::out, const std::string &comments="") const
Definition pmesh.cpp:5308
void GetSharedVertexCommunicator(GroupCommunicator &svert_comm) const
Get the shared vertices GroupCommunicator.
Definition pmesh.hpp:535
void GetSharedQuadCommunicator(GroupCommunicator &squad_comm) const
Get the shared face quadrilaterals GroupCommunicator.
Definition pmesh.hpp:545
int BuildLocalBoundary(const Mesh &global_mesh, const int *partitioning, const Array< int > &vert_global_local, Array< bool > &activeBdrElem, Table *&edge_element)
Fills out partitioned Mesh::boundary.
Definition pmesh.cpp:395
Table group_stria
Definition pmesh.hpp:79
int BuildLocalVertices(const Mesh &global_mesh, const int *partitioning, Array< int > &vert_global_local)
Fills out partitioned Mesh::vertices.
Definition pmesh.cpp:317
void ComputeGlobalElementOffset() const
Definition pmesh.cpp:878
void GetBoundingBox(Vector &p_min, Vector &p_max, int ref=2)
Definition pmesh.cpp:6181
void PrintAsOne(std::ostream &out=mfem::out, const std::string &comments="") const
Definition pmesh.cpp:4994
void Print(std::ostream &out=mfem::out, const std::string &comments="") const override
Definition pmesh.cpp:4827
void RefineNURBSWithKVFactors(int rf, const std::string &kvf) override
Definition pmesh.cpp:4604
void Swap(ParMesh &other)
Definition pmesh.cpp:6826
void GroupEdge(int group, int i, int &edge, int &o) const
Definition pmesh.cpp:1626
int GroupQuadrilateral(int group, int i) const
Definition pmesh.hpp:510
int GroupNVertices(int group) const
Definition pmesh.hpp:477
A parallel extension of the NCMesh class.
Definition pncmesh.hpp:63
Class for PUMI parallel meshes.
Definition pumi.hpp:70
Subdomain representation of a topological parent in another ParMesh.
Definition psubmesh.hpp:54
Symmetric 3D Table stored as an array of rows each of which has a stack of column,...
Definition stable3d.hpp:35
Table stores the connectivity of elements of TYPE I to elements of TYPE II. For example,...
Definition table.hpp:43
int RowSize(int i) const
Definition table.hpp:122
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
Definition table.cpp:233
Vector data type.
Definition vector.hpp:82
HYPRE_Int HYPRE_BigInt
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
Definition globals.hpp:66
VTKFormat
Data array format for VTK and VTU files.
Definition vtk.hpp:100
@ ASCII
Data arrays will be written in ASCII format.
float real_t
Definition config.hpp:46
std::function< real_t(const Vector &)> f(real_t mass_coeff)
Definition lor_mms.hpp:30
FaceType
Definition mesh.hpp:49
void Set(const int *w)
Definition pmesh.hpp:54
void Set(int v0, int v1, int v2)
Definition pmesh.hpp:53
Vert3(int v0, int v1, int v2)
Definition pmesh.hpp:52
void Set(int v0, int v1, int v2, int v3)
Definition pmesh.hpp:63
void Set(const int *w)
Definition pmesh.hpp:65
Vert4(int v0, int v1, int v2, int v3)
Definition pmesh.hpp:61