Nektar++
Domain.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Domain.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 #ifndef NEKTAR_SPATIALDOMAINS_DOMAIN_H
35 #define NEKTAR_SPATIALDOMAINS_DOMAIN_H
36 
39 
40 class TiXmlDocument;
41 
42 namespace Nektar
43 {
44 namespace SpatialDomains
45 {
47 {
48  eUnknown = 0,
49  eDirichlet,
50  eNeumann,
51  eRobin,
53 
56 };
57 
58 // Corresponds to the entries above. These are the tags within the domain
59 // definition corresponding to type of BC above.
60 const char BoundaryTypeNameMap[] = {
61  'U', // Just a placeholder to get the correct index for the rest.
62  'D', 'N', 'R', 'C'};
63 
65 {
67  std::vector<Composite> m_BoundaryComposites;
68 };
69 
70 typedef std::shared_ptr<BoundaryEntry> BoundarySharedPtr;
71 typedef std::vector<BoundarySharedPtr> BoundaryVector;
72 typedef std::vector<Composite> CompositeVector;
73 
74 class Domain
75 {
76 public:
77  // Must have a MeshGraph from which the composites
78  // and associated items can be obtained.
79  Domain(MeshGraph *meshGraph);
80  virtual ~Domain();
81 
82  void Read(std::string &infilename);
83  void Read(TiXmlDocument &doc);
84  void Write(std::string &outfilename);
85 
87  {
88  return m_Domain;
89  };
91  {
92  return m_Boundaries;
93  };
94 
95  inline void SetFileName(const std::string &inString)
96  {
97  m_FileName = inString;
98  };
99 
100 protected:
101  // std::string m_filename;
105 
106 private:
108  {
110  "Must provide a meshgraph to create a Domain.");
111  }; // Don't call this.
112 };
113 }; // namespace SpatialDomains
114 } // namespace Nektar
115 
116 #endif // NEKTAR_SPATIALDOMAINS_DOMAIN_H
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
void SetFileName(const std::string &inString)
Definition: Domain.h:95
BoundaryVector GetBoundaries(void) const
Definition: Domain.h:90
void Write(std::string &outfilename)
Definition: Domain.cpp:254
CompositeVector GetDomain(void) const
Definition: Domain.h:86
void Read(std::string &infilename)
Definition: Domain.cpp:58
BoundaryVector m_boundaries
Definition: Domain.h:104
CompositeVector m_domain
Definition: Domain.h:103
Base class for a spectral/hp element mesh.
Definition: MeshGraph.h:180
std::shared_ptr< BoundaryEntry > BoundarySharedPtr
Definition: Domain.h:70
std::vector< Composite > CompositeVector
Definition: Domain.h:72
std::vector< BoundarySharedPtr > BoundaryVector
Definition: Domain.h:71
const char BoundaryTypeNameMap[]
Definition: Domain.h:60
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
Definition: Domain.h:65
std::vector< Composite > m_BoundaryComposites
Definition: Domain.h:67
BoundaryType m_BoundaryType
Definition: Domain.h:66