Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description:
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 #ifndef NEKTAR_SPATIALDOMAINS_DOMAIN_H
36 #define NEKTAR_SPATIALDOMAINS_DOMAIN_H
37 
40 
41 class TiXmlDocument;
42 
43 namespace Nektar
44 {
45  namespace SpatialDomains
46  {
48  {
50  eDirichlet,
51  eNeumann,
52  eRobin,
54 
57  };
58 
59  // Corresponds to the entries above. These are the tags within the domain definition
60  // corresponding to type of BC above.
61  const char BoundaryTypeNameMap[] =
62  {
63  'U',// Just a placeholder to get the correct index for the rest.
64  'D',
65  'N',
66  'R',
67  'C'
68  };
69 
71  {
73  std::vector< Composite > m_BoundaryComposites;
74  };
75 
76  typedef boost::shared_ptr< BoundaryEntry > BoundarySharedPtr;
77  typedef std::vector< BoundarySharedPtr > BoundaryVector;
79  typedef std::vector< Composite > CompositeVector;
81 
82  class Domain
83  {
84  public:
85  // Must have a MeshGraph from which the composites
86  // and associated items can be obtained.
87  Domain(MeshGraph *meshGraph);
88  virtual ~Domain();
89 
90  void Read(std::string &infilename);
91  void Read(TiXmlDocument &doc);
92  void Write(std::string &outfilename);
93 
94  CompositeVector GetDomain(void) const { return m_Domain; };
95  BoundaryVector GetBoundaries(void) const { return m_Boundaries; };
96 
97  inline void SetFileName(const std::string &inString)
98  {
99  m_FileName = inString;
100  };
101 
102 
103  protected:
104  //std::string m_filename;
106  CompositeVector m_domain;
107  BoundaryVector m_boundaries;
108 
109  private:
110  Domain(){ NEKERROR(ErrorUtil::efatal, "Must provide a meshgraph to create a Domain."); }; // Don't call this.
111  };
112  };
113 }
114 
115 #endif //NEKTAR_SPATIALDOMAINS_DOMAIN_H
void SetFileName(const std::string &inString)
Definition: Domain.h:97
std::vector< BoundarySharedPtr > BoundaryVector
Definition: Domain.h:77
const char BoundaryTypeNameMap[]
Definition: Domain.h:61
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
std::vector< BoundarySharedPtr >::iterator BoundaryVectorIter
Definition: Domain.h:78
Definition: Domain.h:70
BoundaryType m_BoundaryType
Definition: Domain.h:72
std::vector< Composite > CompositeVector
Definition: Domain.h:79
void Write(std::string &outfilename)
Definition: Domain.cpp:228
BoundaryVector GetBoundaries(void) const
Definition: Domain.h:95
CompositeVector m_domain
Definition: Domain.h:106
BoundaryVector m_boundaries
Definition: Domain.h:107
void Read(std::string &infilename)
Definition: Domain.cpp:60
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Base class for a spectral/hp element mesh.
Definition: MeshGraph.h:186
std::vector< Composite > m_BoundaryComposites
Definition: Domain.h:73
CompositeVector GetDomain(void) const
Definition: Domain.h:94
boost::shared_ptr< BoundaryEntry > BoundarySharedPtr
Definition: Domain.h:76
std::vector< Composite >::iterator CompositeVectorIter
Definition: Domain.h:80