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