escript  Revision_
dudley/src/ElementFile.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 #ifndef __DUDLEY_ELEMENTFILE_H__
19 #define __DUDLEY_ELEMENTFILE_H__
20 
21 #include "Dudley.h"
22 #include "NodeFile.h"
23 #include "ElementType.h"
24 #include "Util.h"
25 
26 namespace dudley {
27 
29 {
32 
34  int status;
36  int numDim;
38  int numQuad;
40  int numShapes;
44  double *absD;
46  double quadweight;
49  double* DSDX;
50 };
51 
53 {
54 public:
56  ~ElementFile();
57 
59  void allocTable(dim_t NE);
60 
62  void freeTable();
63 
66  void copyTable(index_t offset, index_t nodeOffset, index_t idOffset,
67  const ElementFile* in);
68 
70  void print(const index_t* nodesId) const;
71 
73  void distributeByRankOfDOF(const int* mpiRankOfDOF,
74  const index_t* nodesId);
75 
78  void createColoring(dim_t numNodes, const index_t* degreeOfFreedom);
79 
81  void optimizeOrdering();
82 
85  void relabelNodes(const index_t* newNode, index_t offset);
86 
87  void markNodes(std::vector<short>& mask, index_t offset) const;
88 
92  void gather(const index_t* index, const ElementFile* in);
93 
95  void setTags(int newTag, const escript::Data& mask);
96 
98  bool reducedOrder) const;
99 
102  inline std::pair<index_t,index_t> getNodeRange() const;
103 
104  inline void updateTagList();
105 
106 private:
107  void swapTable(ElementFile* other);
108 
109 public:
111 
114 
119 
121  int* Tag;
122 
124  int* Owner;
125 
127  std::vector<int> tagsInUse;
128 
130  int numNodes;
131 
134 
139 
142 
145 
147  int numDim;
148 
151 
154 
156  const char *ename;
157 
160 
161 private:
164 
168 };
169 
170 inline std::pair<index_t,index_t> ElementFile::getNodeRange() const
171 {
173 }
174 
176 {
178 }
179 
180 
181 } // namespace dudley
182 
183 #endif // __DUDLEY_ELEMENTFILE_H__
184 
Definition: dudley/src/ElementFile.h:53
void print(const index_t *nodesId) const
prints information about this element file to stdout
Definition: dudley/src/ElementFile.cpp:117
ElementFile_Jacobians * jacobians_reducedQ
Definition: dudley/src/ElementFile.h:167
int numNodes
number of nodes per element
Definition: dudley/src/ElementFile.h:130
void gather(const index_t *index, const ElementFile *in)
Definition: dudley/src/ElementFile.cpp:134
index_t minColor
minimum color value
Definition: dudley/src/ElementFile.h:141
index_t maxColor
maximum color value
Definition: dudley/src/ElementFile.h:144
dim_t numElements
number of elements
Definition: dudley/src/ElementFile.h:113
~ElementFile()
Definition: dudley/src/ElementFile.cpp:47
std::pair< index_t, index_t > getNodeRange() const
Definition: dudley/src/ElementFile.h:170
void copyTable(index_t offset, index_t nodeOffset, index_t idOffset, const ElementFile *in)
Definition: dudley/src/ElementFile.cpp:94
int * Owner
Owner[i] contains the rank that owns element i.
Definition: dudley/src/ElementFile.h:124
int numLocalDim
dimension of the element e.g. 2 for a line in 2D or 3D
Definition: dudley/src/ElementFile.h:150
void distributeByRankOfDOF(const int *mpiRankOfDOF, const index_t *nodesId)
redistributes the elements including overlap by rank
Definition: ElementFile_distributeByRankOfDOF.cpp:24
void freeTable()
deallocates the element table within an element file
Definition: dudley/src/ElementFile.cpp:81
std::vector< int > tagsInUse
array of tags which are actually used
Definition: dudley/src/ElementFile.h:127
void allocTable(dim_t NE)
allocates the element table within an element file to hold NE elements
Definition: dudley/src/ElementFile.cpp:54
void optimizeOrdering()
reorders the elements so that they are stored close to the nodes
Definition: dudley/src/ElementFile.cpp:164
ElementFile_Jacobians * borrowJacobians(const NodeFile *nodes, bool reducedOrder) const
Definition: dudley/src/ElementFile_jacobians.cpp:41
ElementFile_Jacobians * jacobians
jacobians of the shape function used for solution approximation
Definition: dudley/src/ElementFile.h:163
index_t * Color
Definition: dudley/src/ElementFile.h:138
void swapTable(ElementFile *other)
Definition: dudley/src/ElementFile.cpp:151
void relabelNodes(const index_t *newNode, index_t offset)
Definition: dudley/src/ElementFile.cpp:238
void setTags(int newTag, const escript::Data &mask)
sets element tags to newTag where mask > 0
Definition: dudley/src/ElementFile.cpp:193
const char * ename
name of element type
Definition: dudley/src/ElementFile.h:156
int numShapes
number of shape functions
Definition: dudley/src/ElementFile.h:159
index_t * Nodes
Nodes[INDEX(k, i, numNodes)] is the k-th node in the i-th element.
Definition: dudley/src/ElementFile.h:133
void markNodes(std::vector< short > &mask, index_t offset) const
Definition: dudley/src/ElementFile.cpp:228
index_t * Id
Definition: dudley/src/ElementFile.h:118
void updateTagList()
Definition: dudley/src/ElementFile.h:175
int numDim
number of spatial dimensions of the domain
Definition: dudley/src/ElementFile.h:147
int * Tag
Tag[i] is the tag of element i.
Definition: dudley/src/ElementFile.h:121
void createColoring(dim_t numNodes, const index_t *degreeOfFreedom)
Definition: ElementFile_createColoring.cpp:25
ElementFile(ElementTypeId etype, escript::JMPI mpiInfo)
Definition: dudley/src/ElementFile.cpp:25
escript::JMPI MPIInfo
Definition: dudley/src/ElementFile.h:110
ElementTypeId etype
element type ID
Definition: dudley/src/ElementFile.h:153
Definition: dudley/src/NodeFile.h:40
Data represents a collection of datapoints.
Definition: Data.h:64
void setValuesInUse(const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
Definition: dudley/src/Util.cpp:224
IndexPair getMinMaxInt(int dim, dim_t N, const index_t *values)
Definition: dudley/src/Util.cpp:159
A suite of factory methods for creating 2D and 3D dudley domains.
Definition: dudley/src/Assemble.h:32
ElementTypeId
Definition: ElementType.h:25
index_t dim_t
Definition: DataTypes.h:66
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
Definition: dudley/src/ElementFile.h:29
ElementFile_Jacobians()
Definition: dudley/src/ElementFile_jacobians.cpp:24
double * absD
used to compute volume
Definition: dudley/src/ElementFile.h:44
double quadweight
used to compute volume
Definition: dudley/src/ElementFile.h:46
int numShapes
number of shape functions
Definition: dudley/src/ElementFile.h:40
dim_t numElements
number of elements
Definition: dudley/src/ElementFile.h:42
int numQuad
number of quadrature nodes used to calculate jacobians
Definition: dudley/src/ElementFile.h:38
~ElementFile_Jacobians()
Definition: dudley/src/ElementFile_jacobians.cpp:35
double * DSDX
Definition: dudley/src/ElementFile.h:49
int status
status of mesh when jacobians were updated last time
Definition: dudley/src/ElementFile.h:34
int numDim
number of spatial dimensions
Definition: dudley/src/ElementFile.h:36