ESScript
Revision_
Main Page
Namespaces
Classes
Files
File List
File Members
finley
src
finley/src/ElementFile.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 __FINLEY_ELEMENTFILE_H__
17
#define __FINLEY_ELEMENTFILE_H__
18
19
#include "
Finley.h
"
20
#include "
NodeFile.h
"
21
#include "
ReferenceElementSets.h
"
22
#include "
Util.h
"
23
24
namespace
finley {
25
26
struct
ElementFile_Jacobians
{
27
ElementFile_Jacobians
(
const_ShapeFunction_ptr
basis);
28
~ElementFile_Jacobians
();
29
31
int
status
;
33
int
numDim
;
35
const_ShapeFunction_ptr
BasisFunctions
;
38
int
numQuadTotal
;
40
int
numSides
;
42
const
int
*
offsets
;
44
int
numSub
;
46
int
numShapesTotal
;
49
const
int
*
node_selection
;
51
int
numElements
;
53
double
*
volume
;
56
double
*
DSDX
;
57
};
58
59
class
ElementFile
60
{
61
public
:
62
ElementFile
(
const_ReferenceElementSet_ptr
refElementSet,
63
Esys_MPIInfo
*mpiInfo);
64
~ElementFile
();
65
66
void
allocTable
(
int
numElements
);
67
void
freeTable
();
68
69
void
distributeByRankOfDOF
(
const
std::vector<int>& mpiRankOfDOF,
int
*
Id
);
70
void
createColoring
(
const
std::vector<int>& dofMap);
72
void
optimizeOrdering
();
74
void
relabelNodes
(
const
std::vector<int>& newNode,
int
offset);
75
void
markNodes
(std::vector<short>& mask,
int
offset,
bool
useLinear);
76
void
scatter
(
int
* index,
const
ElementFile
* in);
77
void
gather
(
int
* index,
const
ElementFile
* in);
78
void
copyTable
(
int
offset,
int
nodeOffset,
int
idOffset,
79
const
ElementFile
* in);
80
81
void
markDOFsConnectedToRange
(
int
* mask,
int
offset,
int
marker,
82
int
firstDOF,
int
lastDOF,
83
const
int
*dofIndex,
bool
useLinear);
84
85
void
setTags
(
const
int
newTag,
const
escript::Data& mask);
86
ElementFile_Jacobians
*
borrowJacobians
(
const
NodeFile
*,
bool
,
bool
)
const
;
89
inline
std::pair<int,int>
getNodeRange
()
const
;
90
93
inline
void
updateTagList
();
94
95
private
:
96
void
swapTable
(
ElementFile
* other);
97
98
public
:
99
Esys_MPIInfo
*
MPIInfo
;
100
102
const_ReferenceElementSet_ptr
referenceElementSet
;
104
int
numElements
;
108
int
*
Id
;
110
int
*
Tag
;
112
int
*
Owner
;
114
std::vector<int>
tagsInUse
;
116
int
numNodes
;
121
int
*
Nodes
;
126
int
*
Color
;
128
int
minColor
;
130
int
maxColor
;
132
ElementFile_Jacobians
*
jacobians
;
135
ElementFile_Jacobians
*
jacobians_reducedS
;
138
ElementFile_Jacobians
*
jacobians_reducedQ
;
141
ElementFile_Jacobians
*
jacobians_reducedS_reducedQ
;
142
};
143
144
inline
std::pair<int,int>
ElementFile::getNodeRange
()
const
145
{
146
return
util::getMinMaxInt
(
numNodes
,
numElements
,
Nodes
);
147
}
148
149
150
inline
void
ElementFile::updateTagList
()
151
{
152
util::setValuesInUse
(
Tag
,
numElements
,
tagsInUse
,
MPIInfo
);
153
}
154
155
}
// namespace finley
156
157
#endif // __FINLEY_ELEMENTFILE_H__
158
Generated on Thu Dec 12 2013 03:47:17 for ESScript by
1.8.1.2