Nektar++
Loading...
Searching...
No Matches
MeshGraphIO.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: MeshGraphIO.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_MGIO_H
36#define NEKTAR_SPATIALDOMAINS_MGIO_H
37
41
43{
44
45class MeshGraphIO;
46typedef std::shared_ptr<MeshGraphIO> MeshGraphIOSharedPtr;
47
49{
50public:
52
56 bool fillGraph = true,
57 SpatialDomains::MeshGraphSharedPtr partitionedGraph = nullptr);
58
60 {
61 m_meshGraph = meshGraph;
62 }
63
65 const std::string &outfilename, bool defaultExp = false,
66 const LibUtilities::FieldMetaDataMap &metadata =
68 {
69 v_WriteGeometry(outfilename, defaultExp, metadata);
70 }
71
72 /*an inital read which loads a very light weight data structure*/
74 {
75 v_ReadGeometry(fillGraph);
76 }
77
83
84 SPATIAL_DOMAINS_EXPORT std::map<int, MeshEntity> CreateMeshEntities();
86
87protected:
91 bool m_meshPartitioned = false;
94
95 std::string GetCompositeString(CompositeSharedPtr comp);
96
98
100 const std::string &outfilename, bool defaultExp = false,
101 const LibUtilities::FieldMetaDataMap &metadata =
103
104 SPATIAL_DOMAINS_EXPORT virtual void v_ReadGeometry(bool fillGraph) = 0;
105
108};
109
112
113} // namespace Nektar::SpatialDomains
114
115#endif // NEKTAR_MESHGRAPHIO_H
#define SPATIAL_DOMAINS_EXPORT
Provides a generic Factory class.
LibUtilities::SessionReaderSharedPtr m_session
Definition MeshGraphIO.h:88
void ReadGeometry(bool fillGraph)
Definition MeshGraphIO.h:73
static MeshGraphSharedPtr Read(const LibUtilities::SessionReaderSharedPtr pSession, LibUtilities::DomainRangeShPtr rng=LibUtilities::NullDomainRangeShPtr, bool fillGraph=true, SpatialDomains::MeshGraphSharedPtr partitionedGraph=nullptr)
virtual void v_ReadGeometry(bool fillGraph)=0
std::string GetCompositeString(CompositeSharedPtr comp)
Returns a string representation of a composite.
CompositeDescriptor CreateCompositeDescriptor()
virtual void v_PartitionMesh(LibUtilities::SessionReaderSharedPtr session)=0
void PartitionMesh(LibUtilities::SessionReaderSharedPtr session)
Definition MeshGraphIO.h:78
void WriteGeometry(const std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap)
Definition MeshGraphIO.h:64
virtual void v_WriteGeometry(const std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap)=0
void SetMeshGraph(MeshGraphSharedPtr &meshGraph)
Definition MeshGraphIO.h:59
std::map< int, MeshEntity > CreateMeshEntities()
Create mesh entities for this graph.
std::map< std::string, std::string > FieldMetaDataMap
Definition FieldIO.h:50
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static FieldMetaDataMap NullFieldMetaDataMap
Definition FieldIO.h:51
std::shared_ptr< DomainRange > DomainRangeShPtr
Definition DomainRange.h:69
static DomainRangeShPtr NullDomainRangeShPtr
Definition DomainRange.h:70
std::map< int, std::vector< unsigned int > > CompositeOrdering
Definition MeshGraph.h:170
std::shared_ptr< MeshGraphIO > MeshGraphIOSharedPtr
Definition MeshGraphIO.h:46
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
std::shared_ptr< Composite > CompositeSharedPtr
Definition MeshGraph.h:178
LibUtilities::NekFactory< std::string, MeshGraphIO > MeshGraphIOFactory
MeshGraphIOFactory & GetMeshGraphIOFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:217