Nektar++
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
library
SpatialDomains
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
38
#include <
LibUtilities/BasicUtils/ErrorUtil.hpp
>
39
#include <
SpatialDomains/MeshGraph.h
>
40
41
class
TiXmlDocument;
42
43
namespace
Nektar
44
{
45
namespace
SpatialDomains
46
{
47
enum
BoundaryType
48
{
49
eUnknown
=0,
50
eDirichlet
,
51
eNeumann
,
52
eRobin
,
53
eCauchy
,
54
55
eDummy
,
56
eBoundaryTypeLastElement
=
eDummy
-1
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
70
struct
BoundaryEntry
71
{
72
BoundaryType
m_BoundaryType
;
73
std::vector< Composite >
m_BoundaryComposites
;
74
};
75
76
typedef
boost::shared_ptr< BoundaryEntry >
BoundarySharedPtr
;
77
typedef
std::vector< BoundarySharedPtr >
BoundaryVector
;
78
typedef
std::vector< BoundarySharedPtr >::iterator
BoundaryVectorIter
;
79
typedef
std::vector< Composite >
CompositeVector
;
80
typedef
std::vector< Composite >::iterator
CompositeVectorIter
;
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;
105
MeshGraph
*
m_meshGraph
;
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
Generated on Sun Mar 15 2015 00:11:30 for Nektar++ by
1.8.1.2