Nektar++
Loading...
Searching...
No Matches
MeshGraph.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: MeshGraph.h
4//
5// For more information, please see: http://www.nektar.info/
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description:
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
36#define NEKTAR_SPATIALDOMAINS_MESHGRAPH_H
37
38#include <unordered_map>
39
44
53
56
57class TiXmlDocument;
58
59namespace Nektar
60{
61
62template <>
63PoolAllocator<SpatialDomains::PointGeom>
65template <>
68template <>
71template <>
74template <>
77template <>
80template <>
83template <>
86
87namespace SpatialDomains
88{
89
90template <typename T> using GeomMap = std::map<int, unique_ptr_objpool<T>>;
91
92// Point geom type defs
94typedef std::shared_ptr<PointGeom>
95 PointGeomSharedPtr; // @TODO: Remove once fixed curves
96
97// Geometry typedefs
107
108// Minimal owner of Geom objects not owned by a MeshGraph.
110{
111public:
112 std::vector<PointGeomUniquePtr> m_pointVec;
113 std::vector<SegGeomUniquePtr> m_segVec;
114 std::vector<TriGeomUniquePtr> m_triVec;
115 std::vector<QuadGeomUniquePtr> m_quadVec;
116 std::vector<TetGeomUniquePtr> m_tetVec;
117 std::vector<PyrGeomUniquePtr> m_pyrVec;
118 std::vector<PrismGeomUniquePtr> m_prismVec;
119 std::vector<HexGeomUniquePtr> m_hexVec;
120};
121
122// Composite type def
123typedef std::map<int, std::pair<LibUtilities::ShapeType, std::vector<int>>>
125
148
149// Keep this consistent with the enums in ExpansionType.
150// This is used in the BC file to specify the expansion type.
151const std::string kExpansionTypeStr[] = {"NOTYPE",
152 "MODIFIED",
153 "MODIFIEDQUADPLUS1",
154 "MODIFIEDQUADPLUS2",
155 "MODIFIEDGLLRADAU10",
156 "ORTHOGONAL",
157 "GLL_LAGRANGE",
158 "GLL_LAGRANGE_SEM",
159 "GAUSS_LAGRANGE",
160 "GAUSS_LAGRANGE_SEM",
161 "FOURIER",
162 "FOURIERSINGLEMODE",
163 "FOURIERHALFMODERE",
164 "FOURIERHALFMODEIM",
165 "CHEBYSHEV",
166 "FOURIER-CHEBYSHEV",
167 "CHEBYSHEV-FOURIER",
168 "FOURIER-MODIFIED"};
169
170typedef std::map<int, std::vector<unsigned int>> CompositeOrdering;
171typedef std::map<int, std::vector<unsigned int>> BndRegionOrdering;
172
174{
175 std::vector<Geometry *> m_geomVec;
176};
177
178typedef std::shared_ptr<Composite> CompositeSharedPtr;
179typedef std::map<int, CompositeSharedPtr> CompositeMap;
180
181struct ExpansionInfo;
182
183typedef std::shared_ptr<ExpansionInfo> ExpansionInfoShPtr;
184typedef std::map<int, ExpansionInfoShPtr> ExpansionInfoMap;
185
186typedef std::shared_ptr<ExpansionInfoMap> ExpansionInfoMapShPtr;
187typedef std::map<std::string, ExpansionInfoMapShPtr> ExpansionInfoMapShPtrMap;
188
190{
192 const LibUtilities::BasisKeyVector basiskeyvec)
193 : m_geomPtr(geomPtr), m_basisKeyVector(basiskeyvec)
194 {
195 }
196
198 : m_geomPtr(ExpInfo->m_geomPtr),
200 {
201 }
202
205};
206
207typedef std::map<std::string, std::string> GeomInfoMap;
208typedef std::shared_ptr<std::vector<std::pair<Geometry *, int>>>
210
211// Forward declaration
212class RefRegion;
213
214typedef std::map<std::string, std::string> MeshMetaDataMap;
215
216class MeshGraph;
217typedef std::shared_ptr<MeshGraph> MeshGraphSharedPtr;
218
219class Movement;
220typedef std::shared_ptr<Movement> MovementSharedPtr;
221
222template <typename T> class GeomMapView
223{
224public:
226 {
228
229 public:
230 using value_type = std::pair<int, T *>;
231
232 explicit Iterator(typename GeomMap<T>::const_iterator it) : m_it(it)
233 {
234 }
235
237 {
238 return {m_it->first, m_it->second.get()};
239 }
241 {
242 ++m_it;
243 return *this;
244 }
245 bool operator!=(const Iterator &other) const
246 {
247 return m_it != other.m_it;
248 }
249 bool operator==(const Iterator &other) const
250 {
251 return m_it == other.m_it;
252 }
253 };
254
255 explicit GeomMapView(const GeomMap<T> &map) : m_map(map)
256 {
257 }
258
260 {
261 return Iterator(m_map.begin());
262 }
263 Iterator end() const
264 {
265 return Iterator(m_map.end());
266 }
267
268 std::size_t size() const
269 {
270 return m_map.size();
271 }
272
273 Iterator find(int id) const
274 {
275 return Iterator(m_map.find(id));
276 }
277
278 T *at(int id) const
279 {
280 auto it = m_map.find(id);
281 return it != m_map.end() ? it->second.get() : nullptr;
282 }
283
284private:
286};
287
288/// Base class for a spectral/hp element mesh.
290{
291public:
294
295 void Empty(int dim, int space)
296 {
297 m_meshDimension = dim;
298 m_spaceDimension = space;
299 }
300
301 /*transfers the minial data structure to full meshgraph*/
303
305
307 PointGeom *p);
308
309 ////////////////////
311
312 /// Read refinement info.
314
315 /* ---- Helper functions ---- */
316 /// Dimension of the mesh (can be a 1D curve in 3D space).
318 {
319 return m_meshDimension;
320 }
321
322 /// Dimension of the space (can be a 1D curve in 3D space).
324 {
325 return m_spaceDimension;
326 }
327
328 void SetMeshDimension(int dim)
329 {
330 m_meshDimension = dim;
331 }
332
333 void SetSpaceDimension(int dim)
334 {
335 m_spaceDimension = dim;
336 }
337
338 /* Range definitions for postprorcessing */
340 NekDouble xmin, NekDouble xmax,
345
348
349 /// Check if goemetry is in range definition if activated
351
352 /// Check if goemetry is in range definition if activated
354
355 /// Check if goemetry is in range definition if activated
357
358 /* ---- Composites and Domain ---- */
360 {
361 ASSERTL0(m_meshComposites.find(whichComposite) !=
362 m_meshComposites.end(),
363 "Composite not found.");
364 return m_meshComposites.find(whichComposite)->second;
365 }
366
368 int whichItem);
369
371 const std::string &compositeStr, CompositeMap &compositeVector) const;
372
373 std::map<int, CompositeSharedPtr> &GetComposites()
374 {
375 return m_meshComposites;
376 }
377
378 std::map<int, std::string> &GetCompositesLabels()
379 {
380 return m_compositesLabels;
381 }
382
383 std::map<int, std::map<int, CompositeSharedPtr>> &GetDomain()
384 {
385 return m_domain;
386 }
387
388 std::map<int, CompositeSharedPtr> &GetDomain(int domain)
389 {
390 ASSERTL1(m_domain.count(domain),
391 "Request for domain which does not exist");
392 return m_domain[domain];
393 }
394
399
401 const std::string variable = "DefaultVar");
402
404 GetExpansionInfo(Geometry *geom, const std::string variable = "DefaultVar");
405
406 /// Sets expansions given field definitions
408 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
409
410 /// Sets expansions given field definition, quadrature points.
412 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
413 std::vector<std::vector<LibUtilities::PointsType>> &pointstype);
414
415 /// Sets expansions to have equispaced points
417 int npoints = 0);
418
419 /// Reset expansion to have specified polynomial order \a nmodes
421
422 /// Reset expansion to have specified point order \a
423 /// npts
425 /// This function sets the expansion #exp in map with
426 /// entry #variable
427
428 /// Set refinement info.
430 ExpansionInfoMapShPtr &expansionMap);
431
432 /// Perform the p-refinement in the selected elements
434 ExpansionInfoMapShPtr &expansionMap, RefRegion *&region,
435 Geometry *geomVecIter);
436
437 inline void SetExpansionInfo(const std::string variable,
439
441
442 /// Sets the basis key for all expansions of the given shape.
445 std::string var = "DefaultVar");
446
450
451 inline bool SameExpansionInfo(const std::string var1,
452 const std::string var2);
453
454 inline bool ExpansionInfoDefined(const std::string var);
455
456 inline bool CheckForGeomInfo(std::string parameter);
457
458 inline const std::string GetGeomInfo(std::string parameter);
459
462 const int order);
463
466 ExpansionType type_y,
467 ExpansionType type_z,
468 const int nummodes_x,
469 const int nummodes_y,
470 const int nummodes_z);
471
472 /* ---- Manipulation of mesh ---- */
474 {
475 return m_pointGeoms.size();
476 }
477
478 /**
479 * @brief Returns vertex @p id from the MeshGraph.
480 */
481 [[deprecated("since 5.8.0, use GetPointGeom() instead")]] PointGeom *GetVertex(
482 int id)
483 {
484 return this->GetGeom(id, m_pointGeoms);
485 }
486
487 /**
488 * @brief Returns vertex @p id from the MeshGraph.
489 */
491 {
492 return this->GetGeom(id, m_pointGeoms);
493 }
494
495 /**
496 * @brief Returns segment @p id from the MeshGraph.
497 */
499 {
500 return this->GetGeom(id, m_segGeoms);
501 }
502
503 /**
504 * @brief Returns triangle @p id from the MeshGraph.
505 */
507 {
508 return this->GetGeom(id, m_triGeoms);
509 }
510
511 /**
512 * @brief Returns quadrilateral @p id from the MeshGraph.
513 */
515 {
516 return this->GetGeom(id, m_quadGeoms);
517 }
518
519 /**
520 * @brief Returns tetrahedron @p id from the MeshGraph.
521 */
523 {
524 return this->GetGeom(id, m_tetGeoms);
525 }
526
527 /**
528 * @brief Returns pyramid @p id from the MeshGraph.
529 */
531 {
532 return this->GetGeom(id, m_pyrGeoms);
533 }
534
535 /**
536 * @brief Returns prism @p id from the MeshGraph.
537 */
539 {
540 return this->GetGeom(id, m_prismGeoms);
541 }
542
543 /**
544 * @brief Returns hex @p id from the MeshGraph.
545 */
547 {
548 return this->GetGeom(id, m_hexGeoms);
549 }
550
551 /**
552 * @brief Convenience function to add a geometry @p geom to the MeshGraph
553 * with geometry ID @p id. Retains ownership of the passed unique_ptr.
554 *
555 * @p id Geometry ID
556 * @p geom unique_ptr to geometry object.
557 */
558 template <typename T> void AddGeom(int id, unique_ptr_objpool<T> geom)
559 {
560 if constexpr (std::is_same_v<T, PointGeom>)
561 {
562 m_pointGeoms.insert(std::make_pair(id, std::move(geom)));
563 }
564 else if constexpr (std::is_same_v<T, SegGeom>)
565 {
566 m_segGeoms.insert(std::make_pair(id, std::move(geom)));
567 }
568 else if constexpr (std::is_same_v<T, QuadGeom>)
569 {
570 m_quadGeoms.insert(std::make_pair(id, std::move(geom)));
571 }
572 else if constexpr (std::is_same_v<T, TriGeom>)
573 {
574 m_triGeoms.insert(std::make_pair(id, std::move(geom)));
575 }
576 else if constexpr (std::is_same_v<T, TetGeom>)
577 {
578 m_tetGeoms.insert(std::make_pair(id, std::move(geom)));
579 }
580 else if constexpr (std::is_same_v<T, PyrGeom>)
581 {
582 m_pyrGeoms.insert(std::make_pair(id, std::move(geom)));
583 }
584 else if constexpr (std::is_same_v<T, PrismGeom>)
585 {
586 m_prismGeoms.insert(std::make_pair(id, std::move(geom)));
587 }
588 else if constexpr (std::is_same_v<T, HexGeom>)
589 {
590 m_hexGeoms.insert(std::make_pair(id, std::move(geom)));
591 }
592 else
593 {
594 ASSERTL0(false, "Unknown geometry type");
595 }
596 }
597
599 const int vid,
600 NekDouble x, NekDouble y,
601 NekDouble z)
602 {
603 auto geom =
605 auto ret = geom.get();
606 AddGeom(vid, std::move(geom));
607 return ret;
608 }
609
611 int id, int coordim, std::array<PointGeom *, SegGeom::kNverts> vertex,
612 const CurveSharedPtr curve = CurveSharedPtr())
613 {
614 auto geom = ObjPoolManager<SegGeom>::AllocateUniquePtr(id, coordim,
615 vertex, curve);
616 auto ret = geom.get();
617 AddGeom(id, std::move(geom));
618 return ret;
619 }
620
622 int id, std::array<SegGeom *, QuadGeom::kNedges> edges,
623 const CurveSharedPtr curve = CurveSharedPtr())
624 {
625 auto geom =
627 auto ret = geom.get();
628 AddGeom(id, std::move(geom));
629 return ret;
630 }
631
633 int id, std::array<SegGeom *, TriGeom::kNedges> edges,
634 const CurveSharedPtr curve = CurveSharedPtr())
635 {
636 auto geom =
638 auto ret = geom.get();
639 AddGeom(id, std::move(geom));
640 return ret;
641 }
642
644 int id, std::array<TriGeom *, TetGeom::kNfaces> faces)
645 {
646 auto geom = ObjPoolManager<TetGeom>::AllocateUniquePtr(id, faces);
647 auto ret = geom.get();
648 AddGeom(id, std::move(geom));
649 return ret;
650 }
651
653 int id, std::array<QuadGeom *, HexGeom::kNfaces> faces)
654 {
655 auto geom = ObjPoolManager<HexGeom>::AllocateUniquePtr(id, faces);
656 auto ret = geom.get();
657 AddGeom(id, std::move(geom));
658 return ret;
659 }
660
662 int id, std::array<Geometry2D *, PrismGeom::kNfaces> faces)
663 {
665 auto ret = geom.get();
666 AddGeom(id, std::move(geom));
667 return ret;
668 }
669
671 int id, std::array<Geometry2D *, PyrGeom::kNfaces> faces)
672 {
673 auto geom = ObjPoolManager<PyrGeom>::AllocateUniquePtr(id, faces);
674 auto ret = geom.get();
675 AddGeom(id, std::move(geom));
676 return ret;
677 }
678
683
688
689 template <typename T> GeomMapView<T> &GetGeomMap()
690 {
691 if constexpr (std::is_same_v<T, PointGeom>)
692 {
693 return m_pointMapView;
694 }
695 else if constexpr (std::is_same_v<T, SegGeom>)
696 {
697 return m_segMapView;
698 }
699 else if constexpr (std::is_same_v<T, TriGeom>)
700 {
701 return m_triMapView;
702 }
703 else if constexpr (std::is_same_v<T, QuadGeom>)
704 {
705 return m_quadMapView;
706 }
707 else if constexpr (std::is_same_v<T, TetGeom>)
708 {
709 return m_tetMapView;
710 }
711 else if constexpr (std::is_same_v<T, PrismGeom>)
712 {
713 return m_prismMapView;
714 }
715 else if constexpr (std::is_same_v<T, PyrGeom>)
716 {
717 return m_pyrMapView;
718 }
719 else if constexpr (std::is_same_v<T, HexGeom>)
720 {
721 return m_hexMapView;
722 }
723
724 ASSERTL0(false,
725 "MeshGraph does not support the supplied geometry type.");
726 }
727
728 SPATIAL_DOMAINS_EXPORT std::unordered_map<int, GeometryLinkSharedPtr> &
730 {
731 return m_faceToElMap;
732 }
733
734 SPATIAL_DOMAINS_EXPORT std::vector<PointGeomUniquePtr> &GetAllCurveNodes()
735 {
736 return m_nodeSet;
737 }
738
740
742 {
743 auto it1 = m_triGeoms.find(gID);
744 if (it1 != m_triGeoms.end())
745 {
746 return it1->second.get();
747 }
748
749 auto it2 = m_quadGeoms.find(gID);
750 if (it2 != m_quadGeoms.end())
751 {
752 return it2->second.get();
753 }
754
755 return nullptr;
756 };
757
760
763
765
770
772 {
773 m_compOrder = p_compOrder;
774 }
775
780
782 {
783 m_bndRegOrder = p_bndRegOrder;
784 }
785
786 SPATIAL_DOMAINS_EXPORT std::map<int, MeshEntity> CreateMeshEntities();
788
793
794 void Clear();
795
796 void PopulateFaceToElMap(Geometry3D *element, int kNfaces);
797
798 void SetMeshPartitioned(bool meshPartitioned)
799 {
800 m_meshPartitioned = meshPartitioned;
801 }
802
803private:
804 /**
805 * @brief Helper function for geometry lookups
806 */
807 template <typename T> T *GetGeom(int id, GeomMap<T> &geomMap)
808 {
809 auto it = geomMap.find(id);
810 ASSERTL0(it != geomMap.end(),
811 "Unable to find geometry with ID " + std::to_string(id));
812 return it->second.get();
813 }
814
815protected:
817 std::string GetCompositeString(CompositeSharedPtr comp);
818
820
823
832
841
842 /// Vector of all unique curve nodes, not including vertices
843 std::vector<PointGeomUniquePtr> m_nodeSet;
844
848 bool m_meshPartitioned = false;
850
851 // Refinement attributes (class members)
852 /// Link the refinement id with the composites
853 std::map<int, CompositeMap> m_refComposite;
854 // std::map<int, LibUtilities::BasisKeyVector> m_refBasis;
855 /// Link the refinement id with the surface region data
856 std::map<int, RefRegion *> m_refRegion;
857 bool m_refFlag = false;
858
860 std::map<int, std::string> m_compositesLabels;
861 std::map<int, CompositeMap> m_domain;
863
865
866 std::unordered_map<int, GeometryLinkSharedPtr> m_faceToElMap;
867
868 TiXmlElement *m_xmlGeom;
869
872
873 struct GeomRTree;
874 std::unique_ptr<GeomRTree> m_boundingBoxTree;
876};
877
878typedef std::shared_ptr<MeshGraph> MeshGraphSharedPtr;
880
882
883/**
884 *
885 */
886void MeshGraph::SetExpansionInfo(const std::string variable,
888{
889 if (m_expansionMapShPtrMap.count(variable) != 0)
890 {
891 ASSERTL0(
892 false,
893 (std::string("ExpansionInfo field is already set for variable ") +
894 variable)
895 .c_str());
896 }
897 else
898 {
899 m_expansionMapShPtrMap[variable] = exp;
900 }
901}
902
903/**
904 *
905 */
910
911/**
912 *
913 */
914inline bool MeshGraph::SameExpansionInfo(const std::string var1,
915 const std::string var2)
916{
917 ExpansionInfoMapShPtr expVec1 = m_expansionMapShPtrMap.find(var1)->second;
918 ExpansionInfoMapShPtr expVec2 = m_expansionMapShPtrMap.find(var2)->second;
919
920 if (expVec1.get() == expVec2.get())
921 {
922 return true;
923 }
924
925 return false;
926}
927
928/**
929 *
930 */
931inline bool MeshGraph::ExpansionInfoDefined(const std::string var)
932{
933 return m_expansionMapShPtrMap.count(var);
934}
935
936} // namespace SpatialDomains
937
938} // namespace Nektar
939
940#endif
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define SPATIAL_DOMAINS_EXPORT
Provides a generic Factory class.
Generic object pool allocator/deallocator.
static std::unique_ptr< DataType, UniquePtrDeleter > AllocateUniquePtr(const Args &...args)
std::vector< QuadGeomUniquePtr > m_quadVec
Definition MeshGraph.h:115
std::vector< PrismGeomUniquePtr > m_prismVec
Definition MeshGraph.h:118
std::vector< PyrGeomUniquePtr > m_pyrVec
Definition MeshGraph.h:117
std::vector< HexGeomUniquePtr > m_hexVec
Definition MeshGraph.h:119
std::vector< PointGeomUniquePtr > m_pointVec
Definition MeshGraph.h:112
std::vector< SegGeomUniquePtr > m_segVec
Definition MeshGraph.h:113
std::vector< TriGeomUniquePtr > m_triVec
Definition MeshGraph.h:114
std::vector< TetGeomUniquePtr > m_tetVec
Definition MeshGraph.h:116
bool operator==(const Iterator &other) const
Definition MeshGraph.h:249
Iterator(typename GeomMap< T >::const_iterator it)
Definition MeshGraph.h:232
bool operator!=(const Iterator &other) const
Definition MeshGraph.h:245
GeomMap< T >::const_iterator m_it
Definition MeshGraph.h:227
Iterator find(int id) const
Definition MeshGraph.h:273
GeomMapView(const GeomMap< T > &map)
Definition MeshGraph.h:255
1D geometry information
Definition Geometry1D.h:49
2D geometry information
Definition Geometry2D.h:50
3D geometry information
Definition Geometry3D.h:50
Base class for shape geometry information.
Definition Geometry.h:74
Base class for a spectral/hp element mesh.
Definition MeshGraph.h:290
PyrGeom * CreatePyrGeom(int id, std::array< Geometry2D *, PyrGeom::kNfaces > faces)
Definition MeshGraph.h:670
GeomMapView< SegGeom > m_segMapView
Definition MeshGraph.h:834
void SetDomainRange(NekDouble xmin, NekDouble xmax, NekDouble ymin=NekConstants::kNekUnsetDouble, NekDouble ymax=NekConstants::kNekUnsetDouble, NekDouble zmin=NekConstants::kNekUnsetDouble, NekDouble zmax=NekConstants::kNekUnsetDouble)
GeomMapView< TriGeom > m_triMapView
Definition MeshGraph.h:835
TriGeom * GetTriGeom(int id)
Returns triangle id from the MeshGraph.
Definition MeshGraph.h:506
GeomMapView< QuadGeom > m_quadMapView
Definition MeshGraph.h:836
static LibUtilities::BasisKeyVector DefineBasisKeyFromExpansionType(Geometry *in, ExpansionType type, const int order)
bool CheckRange(Geometry2D &geom)
Check if goemetry is in range definition if activated.
std::map< int, RefRegion * > m_refRegion
Link the refinement id with the surface region data.
Definition MeshGraph.h:856
void SetCompositeOrdering(CompositeOrdering p_compOrder)
Definition MeshGraph.h:771
int GetMeshDimension()
Dimension of the mesh (can be a 1D curve in 3D space).
Definition MeshGraph.h:317
std::vector< PointGeomUniquePtr > & GetAllCurveNodes()
Definition MeshGraph.h:734
const std::string GetGeomInfo(std::string parameter)
PointGeom * GetVertex(int id)
Returns vertex id from the MeshGraph.
Definition MeshGraph.h:481
GeometryLinkSharedPtr GetElementsFromFace(Geometry2D *face)
void SetRefinementInfo(ExpansionInfoMapShPtr &expansionMap)
This function sets the expansion #exp in map with entry #variable.
std::map< int, std::map< int, CompositeSharedPtr > > & GetDomain()
Definition MeshGraph.h:383
GeomMapView< HexGeom > m_hexMapView
Definition MeshGraph.h:840
void PopulateFaceToElMap(Geometry3D *element, int kNfaces)
Given a 3D geometry object #element, populate the face to element map m_faceToElMap which maps faces ...
PrismGeom * CreatePrismGeom(int id, std::array< Geometry2D *, PrismGeom::kNfaces > faces)
Definition MeshGraph.h:661
Geometry * GetCompositeItem(int whichComposite, int whichItem)
void SetExpansionInfoToEvenlySpacedPoints(int npoints=0)
Sets expansions to have equispaced points.
HexGeom * CreateHexGeom(int id, std::array< QuadGeom *, HexGeom::kNfaces > faces)
Definition MeshGraph.h:652
GeometryLinkSharedPtr GetElementsFromEdge(Geometry1D *edge)
std::map< int, CompositeSharedPtr > & GetComposites()
Definition MeshGraph.h:373
TriGeom * CreateTriGeom(int id, std::array< SegGeom *, TriGeom::kNedges > edges, const CurveSharedPtr curve=CurveSharedPtr())
Definition MeshGraph.h:632
std::unordered_map< int, GeometryLinkSharedPtr > & GetAllFaceToElMap()
Definition MeshGraph.h:729
PrismGeom * GetPrismGeom(int id)
Returns prism id from the MeshGraph.
Definition MeshGraph.h:538
LibUtilities::SessionReaderSharedPtr m_session
Definition MeshGraph.h:819
LibUtilities::DomainRangeShPtr & GetDomainRange()
Definition MeshGraph.h:395
SegGeom * GetSegGeom(int id)
Returns segment id from the MeshGraph.
Definition MeshGraph.h:498
std::map< int, CompositeMap > m_domain
Definition MeshGraph.h:861
void SetPartition(SpatialDomains::MeshGraphSharedPtr graph)
std::unique_ptr< GeomRTree > m_boundingBoxTree
Definition MeshGraph.h:874
ExpansionInfoMapShPtr SetUpExpansionInfoMap()
std::map< int, CompositeSharedPtr > & GetDomain(int domain)
Definition MeshGraph.h:388
void SetExpansionInfoToPointOrder(int npts)
Reset expansion to have specified point order npts.
bool SameExpansionInfo(const std::string var1, const std::string var2)
Definition MeshGraph.h:914
void AddGeom(int id, unique_ptr_objpool< T > geom)
Convenience function to add a geometry geom to the MeshGraph with geometry ID id. Retains ownership o...
Definition MeshGraph.h:558
PointGeom * CreatePointGeom(const int coordim, const int vid, NekDouble x, NekDouble y, NekDouble z)
Definition MeshGraph.h:598
std::map< int, CompositeMap > m_refComposite
Link the refinement id with the composites.
Definition MeshGraph.h:853
bool ExpansionInfoDefined(const std::string var)
Definition MeshGraph.h:931
GeomMapView< TetGeom > m_tetMapView
Definition MeshGraph.h:837
SegGeom * CreateSegGeom(int id, int coordim, std::array< PointGeom *, SegGeom::kNverts > vertex, const CurveSharedPtr curve=CurveSharedPtr())
Definition MeshGraph.h:610
GeomMapView< PointGeom > m_pointMapView
Definition MeshGraph.h:833
void SetMeshPartitioned(bool meshPartitioned)
Definition MeshGraph.h:798
void GetCompositeList(const std::string &compositeStr, CompositeMap &compositeVector) const
void PRefinementElmts(ExpansionInfoMapShPtr &expansionMap, RefRegion *&region, Geometry *geomVecIter)
Perform the p-refinement in the selected elements.
std::vector< int > GetElementsContainingPoint(PointGeom *p)
void Empty(int dim, int space)
Definition MeshGraph.h:295
GeomMap< PyrGeom > m_pyrGeoms
Definition MeshGraph.h:829
HexGeom * GetHexGeom(int id)
Returns hex id from the MeshGraph.
Definition MeshGraph.h:546
QuadGeom * CreateQuadGeom(int id, std::array< SegGeom *, QuadGeom::kNedges > edges, const CurveSharedPtr curve=CurveSharedPtr())
Definition MeshGraph.h:621
GeomMapView< PyrGeom > m_pyrMapView
Definition MeshGraph.h:838
const ExpansionInfoMap & GetExpansionInfo(const std::string variable="DefaultVar")
ExpansionInfoMapShPtrMap m_expansionMapShPtrMap
Definition MeshGraph.h:864
GeomMap< SegGeom > m_segGeoms
Definition MeshGraph.h:825
int GetSpaceDimension()
Dimension of the space (can be a 1D curve in 3D space).
Definition MeshGraph.h:323
PyrGeom * GetPyrGeom(int id)
Returns pyramid id from the MeshGraph.
Definition MeshGraph.h:530
BndRegionOrdering & GetBndRegionOrdering()
Definition MeshGraph.h:776
std::string GetCompositeString(CompositeSharedPtr comp)
Returns a string representation of a composite.
T * GetGeom(int id, GeomMap< T > &geomMap)
Helper function for geometry lookups.
Definition MeshGraph.h:807
void ResetExpansionInfoToBasisKey(ExpansionInfoMapShPtr &expansionMap, LibUtilities::ShapeType shape, LibUtilities::BasisKeyVector &keys)
std::vector< PointGeomUniquePtr > m_nodeSet
Vector of all unique curve nodes, not including vertices.
Definition MeshGraph.h:843
GeomMap< PointGeom > m_pointGeoms
Definition MeshGraph.h:824
void SetExpansionInfoToNumModes(int nmodes)
Reset expansion to have specified polynomial order nmodes.
LibUtilities::BasisKeyVector DefineBasisKeyFromExpansionTypeHomo(Geometry *in, ExpansionType type_x, ExpansionType type_y, ExpansionType type_z, const int nummodes_x, const int nummodes_y, const int nummodes_z)
std::unordered_map< int, GeometryLinkSharedPtr > m_faceToElMap
Definition MeshGraph.h:866
MovementSharedPtr & GetMovement()
Definition MeshGraph.h:789
CompositeSharedPtr GetComposite(int whichComposite)
Definition MeshGraph.h:359
GeomMap< TriGeom > m_triGeoms
Definition MeshGraph.h:826
PointGeom * GetPointGeom(int id)
Returns vertex id from the MeshGraph.
Definition MeshGraph.h:490
void SetExpansionInfo(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Sets expansions given field definitions.
void SetBndRegionOrdering(BndRegionOrdering p_bndRegOrder)
Definition MeshGraph.h:781
CompositeOrdering & GetCompositeOrdering()
Definition MeshGraph.h:766
std::map< int, MeshEntity > CreateMeshEntities()
Create mesh entities for this graph.
GeomMapView< PrismGeom > m_prismMapView
Definition MeshGraph.h:839
bool CheckForGeomInfo(std::string parameter)
GeomMap< QuadGeom > m_quadGeoms
Definition MeshGraph.h:827
CompositeDescriptor CreateCompositeDescriptor()
TetGeom * CreateTetGeom(int id, std::array< TriGeom *, TetGeom::kNfaces > faces)
Definition MeshGraph.h:643
GeomMap< HexGeom > m_hexGeoms
Definition MeshGraph.h:831
void ReadRefinementInfo()
Read refinement info.
void SetBasisKey(LibUtilities::ShapeType shape, LibUtilities::BasisKeyVector &keys, std::string var="DefaultVar")
Sets the basis key for all expansions of the given shape.
std::map< int, std::string > m_compositesLabels
Definition MeshGraph.h:860
GeomMap< TetGeom > m_tetGeoms
Definition MeshGraph.h:828
QuadGeom * GetQuadGeom(int id)
Returns quadrilateral id from the MeshGraph.
Definition MeshGraph.h:514
std::map< int, std::string > & GetCompositesLabels()
Definition MeshGraph.h:378
GeomMapView< T > & GetGeomMap()
Definition MeshGraph.h:689
void SetSession(LibUtilities::SessionReaderSharedPtr pSession)
Definition MeshGraph.h:906
Geometry2D * GetGeometry2D(int gID)
Definition MeshGraph.h:741
GeomMap< PrismGeom > m_prismGeoms
Definition MeshGraph.h:830
LibUtilities::DomainRangeShPtr m_domainRange
Definition MeshGraph.h:862
TetGeom * GetTetGeom(int id)
Returns tetrahedron id from the MeshGraph.
Definition MeshGraph.h:522
BndRegionOrdering m_bndRegOrder
Definition MeshGraph.h:871
Abstract base class for the refinement surface region.
Definition RefRegion.h:51
std::vector< BasisKey > BasisKeyVector
Name for a vector of BasisKeys.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< DomainRange > DomainRangeShPtr
Definition DomainRange.h:69
static const NekDouble kNekUnsetDouble
std::map< int, unique_ptr_objpool< T > > GeomMap
Definition MeshGraph.h:90
unique_ptr_objpool< HexGeom > HexGeomUniquePtr
Definition MeshGraph.h:104
std::shared_ptr< std::vector< std::pair< Geometry *, int > > > GeometryLinkSharedPtr
Definition MeshGraph.h:209
std::map< std::string, std::string > GeomInfoMap
Definition MeshGraph.h:207
std::map< int, std::vector< unsigned int > > CompositeOrdering
Definition MeshGraph.h:170
unique_ptr_objpool< Geometry3D > Geometry3DUniquePtr
Definition MeshGraph.h:106
std::map< int, std::pair< LibUtilities::ShapeType, std::vector< int > > > CompositeDescriptor
Definition MeshGraph.h:124
std::map< int, std::vector< unsigned int > > BndRegionOrdering
Definition MeshGraph.h:171
unique_ptr_objpool< QuadGeom > QuadGeomUniquePtr
Definition MeshGraph.h:100
std::shared_ptr< Composite > CompositeSharedPtr
Definition MeshGraph.h:178
std::shared_ptr< ExpansionInfoMap > ExpansionInfoMapShPtr
Definition MeshGraph.h:186
std::shared_ptr< Movement > MovementSharedPtr
Definition MeshGraph.h:220
std::shared_ptr< Curve > CurveSharedPtr
Definition Curve.hpp:60
unique_ptr_objpool< PyrGeom > PyrGeomUniquePtr
Definition MeshGraph.h:102
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition Curve.hpp:61
LibUtilities::NekFactory< std::string, MeshGraph > MeshGraphFactory
Definition MeshGraph.h:879
unique_ptr_objpool< PrismGeom > PrismGeomUniquePtr
Definition MeshGraph.h:103
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
Definition MeshGraph.h:183
const std::string kExpansionTypeStr[]
Definition MeshGraph.h:151
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:217
std::map< std::string, std::string > MeshMetaDataMap
Definition MeshGraph.h:214
unique_ptr_objpool< Geometry2D > Geometry2DUniquePtr
Definition MeshGraph.h:105
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition MeshGraph.h:95
unique_ptr_objpool< SegGeom > SegGeomUniquePtr
Definition MeshGraph.h:98
unique_ptr_objpool< PointGeom > PointGeomUniquePtr
Definition MeshGraph.h:93
MeshGraphFactory & GetMeshGraphFactory()
Definition MeshGraph.cpp:86
unique_ptr_objpool< TriGeom > TriGeomUniquePtr
Definition MeshGraph.h:99
std::map< std::string, ExpansionInfoMapShPtr > ExpansionInfoMapShPtrMap
Definition MeshGraph.h:187
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition MeshGraph.h:184
unique_ptr_objpool< TetGeom > TetGeomUniquePtr
Definition MeshGraph.h:101
std::map< int, CompositeSharedPtr > CompositeMap
Definition MeshGraph.h:179
boost::fast_pool_allocator< DataType, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex > PoolAllocator
std::unique_ptr< T, typename ObjPoolManager< T >::UniquePtrDeleter > unique_ptr_objpool
std::vector< Geometry * > m_geomVec
Definition MeshGraph.h:175
ExpansionInfo(Geometry *geomPtr, const LibUtilities::BasisKeyVector basiskeyvec)
Definition MeshGraph.h:191
LibUtilities::BasisKeyVector m_basisKeyVector
Definition MeshGraph.h:204
ExpansionInfo(ExpansionInfoShPtr ExpInfo)
Definition MeshGraph.h:197