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 <>
86template <>
89template <>
92
93namespace SpatialDomains
94{
95
96template <typename T> using GeomMap = std::map<int, unique_ptr_objpool<T>>;
97
98// Point geom type defs
100
101// Geometry typedefs
113
114// Minimal owner of Geom objects not owned by a MeshGraph.
116{
117public:
118 std::vector<PointGeomUniquePtr> m_pointVec;
119 std::vector<SegGeomUniquePtr> m_segVec;
120 std::vector<TriGeomUniquePtr> m_triVec;
121 std::vector<QuadGeomUniquePtr> m_quadVec;
122 std::vector<TetGeomUniquePtr> m_tetVec;
123 std::vector<PyrGeomUniquePtr> m_pyrVec;
124 std::vector<PrismGeomUniquePtr> m_prismVec;
125 std::vector<HexGeomUniquePtr> m_hexVec;
126 std::vector<CurveUniquePtr> m_curveVec;
127};
128
129// Composite type def
130typedef std::map<int, std::pair<LibUtilities::ShapeType, std::vector<int>>>
132
155
156// Keep this consistent with the enums in ExpansionType.
157// This is used in the BC file to specify the expansion type.
158const std::string kExpansionTypeStr[] = {"NOTYPE",
159 "MODIFIED",
160 "MODIFIEDQUADPLUS1",
161 "MODIFIEDQUADPLUS2",
162 "MODIFIEDGLLRADAU10",
163 "ORTHOGONAL",
164 "GLL_LAGRANGE",
165 "GLL_LAGRANGE_SEM",
166 "GAUSS_LAGRANGE",
167 "GAUSS_LAGRANGE_SEM",
168 "FOURIER",
169 "FOURIERSINGLEMODE",
170 "FOURIERHALFMODERE",
171 "FOURIERHALFMODEIM",
172 "CHEBYSHEV",
173 "FOURIER-CHEBYSHEV",
174 "CHEBYSHEV-FOURIER",
175 "FOURIER-MODIFIED"};
176
177typedef std::map<int, std::vector<unsigned int>> CompositeOrdering;
178typedef std::map<int, std::vector<unsigned int>> BndRegionOrdering;
179
181{
182 std::vector<Geometry *> m_geomVec;
183};
184
185typedef std::shared_ptr<Composite> CompositeSharedPtr;
186typedef std::map<int, CompositeSharedPtr> CompositeMap;
187
188struct ExpansionInfo;
189
190typedef std::shared_ptr<ExpansionInfo> ExpansionInfoShPtr;
191typedef std::map<int, ExpansionInfoShPtr> ExpansionInfoMap;
192
193typedef std::shared_ptr<ExpansionInfoMap> ExpansionInfoMapShPtr;
194typedef std::map<std::string, ExpansionInfoMapShPtr> ExpansionInfoMapShPtrMap;
195
197{
199 const LibUtilities::BasisKeyVector basiskeyvec)
200 : m_geomPtr(geomPtr), m_basisKeyVector(basiskeyvec)
201 {
202 }
203
205 : m_geomPtr(ExpInfo->m_geomPtr),
207 {
208 }
209
212};
213
214typedef std::map<std::string, std::string> GeomInfoMap;
215typedef std::shared_ptr<std::vector<std::pair<Geometry *, int>>>
217
218// Forward declaration
219class RefRegion;
220
221typedef std::map<std::string, std::string> MeshMetaDataMap;
222
223class MeshGraph;
224typedef std::shared_ptr<MeshGraph> MeshGraphSharedPtr;
225
226class Movement;
227typedef std::shared_ptr<Movement> MovementSharedPtr;
228
229template <typename T> class GeomMapView
230{
231public:
233 {
234 using value_type = std::pair<int, T *>;
237
238 public:
239 explicit Iterator(typename GeomMap<T>::const_iterator it) : m_it(it)
240 {
241 }
242
243 const value_type &operator*() const
244 {
245 m_cache = {m_it->first, m_it->second.get()};
246 return m_cache;
247 }
248 const value_type *operator->() const
249 {
250 m_cache = {m_it->first, m_it->second.get()};
251 return &m_cache;
252 }
253
255 {
256 ++m_it;
257 return *this;
258 }
259 bool operator!=(const Iterator &other) const
260 {
261 return m_it != other.m_it;
262 }
263 bool operator==(const Iterator &other) const
264 {
265 return m_it == other.m_it;
266 }
267 };
268
270 {
271 using value_type = std::pair<int, T *>;
274
275 public:
277 : m_it(it)
278 {
279 }
280
281 const value_type &operator*() const
282 {
283 m_cache = {m_it->first, m_it->second.get()};
284 return m_cache;
285 }
286 const value_type *operator->() const
287 {
288 m_cache = {m_it->first, m_it->second.get()};
289 return &m_cache;
290 }
291
293 {
294 ++m_it;
295 return *this;
296 }
297
298 bool operator!=(const ReverseIterator &other) const
299 {
300 return m_it != other.m_it;
301 }
302
303 bool operator==(const ReverseIterator &other) const
304 {
305 return m_it == other.m_it;
306 }
307 };
308
309 explicit GeomMapView(const GeomMap<T> &map) : m_map(map)
310 {
311 }
312
314 {
315 return Iterator(m_map.begin());
316 }
317 Iterator end() const
318 {
319 return Iterator(m_map.end());
320 }
321
323 {
324 return ReverseIterator(m_map.rbegin());
325 }
327 {
328 return ReverseIterator(m_map.rend());
329 }
330
331 std::size_t size() const
332 {
333 return m_map.size();
334 }
335
336 Iterator find(int id) const
337 {
338 return Iterator(m_map.find(id));
339 }
340
341 T *at(int id) const
342 {
343 auto it = m_map.find(id);
344 return it != m_map.end() ? it->second.get() : nullptr;
345 }
346
347private:
349};
350
351/// Base class for a spectral/hp element mesh.
353{
354public:
357
358 void Empty(int dim, int space)
359 {
360 m_meshDimension = dim;
361 m_spaceDimension = space;
362 }
363
364 /*transfers the minial data structure to full meshgraph*/
366
368
370 PointGeom *p);
371
372 ////////////////////
373 SPATIAL_DOMAINS_EXPORT void ReadExpansionInfo(TiXmlElement *expansionTypes);
374
375 /// Read refinement info.
377
378 /* ---- Helper functions ---- */
379 /// Dimension of the mesh (can be a 1D curve in 3D space).
381 {
382 return m_meshDimension;
383 }
384
385 /// Dimension of the space (can be a 1D curve in 3D space).
387 {
388 return m_spaceDimension;
389 }
390
391 void SetMeshDimension(int dim)
392 {
393 m_meshDimension = dim;
394 }
395
396 void SetSpaceDimension(int dim)
397 {
398 m_spaceDimension = dim;
399 }
400
401 /* Range definitions for postprorcessing */
403 NekDouble xmin, NekDouble xmax,
408
411
412 /// Check if goemetry is in range definition if activated
414
415 /// Check if goemetry is in range definition if activated
417
418 /// Check if goemetry is in range definition if activated
420
421 /* ---- Composites and Domain ---- */
423 {
424 if (m_meshComposites.find(whichComposite) == m_meshComposites.end())
425 {
426 NEKERROR(ErrorUtil::efatal, "Composite not found.");
427 }
428 return m_meshComposites.find(whichComposite)->second;
429 }
430
432 int whichItem);
433
435 const std::string &compositeStr, CompositeMap &compositeVector) const;
436
437 std::map<int, CompositeSharedPtr> &GetComposites()
438 {
439 return m_meshComposites;
440 }
441
442 std::map<int, std::string> &GetCompositesLabels()
443 {
444 return m_compositesLabels;
445 }
446
447 std::map<int, std::map<int, CompositeSharedPtr>> &GetDomain()
448 {
449 return m_domain;
450 }
451
452 std::map<int, CompositeSharedPtr> &GetDomain(int domain)
453 {
454 ASSERTL1(m_domain.count(domain),
455 "Request for domain which does not exist");
456 return m_domain[domain];
457 }
458
463
465 const std::string variable = "DefaultVar");
466
468 GetExpansionInfo(Geometry *geom, const std::string variable = "DefaultVar");
469
470 /// Sets expansions given field definitions
472 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
473
474 /// Sets expansions given field definition, quadrature points.
476 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
477 std::vector<std::vector<LibUtilities::PointsType>> &pointstype);
478
479 /// Sets expansions to have equispaced points
481 int npoints = 0);
482
483 /// Reset expansion to have specified polynomial order \a nmodes
485
486 /// Reset expansion to have specified point order \a
487 /// npts
489 /// This function sets the expansion #exp in map with
490 /// entry #variable
491
492 /// Set refinement info.
494 ExpansionInfoMapShPtr &expansionMap);
495
496 /// Perform the p-refinement in the selected elements
498 ExpansionInfoMapShPtr &expansionMap, RefRegion *&region,
499 Geometry *geomVecIter);
500
501 inline void SetExpansionInfo(const std::string variable,
503
505
510
511 /// Sets the basis key for all expansions of the given shape.
514 std::string var = "DefaultVar");
515
519
520 inline bool SameExpansionInfo(const std::string var1,
521 const std::string var2);
522
523 inline bool ExpansionInfoDefined(const std::string var);
524
525 inline bool CheckForGeomInfo(std::string parameter);
526
527 inline const std::string GetGeomInfo(std::string parameter);
528
531 const int order);
532
535 ExpansionType type_y,
536 ExpansionType type_z,
537 const int nummodes_x,
538 const int nummodes_y,
539 const int nummodes_z);
540
541 /* ---- Manipulation of mesh ---- */
543 {
544 return m_pointGeoms.size();
545 }
546
547 /**
548 * @brief Returns vertex @p id from the MeshGraph.
549 */
550 [[deprecated("since 5.8.0, use GetPointGeom() instead")]] PointGeom *GetVertex(
551 int id)
552 {
553 return this->GetGeom(id, m_pointGeoms);
554 }
555
556 /**
557 * @brief Returns vertex @p id from the MeshGraph.
558 */
560 {
561 return this->GetGeom(id, m_pointGeoms);
562 }
563
564 /**
565 * @brief Returns segment @p id from the MeshGraph.
566 */
568 {
569 return this->GetGeom(id, m_segGeoms);
570 }
571
572 /**
573 * @brief Returns triangle @p id from the MeshGraph.
574 */
576 {
577 return this->GetGeom(id, m_triGeoms);
578 }
579
580 /**
581 * @brief Returns quadrilateral @p id from the MeshGraph.
582 */
584 {
585 return this->GetGeom(id, m_quadGeoms);
586 }
587
588 /**
589 * @brief Returns tetrahedron @p id from the MeshGraph.
590 */
592 {
593 return this->GetGeom(id, m_tetGeoms);
594 }
595
596 /**
597 * @brief Returns pyramid @p id from the MeshGraph.
598 */
600 {
601 return this->GetGeom(id, m_pyrGeoms);
602 }
603
604 /**
605 * @brief Returns prism @p id from the MeshGraph.
606 */
608 {
609 return this->GetGeom(id, m_prismGeoms);
610 }
611
612 /**
613 * @brief Returns hex @p id from the MeshGraph.
614 */
616 {
617 return this->GetGeom(id, m_hexGeoms);
618 }
619
620 /**
621 * @brief Convenience function to add a geometry @p geom to the MeshGraph
622 * with geometry ID @p id. Retains ownership of the passed unique_ptr.
623 *
624 * @p id Geometry ID
625 * @p geom unique_ptr to geometry object.
626 */
627 template <typename T> void AddGeom(int id, unique_ptr_objpool<T> geom)
628 {
629 ASSERTL2(geom->GetGlobalID() == id,
630 "Mismatch between geometry ID and global ID");
631
632 if constexpr (std::is_same_v<T, PointGeom>)
633 {
634 m_pointGeoms.insert(std::make_pair(id, std::move(geom)));
635 }
636 else if constexpr (std::is_same_v<T, SegGeom>)
637 {
638 m_segGeoms.insert(std::make_pair(id, std::move(geom)));
639 }
640 else if constexpr (std::is_same_v<T, QuadGeom>)
641 {
642 m_quadGeoms.insert(std::make_pair(id, std::move(geom)));
643 }
644 else if constexpr (std::is_same_v<T, TriGeom>)
645 {
646 m_triGeoms.insert(std::make_pair(id, std::move(geom)));
647 }
648 else if constexpr (std::is_same_v<T, TetGeom>)
649 {
650 m_tetGeoms.insert(std::make_pair(id, std::move(geom)));
651 }
652 else if constexpr (std::is_same_v<T, PyrGeom>)
653 {
654 m_pyrGeoms.insert(std::make_pair(id, std::move(geom)));
655 }
656 else if constexpr (std::is_same_v<T, PrismGeom>)
657 {
658 m_prismGeoms.insert(std::make_pair(id, std::move(geom)));
659 }
660 else if constexpr (std::is_same_v<T, HexGeom>)
661 {
662 m_hexGeoms.insert(std::make_pair(id, std::move(geom)));
663 }
664 else
665 {
666 ASSERTL0(false, "Unknown geometry type");
667 }
668 }
669
671 const int vid,
672 NekDouble x, NekDouble y,
673 NekDouble z)
674 {
675 auto geom =
677 auto ret = geom.get();
678 AddGeom(vid, std::move(geom));
679 return ret;
680 }
681
683 int id, int coordim, std::array<PointGeom *, SegGeom::kNverts> vertex,
684 Curve *curve = nullptr)
685 {
686 auto geom = ObjPoolManager<SegGeom>::AllocateUniquePtr(id, coordim,
687 vertex, curve);
688 auto ret = geom.get();
689 AddGeom(id, std::move(geom));
690 return ret;
691 }
692
694 int id, std::array<SegGeom *, QuadGeom::kNedges> edges,
695 Curve *curve = nullptr)
696 {
697 auto geom =
699 auto ret = geom.get();
700 AddGeom(id, std::move(geom));
701 return ret;
702 }
703
705 int id, std::array<SegGeom *, TriGeom::kNedges> edges,
706 Curve *curve = nullptr)
707 {
708 auto geom =
710 auto ret = geom.get();
711 AddGeom(id, std::move(geom));
712 return ret;
713 }
714
716 int id, std::array<TriGeom *, TetGeom::kNfaces> faces)
717 {
718 auto geom = ObjPoolManager<TetGeom>::AllocateUniquePtr(id, faces);
719 auto ret = geom.get();
720 AddGeom(id, std::move(geom));
721 return ret;
722 }
723
725 int id, std::array<QuadGeom *, HexGeom::kNfaces> faces)
726 {
727 auto geom = ObjPoolManager<HexGeom>::AllocateUniquePtr(id, faces);
728 auto ret = geom.get();
729 AddGeom(id, std::move(geom));
730 return ret;
731 }
732
734 int id, std::array<Geometry2D *, PrismGeom::kNfaces> faces)
735 {
737 auto ret = geom.get();
738 AddGeom(id, std::move(geom));
739 return ret;
740 }
741
743 int id, std::array<Geometry2D *, PyrGeom::kNfaces> faces)
744 {
745 auto geom = ObjPoolManager<PyrGeom>::AllocateUniquePtr(id, faces);
746 auto ret = geom.get();
747 AddGeom(id, std::move(geom));
748 return ret;
749 }
750
755
760
761 template <typename T> GeomMapView<T> &GetGeomMap()
762 {
763 if constexpr (std::is_same_v<T, PointGeom>)
764 {
765 return m_pointMapView;
766 }
767 else if constexpr (std::is_same_v<T, SegGeom>)
768 {
769 return m_segMapView;
770 }
771 else if constexpr (std::is_same_v<T, TriGeom>)
772 {
773 return m_triMapView;
774 }
775 else if constexpr (std::is_same_v<T, QuadGeom>)
776 {
777 return m_quadMapView;
778 }
779 else if constexpr (std::is_same_v<T, TetGeom>)
780 {
781 return m_tetMapView;
782 }
783 else if constexpr (std::is_same_v<T, PrismGeom>)
784 {
785 return m_prismMapView;
786 }
787 else if constexpr (std::is_same_v<T, PyrGeom>)
788 {
789 return m_pyrMapView;
790 }
791 else if constexpr (std::is_same_v<T, HexGeom>)
792 {
793 return m_hexMapView;
794 }
795
796 ASSERTL0(false,
797 "MeshGraph does not support the supplied geometry type.");
798 }
799
800 SPATIAL_DOMAINS_EXPORT std::unordered_map<int, GeometryLinkSharedPtr> &
802 {
803 return m_faceToElMap;
804 }
805
806 SPATIAL_DOMAINS_EXPORT std::vector<PointGeomUniquePtr> &GetAllCurveNodes()
807 {
808 return m_nodeSet;
809 }
810
812
814 {
815 auto it1 = m_triGeoms.find(gID);
816 if (it1 != m_triGeoms.end())
817 {
818 return it1->second.get();
819 }
820
821 auto it2 = m_quadGeoms.find(gID);
822 if (it2 != m_quadGeoms.end())
823 {
824 return it2->second.get();
825 }
826
827 return nullptr;
828 };
829
832
835
837
842
844 {
845 m_compOrder = p_compOrder;
846 }
847
852
854 {
855 m_bndRegOrder = p_bndRegOrder;
856 }
857
858 SPATIAL_DOMAINS_EXPORT std::map<int, MeshEntity> CreateMeshEntities();
860
865
867
869 int kNfaces);
870
872 {
873 return m_meshPartitioned;
874 }
875
876 void SetMeshPartitioned(bool meshPartitioned)
877 {
878 m_meshPartitioned = meshPartitioned;
879 }
880
882 {
883 return m_partition;
884 }
885
886 void SetPartitionNumber(int partition)
887 {
888 m_partition = partition;
889 }
890
895
896private:
897 /**
898 * @brief Helper function for geometry lookups
899 */
900 template <typename T> T *GetGeom(int id, GeomMap<T> &geomMap)
901 {
902 auto it = geomMap.find(id);
903 ASSERTL0(it != geomMap.end(),
904 "Unable to find geometry with ID " + std::to_string(id));
905 return it->second.get();
906 }
907
908protected:
910 std::string GetCompositeString(CompositeSharedPtr comp);
911
913
916
925
934
935 /// Vector of all unique curve nodes, not including vertices
936 std::vector<PointGeomUniquePtr> m_nodeSet;
937
941 bool m_meshPartitioned = false;
943
944 // Refinement attributes (class members)
945 /// Link the refinement id with the composites
946 std::map<int, CompositeMap> m_refComposite;
947 // std::map<int, LibUtilities::BasisKeyVector> m_refBasis;
948 /// Link the refinement id with the surface region data
949 std::map<int, RefRegion *> m_refRegion;
950 bool m_refFlag = false;
951
953 std::map<int, std::string> m_compositesLabels;
954 std::map<int, CompositeMap> m_domain;
956
958
959 std::unordered_map<int, GeometryLinkSharedPtr> m_faceToElMap;
960
961 TiXmlElement *m_xmlGeom;
962
965
966 struct GeomRTree;
967 std::unique_ptr<GeomRTree> m_boundingBoxTree;
969};
970
971typedef std::shared_ptr<MeshGraph> MeshGraphSharedPtr;
973
975
976/**
977 *
978 */
979void MeshGraph::SetExpansionInfo(const std::string variable,
981{
982 if (m_expansionMapShPtrMap.count(variable) != 0)
983 {
984 NEKERROR(
986 (std::string("ExpansionInfo field is already set for variable ") +
987 variable)
988 .c_str());
989 }
990 else
991 {
992 m_expansionMapShPtrMap[variable] = exp;
993 }
994}
995
996/**
997 *
998 */
1000{
1001 m_session = pSession;
1002}
1003
1004/**
1005 *
1006 */
1007inline bool MeshGraph::SameExpansionInfo(const std::string var1,
1008 const std::string var2)
1009{
1010 ExpansionInfoMapShPtr expVec1 = m_expansionMapShPtrMap.find(var1)->second;
1011 ExpansionInfoMapShPtr expVec2 = m_expansionMapShPtrMap.find(var2)->second;
1012
1013 if (expVec1.get() == expVec2.get())
1014 {
1015 return true;
1016 }
1017
1018 return false;
1019}
1020
1021/**
1022 *
1023 */
1024inline bool MeshGraph::ExpansionInfoDefined(const std::string var)
1025{
1026 return m_expansionMapShPtrMap.count(var);
1027}
1028
1029} // namespace SpatialDomains
1030
1031} // namespace Nektar
1032
1033#endif
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
#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:121
std::vector< PrismGeomUniquePtr > m_prismVec
Definition MeshGraph.h:124
std::vector< PyrGeomUniquePtr > m_pyrVec
Definition MeshGraph.h:123
std::vector< CurveUniquePtr > m_curveVec
Definition MeshGraph.h:126
std::vector< HexGeomUniquePtr > m_hexVec
Definition MeshGraph.h:125
std::vector< PointGeomUniquePtr > m_pointVec
Definition MeshGraph.h:118
std::vector< SegGeomUniquePtr > m_segVec
Definition MeshGraph.h:119
std::vector< TriGeomUniquePtr > m_triVec
Definition MeshGraph.h:120
std::vector< TetGeomUniquePtr > m_tetVec
Definition MeshGraph.h:122
bool operator==(const Iterator &other) const
Definition MeshGraph.h:263
Iterator(typename GeomMap< T >::const_iterator it)
Definition MeshGraph.h:239
bool operator!=(const Iterator &other) const
Definition MeshGraph.h:259
const value_type * operator->() const
Definition MeshGraph.h:248
GeomMap< T >::const_iterator m_it
Definition MeshGraph.h:235
bool operator==(const ReverseIterator &other) const
Definition MeshGraph.h:303
bool operator!=(const ReverseIterator &other) const
Definition MeshGraph.h:298
GeomMap< T >::const_reverse_iterator m_it
Definition MeshGraph.h:272
ReverseIterator(typename GeomMap< T >::const_reverse_iterator it)
Definition MeshGraph.h:276
ReverseIterator rend() const
Definition MeshGraph.h:326
Iterator find(int id) const
Definition MeshGraph.h:336
GeomMapView(const GeomMap< T > &map)
Definition MeshGraph.h:309
ReverseIterator rbegin() const
Definition MeshGraph.h:322
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:84
Base class for a spectral/hp element mesh.
Definition MeshGraph.h:353
PyrGeom * CreatePyrGeom(int id, std::array< Geometry2D *, PyrGeom::kNfaces > faces)
Definition MeshGraph.h:742
GeomMapView< SegGeom > m_segMapView
Definition MeshGraph.h:927
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:928
TriGeom * GetTriGeom(int id)
Returns triangle id from the MeshGraph.
Definition MeshGraph.h:575
GeomMapView< QuadGeom > m_quadMapView
Definition MeshGraph.h:929
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:949
void SetCompositeOrdering(CompositeOrdering p_compOrder)
Definition MeshGraph.h:843
void ReadExpansionInfo(TiXmlElement *expansionTypes)
int GetMeshDimension()
Dimension of the mesh (can be a 1D curve in 3D space).
Definition MeshGraph.h:380
std::vector< PointGeomUniquePtr > & GetAllCurveNodes()
Definition MeshGraph.h:806
const std::string GetGeomInfo(std::string parameter)
PointGeom * GetVertex(int id)
Returns vertex id from the MeshGraph.
Definition MeshGraph.h:550
void SetPartitionNumber(int partition)
Definition MeshGraph.h:886
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:447
GeomMapView< HexGeom > m_hexMapView
Definition MeshGraph.h:933
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:733
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:724
GeometryLinkSharedPtr GetElementsFromEdge(Geometry1D *edge)
std::map< int, CompositeSharedPtr > & GetComposites()
Definition MeshGraph.h:437
TriGeom * CreateTriGeom(int id, std::array< SegGeom *, TriGeom::kNedges > edges, Curve *curve=nullptr)
Definition MeshGraph.h:704
std::unordered_map< int, GeometryLinkSharedPtr > & GetAllFaceToElMap()
Definition MeshGraph.h:801
PrismGeom * GetPrismGeom(int id)
Returns prism id from the MeshGraph.
Definition MeshGraph.h:607
LibUtilities::SessionReaderSharedPtr m_session
Definition MeshGraph.h:912
SegGeom * CreateSegGeom(int id, int coordim, std::array< PointGeom *, SegGeom::kNverts > vertex, Curve *curve=nullptr)
Definition MeshGraph.h:682
LibUtilities::DomainRangeShPtr & GetDomainRange()
Definition MeshGraph.h:459
SegGeom * GetSegGeom(int id)
Returns segment id from the MeshGraph.
Definition MeshGraph.h:567
std::map< int, CompositeMap > m_domain
Definition MeshGraph.h:954
void SetPartition(SpatialDomains::MeshGraphSharedPtr graph)
std::unique_ptr< GeomRTree > m_boundingBoxTree
Definition MeshGraph.h:967
ExpansionInfoMapShPtr SetUpExpansionInfoMap()
std::map< int, CompositeSharedPtr > & GetDomain(int domain)
Definition MeshGraph.h:452
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:1007
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:627
PointGeom * CreatePointGeom(const int coordim, const int vid, NekDouble x, NekDouble y, NekDouble z)
Definition MeshGraph.h:670
std::map< int, CompositeMap > m_refComposite
Link the refinement id with the composites.
Definition MeshGraph.h:946
bool ExpansionInfoDefined(const std::string var)
Definition MeshGraph.h:1024
GeomMapView< TetGeom > m_tetMapView
Definition MeshGraph.h:930
GeomMapView< PointGeom > m_pointMapView
Definition MeshGraph.h:926
void SetMeshPartitioned(bool meshPartitioned)
Definition MeshGraph.h:876
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)
QuadGeom * CreateQuadGeom(int id, std::array< SegGeom *, QuadGeom::kNedges > edges, Curve *curve=nullptr)
Definition MeshGraph.h:693
ExpansionInfoMapShPtrMap & GetExpansionInfoMap()
Definition MeshGraph.h:891
void Empty(int dim, int space)
Definition MeshGraph.h:358
GeomMap< PyrGeom > m_pyrGeoms
Definition MeshGraph.h:922
HexGeom * GetHexGeom(int id)
Returns hex id from the MeshGraph.
Definition MeshGraph.h:615
GeomMapView< PyrGeom > m_pyrMapView
Definition MeshGraph.h:931
const ExpansionInfoMap & GetExpansionInfo(const std::string variable="DefaultVar")
ExpansionInfoMapShPtrMap m_expansionMapShPtrMap
Definition MeshGraph.h:957
GeomMap< SegGeom > m_segGeoms
Definition MeshGraph.h:918
int GetSpaceDimension()
Dimension of the space (can be a 1D curve in 3D space).
Definition MeshGraph.h:386
PyrGeom * GetPyrGeom(int id)
Returns pyramid id from the MeshGraph.
Definition MeshGraph.h:599
BndRegionOrdering & GetBndRegionOrdering()
Definition MeshGraph.h:848
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:900
void ResetExpansionInfoToBasisKey(ExpansionInfoMapShPtr &expansionMap, LibUtilities::ShapeType shape, LibUtilities::BasisKeyVector &keys)
LibUtilities::SessionReaderSharedPtr GetSession()
Definition MeshGraph.h:506
std::vector< PointGeomUniquePtr > m_nodeSet
Vector of all unique curve nodes, not including vertices.
Definition MeshGraph.h:936
GeomMap< PointGeom > m_pointGeoms
Definition MeshGraph.h:917
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:959
MovementSharedPtr & GetMovement()
Definition MeshGraph.h:861
CompositeSharedPtr GetComposite(int whichComposite)
Definition MeshGraph.h:422
GeomMap< TriGeom > m_triGeoms
Definition MeshGraph.h:919
PointGeom * GetPointGeom(int id)
Returns vertex id from the MeshGraph.
Definition MeshGraph.h:559
void SetExpansionInfo(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef)
Sets expansions given field definitions.
void SetBndRegionOrdering(BndRegionOrdering p_bndRegOrder)
Definition MeshGraph.h:853
CompositeOrdering & GetCompositeOrdering()
Definition MeshGraph.h:838
std::map< int, MeshEntity > CreateMeshEntities()
Create mesh entities for this graph.
GeomMapView< PrismGeom > m_prismMapView
Definition MeshGraph.h:932
bool CheckForGeomInfo(std::string parameter)
GeomMap< QuadGeom > m_quadGeoms
Definition MeshGraph.h:920
CompositeDescriptor CreateCompositeDescriptor()
TetGeom * CreateTetGeom(int id, std::array< TriGeom *, TetGeom::kNfaces > faces)
Definition MeshGraph.h:715
GeomMap< HexGeom > m_hexGeoms
Definition MeshGraph.h:924
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:953
GeomMap< TetGeom > m_tetGeoms
Definition MeshGraph.h:921
QuadGeom * GetQuadGeom(int id)
Returns quadrilateral id from the MeshGraph.
Definition MeshGraph.h:583
std::map< int, std::string > & GetCompositesLabels()
Definition MeshGraph.h:442
GeomMapView< T > & GetGeomMap()
Definition MeshGraph.h:761
void SetSession(LibUtilities::SessionReaderSharedPtr pSession)
Definition MeshGraph.h:999
Geometry2D * GetGeometry2D(int gID)
Definition MeshGraph.h:813
GeomMap< PrismGeom > m_prismGeoms
Definition MeshGraph.h:923
LibUtilities::DomainRangeShPtr m_domainRange
Definition MeshGraph.h:955
TetGeom * GetTetGeom(int id)
Returns tetrahedron id from the MeshGraph.
Definition MeshGraph.h:591
BndRegionOrdering m_bndRegOrder
Definition MeshGraph.h:964
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:96
unique_ptr_objpool< HexGeom > HexGeomUniquePtr
Definition MeshGraph.h:108
std::shared_ptr< std::vector< std::pair< Geometry *, int > > > GeometryLinkSharedPtr
Definition MeshGraph.h:216
unique_ptr_objpool< Curve > CurveUniquePtr
Definition Geometry.h:70
std::map< std::string, std::string > GeomInfoMap
Definition MeshGraph.h:214
std::map< int, std::vector< unsigned int > > CompositeOrdering
Definition MeshGraph.h:177
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
Definition Geometry.h:62
unique_ptr_objpool< Geometry3D > Geometry3DUniquePtr
Definition MeshGraph.h:110
std::map< int, CurveUniquePtr > CurveMap
Definition Geometry.h:71
std::map< int, std::pair< LibUtilities::ShapeType, std::vector< int > > > CompositeDescriptor
Definition MeshGraph.h:131
std::map< int, std::vector< unsigned int > > BndRegionOrdering
Definition MeshGraph.h:178
unique_ptr_objpool< QuadGeom > QuadGeomUniquePtr
Definition MeshGraph.h:104
std::shared_ptr< Composite > CompositeSharedPtr
Definition MeshGraph.h:185
std::shared_ptr< ExpansionInfoMap > ExpansionInfoMapShPtr
Definition MeshGraph.h:193
std::shared_ptr< Movement > MovementSharedPtr
Definition MeshGraph.h:227
unique_ptr_objpool< PyrGeom > PyrGeomUniquePtr
Definition MeshGraph.h:106
LibUtilities::NekFactory< std::string, MeshGraph > MeshGraphFactory
Definition MeshGraph.h:972
unique_ptr_objpool< PrismGeom > PrismGeomUniquePtr
Definition MeshGraph.h:107
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
Definition MeshGraph.h:190
const std::string kExpansionTypeStr[]
Definition MeshGraph.h:158
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:224
std::map< std::string, std::string > MeshMetaDataMap
Definition MeshGraph.h:221
unique_ptr_objpool< Geometry2D > Geometry2DUniquePtr
Definition MeshGraph.h:109
unique_ptr_objpool< SegGeom > SegGeomUniquePtr
Definition MeshGraph.h:102
unique_ptr_objpool< PointGeom > PointGeomUniquePtr
Definition MeshGraph.h:99
MeshGraphFactory & GetMeshGraphFactory()
Definition MeshGraph.cpp:88
unique_ptr_objpool< TriGeom > TriGeomUniquePtr
Definition MeshGraph.h:103
std::map< std::string, ExpansionInfoMapShPtr > ExpansionInfoMapShPtrMap
Definition MeshGraph.h:194
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition MeshGraph.h:191
unique_ptr_objpool< TetGeom > TetGeomUniquePtr
Definition MeshGraph.h:105
std::map< int, CompositeSharedPtr > CompositeMap
Definition MeshGraph.h:186
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:182
ExpansionInfo(Geometry *geomPtr, const LibUtilities::BasisKeyVector basiskeyvec)
Definition MeshGraph.h:198
LibUtilities::BasisKeyVector m_basisKeyVector
Definition MeshGraph.h:211
ExpansionInfo(ExpansionInfoShPtr ExpInfo)
Definition MeshGraph.h:204