ESScript
Revision_
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
#include <dudley/ElementType.h>
// for Dudley_ElementTypeId
23
#include <finley/ReferenceElements.h>
// for finley::ElementTypeId
24
25
class
DBfile;
26
class
NcFile;
27
28
struct
Dudley_ElementFile
;
29
30
namespace
finley {
31
class
ElementFile;
32
}
33
34
namespace
weipa {
35
38
struct
FinleyElementInfo
39
{
40
ZoneType
elementType
,
reducedElementType
;
41
int
elementFactor
;
42
int
elementSize
,
reducedElementSize
;
43
const
size_t
*
multiCellIndices
;
44
bool
useQuadNodes
;
45
int
quadDim
;
46
};
47
48
class
FinleyElements
;
49
typedef
boost::shared_ptr<FinleyElements>
FinleyElements_ptr
;
50
60
class
FinleyElements
:
public
ElementData
61
{
62
public
:
63
65
FinleyElements
(
const
std::string& elementName,
FinleyNodes_ptr
nodes
);
66
68
FinleyElements
(
const
FinleyElements
& e);
69
71
virtual
~FinleyElements
() {}
72
74
bool
initFromDudley
(
const
Dudley_ElementFile
* dudleyFile);
75
77
bool
initFromFinley
(
const
finley::ElementFile
* finleyFile);
78
80
bool
readFromNc
(NcFile* ncfile);
81
84
void
reorderGhostZones
(
int
ownIndex);
85
87
void
removeGhostZones
(
int
ownIndex);
88
90
virtual
void
writeConnectivityVTK
(std::ostream& os);
91
97
bool
writeToSilo
(DBfile* dbfile,
const
std::string& siloPath,
98
const
StringVec
& labels,
const
StringVec
& units,
99
bool
writeMeshData);
100
102
virtual
StringVec
getMeshNames
()
const
;
103
105
virtual
StringVec
getVarNames
()
const
;
106
108
virtual
int
getNumElements
()
const
{
return
numElements
; }
109
111
virtual
int
getNodesPerElement
()
const
{
return
nodesPerElement
; }
112
114
virtual
int
getGhostCount
()
const
{
return
numGhostElements
; }
115
117
virtual
ZoneType
getType
()
const
{
return
type
; }
118
120
finley::ElementTypeId
getFinleyTypeId
()
const
{
return
finleyTypeId
; }
121
123
virtual
const
IntVec
&
getNodeList
()
const
{
return
nodes
; }
124
126
virtual
const
IntVec
&
getIDs
()
const
{
return
ID
; }
127
131
virtual
const
IntVec
&
getVarDataByName
(
const
std::string varName)
const
;
132
134
virtual
NodeData_ptr
getNodes
()
const
{
return
nodeMesh
; }
135
137
virtual
ElementData_ptr
getReducedElements
()
const
{
return
reducedElements
; }
138
140
virtual
const
QuadMaskInfo
&
getQuadMask
(
int
functionSpace)
const
;
141
145
virtual
int
getElementFactor
()
const
{
return
elementFactor
; }
146
147
private
:
148
FinleyElements
() {}
149
FinleyElementInfo
getDudleyTypeInfo
(
Dudley_ElementTypeId
typeId);
150
FinleyElementInfo
getFinleyTypeInfo
(
finley::ElementTypeId
typeId);
151
void
buildMeshes
();
152
void
buildReducedElements
(
const
FinleyElementInfo
& f);
153
IntVec
prepareGhostIndices
(
int
ownIndex);
154
void
reorderArray
(
IntVec
& v,
const
IntVec
& idx,
int
elementsPerIndex);
155
QuadMaskInfo
buildQuadMask
(
const
CoordArray
& quadNodes,
int
numQNodes);
156
157
FinleyElements_ptr
reducedElements
;
158
FinleyNodes_ptr
nodeMesh
;
159
FinleyNodes_ptr
originalMesh
;
160
std::string
name
;
161
int
numElements
;
162
int
numGhostElements
;
163
int
nodesPerElement
;
164
ZoneType
type
;
165
finley::ElementTypeId
finleyTypeId
;
166
IntVec
nodes
;
167
IntVec
color
,
ID
,
tag
;
168
IntVec
owner
;
169
QuadMaskInfo
quadMask
,
reducedQuadMask
;
170
int
elementFactor
;
171
};
172
173
}
// namespace weipa
174
175
#endif // __WEIPA_FINLEYELEMENTS_H__
176
Generated on Thu Dec 12 2013 03:47:18 for ESScript by
1.8.1.2