Escript
Revision_4320
Main Page
Namespaces
Classes
Files
File List
File Members
weipa
src
FinleyElements.h
Go to the documentation of this file.
1
2
/*****************************************************************************
3
*
4
* Copyright (c) 2003-2013 by University of Queensland
5
* http://www.uq.edu.au
6
*
7
* Primary Business: Queensland, Australia
8
* Licensed under the Open Software License version 3.0
9
* http://www.opensource.org/licenses/osl-3.0.php
10
*
11
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12
* Development since 2012 by School of Earth Sciences
13
*
14
*****************************************************************************/
15
16
#ifndef __WEIPA_FINLEYELEMENTS_H__
17
#define __WEIPA_FINLEYELEMENTS_H__
18
19
#include <weipa/ElementData.h>
20
#include <weipa/FinleyNodes.h>
21
22
extern
"C"
{
23
#include <dudley/ElementType.h>
// for Dudley_ElementTypeId
24
#include <finley/ReferenceElements.h>
// for Finley_ElementTypeId
25
}
26
27
class
DBfile;
28
class
NcFile;
29
30
struct
Dudley_ElementFile
;
31
struct
Finley_ElementFile
;
32
33
namespace
weipa {
34
37
struct
FinleyElementInfo
38
{
39
ZoneType
elementType
,
reducedElementType
;
40
int
elementFactor
;
41
int
elementSize
,
reducedElementSize
;
42
const
size_t
*
multiCellIndices
;
43
bool
useQuadNodes
;
44
int
quadDim
;
45
};
46
47
class
FinleyElements
;
48
typedef
boost::shared_ptr<FinleyElements>
FinleyElements_ptr
;
49
59
class
FinleyElements
:
public
ElementData
60
{
61
public
:
62
64
FinleyElements
(
const
std::string& elementName,
FinleyNodes_ptr
nodes
);
65
67
FinleyElements
(
const
FinleyElements
& e);
68
70
virtual
~FinleyElements
() {}
71
73
bool
initFromDudley
(
const
Dudley_ElementFile
* dudleyFile);
74
76
bool
initFromFinley
(
const
Finley_ElementFile
* finleyFile);
77
79
bool
readFromNc
(NcFile* ncfile);
80
83
void
reorderGhostZones
(
int
ownIndex);
84
86
void
removeGhostZones
(
int
ownIndex);
87
89
virtual
void
writeConnectivityVTK
(std::ostream& os);
90
96
bool
writeToSilo
(DBfile* dbfile,
const
std::string& siloPath,
97
const
StringVec
& labels,
const
StringVec
& units,
98
bool
writeMeshData);
99
101
virtual
StringVec
getMeshNames
()
const
;
102
104
virtual
StringVec
getVarNames
()
const
;
105
107
virtual
int
getNumElements
()
const
{
return
numElements
; }
108
110
virtual
int
getNodesPerElement
()
const
{
return
nodesPerElement
; }
111
113
virtual
int
getGhostCount
()
const
{
return
numGhostElements
; }
114
116
virtual
ZoneType
getType
()
const
{
return
type
; }
117
119
Finley_ElementTypeId
getFinleyTypeId
()
const
{
return
finleyTypeId
; }
120
122
virtual
const
IntVec
&
getNodeList
()
const
{
return
nodes
; }
123
125
virtual
const
IntVec
&
getIDs
()
const
{
return
ID
; }
126
130
virtual
const
IntVec
&
getVarDataByName
(
const
std::string varName)
const
;
131
133
virtual
NodeData_ptr
getNodes
()
const
{
return
nodeMesh
; }
134
136
virtual
ElementData_ptr
getReducedElements
()
const
{
return
reducedElements
; }
137
139
virtual
const
QuadMaskInfo
&
getQuadMask
(
int
functionSpace)
const
;
140
144
virtual
int
getElementFactor
()
const
{
return
elementFactor
; }
145
146
private
:
147
FinleyElements
() {}
148
FinleyElementInfo
getDudleyTypeInfo
(
Dudley_ElementTypeId
typeId);
149
FinleyElementInfo
getFinleyTypeInfo
(
Finley_ElementTypeId
typeId);
150
void
buildMeshes
();
151
void
buildReducedElements
(
const
FinleyElementInfo
& f);
152
IntVec
prepareGhostIndices
(
int
ownIndex);
153
void
reorderArray
(
IntVec
& v,
const
IntVec
& idx,
int
elementsPerIndex);
154
QuadMaskInfo
buildQuadMask
(
const
CoordArray
& quadNodes,
int
numQNodes);
155
156
FinleyElements_ptr
reducedElements
;
157
FinleyNodes_ptr
nodeMesh
;
158
FinleyNodes_ptr
originalMesh
;
159
std::string
name
;
160
int
numElements
;
161
int
numGhostElements
;
162
int
nodesPerElement
;
163
ZoneType
type
;
164
Finley_ElementTypeId
finleyTypeId
;
165
IntVec
nodes
;
166
IntVec
color
,
ID
,
tag
;
167
IntVec
owner
;
168
QuadMaskInfo
quadMask
,
reducedQuadMask
;
169
int
elementFactor
;
170
};
171
172
}
// namespace weipa
173
174
#endif // __WEIPA_FINLEYELEMENTS_H__
175
Generated on Fri Mar 15 2013 14:07:50 for Escript by
1.8.1.2