Nektar++
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MeshGraphHDF5.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: MeshGraphHDF5.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: This file contains the base class specification for the
32// MeshGraphHDF5 class.
33//
34//
35////////////////////////////////////////////////////////////////////////////////
36#ifndef NEKTAR_SPATIALDOMAINS_MGHDF5_H
37#define NEKTAR_SPATIALDOMAINS_MGHDF5_H
38
42
43namespace Nektar
44{
45namespace SpatialDomains
46{
47
49{
50public:
52 {
53 }
54
56 {
57 }
58
60 {
62 }
63
64 static std::string className, cmdSwitch;
65
66protected:
68 std::string &outfilename, bool defaultExp = false,
69 const LibUtilities::FieldMetaDataMap &metadata =
72 LibUtilities::DomainRangeShPtr rng, bool fillGraph) override;
75
76private:
77 void ReadCurveMap(CurveMap &curveMap, std::string dsName,
78 const std::unordered_set<int> &readIds);
79 void ReadDomain();
80 void ReadComposites();
81
82 template <class T>
83 void WriteGeometryMap(std::map<int, std::shared_ptr<T>> &geomMap,
84 std::string datasetName);
85
86 template <class T, typename DataType>
87 void ReadGeometryData(std::map<int, std::shared_ptr<T>> &geomMap,
88 std::string dataSet,
89 const std::unordered_set<int> &readIds,
90 std::vector<int> &ids,
91 std::vector<DataType> &geomData);
92 template <class T, typename DataType>
93 void FillGeomMap(std::map<int, std::shared_ptr<T>> &geomMap,
94 const CurveMap &curveMap, std::vector<int> &ids,
95 std::vector<DataType> &geomData);
96 template <class T, typename DataType>
97 void ConstructGeomObject(std::map<int, std::shared_ptr<T>> &geomMap, int id,
98 DataType *data, CurveSharedPtr curve);
99
101 std::unordered_map<int, int> &id2row);
102
103 void WriteCurveMap(CurveMap &curves, std::string dsName,
104 MeshCurvedPts &curvedPts, int &ptOffset, int &newIdx);
105 void WriteCurvePoints(MeshCurvedPts &curvedPts);
106
107 void WriteComposites(CompositeMap &comps);
108 void WriteDomain(std::map<int, CompositeMap> &domain);
109
110 std::string m_hdf5Name;
115 unsigned int m_inFormatVersion;
116
117 static const unsigned int FORMAT_VERSION;
118};
119
120} // namespace SpatialDomains
121} // namespace Nektar
122
123#endif
#define SPATIAL_DOMAINS_EXPORT
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void FillGeomMap(std::map< int, std::shared_ptr< T > > &geomMap, const CurveMap &curveMap, std::vector< int > &ids, std::vector< DataType > &geomData)
void ConstructGeomObject(std::map< int, std::shared_ptr< T > > &geomMap, int id, DataType *data, CurveSharedPtr curve)
virtual void v_PartitionMesh(LibUtilities::SessionReaderSharedPtr session) override
Partition the mesh.
void ReadCurveMap(CurveMap &curveMap, std::string dsName, const std::unordered_set< int > &readIds)
static const unsigned int FORMAT_VERSION
Version of the Nektar++ HDF5 geometry format, which is embedded into the main NEKTAR/GEOMETRY group a...
virtual void v_ReadGeometry(LibUtilities::DomainRangeShPtr rng, bool fillGraph) override
void WriteComposites(CompositeMap &comps)
virtual void v_WriteGeometry(std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap) override
void WriteCurvePoints(MeshCurvedPts &curvedPts)
LibUtilities::H5::GroupSharedPtr m_maps
static MeshGraphSharedPtr create()
Definition: MeshGraphHDF5.h:59
LibUtilities::H5::PListSharedPtr m_readPL
LibUtilities::H5::FileSharedPtr m_file
void WriteGeometryMap(std::map< int, std::shared_ptr< T > > &geomMap, std::string datasetName)
void ReadGeometryData(std::map< int, std::shared_ptr< T > > &geomMap, std::string dataSet, const std::unordered_set< int > &readIds, std::vector< int > &ids, std::vector< DataType > &geomData)
void WriteDomain(std::map< int, CompositeMap > &domain)
LibUtilities::H5::GroupSharedPtr m_mesh
void WriteCurveMap(CurveMap &curves, std::string dsName, MeshCurvedPts &curvedPts, int &ptOffset, int &newIdx)
Base class for a spectral/hp element mesh.
Definition: MeshGraph.h:183
CompositeDescriptor CreateCompositeDescriptor()
Definition: MeshGraph.cpp:4109
std::shared_ptr< PList > PListSharedPtr
Definition: H5.h:98
std::shared_ptr< File > FileSharedPtr
Definition: H5.h:94
std::shared_ptr< Group > GroupSharedPtr
Definition: FieldIOHdf5.h:50
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:52
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static FieldMetaDataMap NullFieldMetaDataMap
Definition: FieldIO.h:53
std::shared_ptr< DomainRange > DomainRangeShPtr
Definition: DomainRange.h:66
std::map< int, std::pair< LibUtilities::ShapeType, std::vector< int > > > CompositeDescriptor
Definition: MeshGraph.h:63
std::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:60
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:61
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:176
std::map< int, CompositeSharedPtr > CompositeMap
Definition: MeshGraph.h:138
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2