escript Revision_
finley/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 __FINLEY_ELEMENTFILE_H__
19#define __FINLEY_ELEMENTFILE_H__
20
21#include "Finley.h"
22#include "NodeFile.h"
24#include "Util.h"
25
26namespace finley {
27
61
63{
64public:
66 escript::JMPI mpiInfo);
68
70 void allocTable(dim_t NE);
71
73 void freeTable();
74
77 void copyTable(index_t offset, index_t nodeOffset, index_t idOffset,
78 const ElementFile* in);
79
81 void distributeByRankOfDOF(const std::vector<int>& mpiRankOfDOF,
82 index_t* nodesId);
83
86 void createColoring(const IndexVector& dofMap);
87
89 void optimizeOrdering();
90
93 void relabelNodes(const IndexVector& newNode, index_t offset);
94
95 void markNodes(std::vector<short>& mask, int offset, bool useLinear);
96
97 void gather(const index_t* index, const ElementFile* in);
98
99 void scatter(index_t* index, const ElementFile* in);
100
101 void setTags(const int newTag, const escript::Data& mask);
102
103 ElementFile_Jacobians* borrowJacobians(const NodeFile*, bool, bool) const;
104
107 inline std::pair<index_t,index_t> getNodeRange() const;
108
111 inline void updateTagList();
112
113private:
114 void swapTable(ElementFile* other);
115
116public:
118
127
129 int* Tag;
130
132 int* Owner;
133
135 std::vector<int> tagsInUse;
136
139
145
151
154
157
160
164
168
172};
173
174inline std::pair<index_t,index_t> ElementFile::getNodeRange() const
175{
177}
178
183
184} // namespace finley
185
186#endif // __FINLEY_ELEMENTFILE_H__
187
Data represents a collection of datapoints.
Definition Data.h:64
Definition finley/src/ElementFile.h:63
index_t * Nodes
Definition finley/src/ElementFile.h:144
index_t minColor
minimum color value
Definition finley/src/ElementFile.h:153
ElementFile(const_ReferenceElementSet_ptr refElementSet, escript::JMPI mpiInfo)
Definition finley/src/ElementFile.cpp:29
void freeTable()
deallocates the element table within an element file
Definition finley/src/ElementFile.cpp:91
ElementFile_Jacobians * jacobians_reducedQ
Definition finley/src/ElementFile.h:167
std::pair< index_t, index_t > getNodeRange() const
Definition finley/src/ElementFile.h:174
void setTags(const int newTag, const escript::Data &mask)
Definition finley/src/ElementFile.cpp:216
void swapTable(ElementFile *other)
Definition finley/src/ElementFile.cpp:161
void optimizeOrdering()
reorders the elements so that they are stored close to the nodes
Definition finley/src/ElementFile.cpp:174
index_t * Id
Definition finley/src/ElementFile.h:126
void scatter(index_t *index, const ElementFile *in)
Definition finley/src/ElementFile.cpp:144
index_t maxColor
maximum color value
Definition finley/src/ElementFile.h:156
escript::JMPI MPIInfo
Definition finley/src/ElementFile.h:117
int * Tag
Tag[i] is the tag of element i.
Definition finley/src/ElementFile.h:129
void copyTable(index_t offset, index_t nodeOffset, index_t idOffset, const ElementFile *in)
Definition finley/src/ElementFile.cpp:106
void relabelNodes(const IndexVector &newNode, index_t offset)
Definition finley/src/ElementFile.cpp:205
index_t * Color
Definition finley/src/ElementFile.h:150
std::vector< int > tagsInUse
array of tags which are actually used
Definition finley/src/ElementFile.h:135
ElementFile_Jacobians * jacobians_reducedS_reducedQ
Definition finley/src/ElementFile.h:171
void gather(const index_t *index, const ElementFile *in)
Definition finley/src/ElementFile.cpp:125
void updateTagList()
Definition finley/src/ElementFile.h:179
void distributeByRankOfDOF(const std::vector< int > &mpiRankOfDOF, index_t *nodesId)
redistributes the elements including overlap by rank
Definition finley/src/ElementFile.cpp:330
~ElementFile()
destructor
Definition finley/src/ElementFile.cpp:55
void allocTable(dim_t NE)
allocates the element table within an element file to hold NE elements
Definition finley/src/ElementFile.cpp:65
ElementFile_Jacobians * jacobians_reducedS
Definition finley/src/ElementFile.h:163
void createColoring(const IndexVector &dofMap)
Tries to reduce the number of colours used to colour the elements.
Definition finley/src/ElementFile.cpp:249
const_ReferenceElementSet_ptr referenceElementSet
the reference element to be used
Definition finley/src/ElementFile.h:120
int numNodes
number of nodes per element
Definition finley/src/ElementFile.h:138
ElementFile_Jacobians * borrowJacobians(const NodeFile *, bool, bool) const
Definition finley/src/ElementFile_jacobians.cpp:41
ElementFile_Jacobians * jacobians
jacobians of the shape function used for solution approximation
Definition finley/src/ElementFile.h:159
dim_t numElements
number of elements
Definition finley/src/ElementFile.h:122
void markNodes(std::vector< short > &mask, int offset, bool useLinear)
Definition finley/src/ElementFile.cpp:305
int * Owner
Owner[i] contains the rank that owns element i.
Definition finley/src/ElementFile.h:132
Definition finley/src/NodeFile.h:42
std::vector< index_t > IndexVector
Definition DataTypes.h:64
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:76
IndexPair getMinMaxInt(int dim, dim_t N, const index_t *values)
Definition finley/src/Util.cpp:278
void setValuesInUse(const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
Definition finley/src/Util.cpp:343
A suite of factory methods for creating various finley domains.
Definition finley/src/Assemble.h:32
boost::shared_ptr< const ShapeFunction > const_ShapeFunction_ptr
Definition ShapeFunctions.h:102
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition ReferenceElementSets.h:80
Definition finley/src/ElementFile.h:29
int status
status of mesh when jacobians were updated last time
Definition finley/src/ElementFile.h:34
const_ShapeFunction_ptr BasisFunctions
basis function used
Definition finley/src/ElementFile.h:38
int numSub
number of subelements
Definition finley/src/ElementFile.h:47
double * volume
local volume
Definition finley/src/ElementFile.h:56
double * DSDX
Definition finley/src/ElementFile.h:59
int numShapesTotal
total number of shape functions = BasisFunctions->numShapes * numSides
Definition finley/src/ElementFile.h:49
int numDim
number of spatial dimensions
Definition finley/src/ElementFile.h:36
~ElementFile_Jacobians()
Definition finley/src/ElementFile_jacobians.cpp:34
int numSides
number of sides (=1 normal, =2 contact)
Definition finley/src/ElementFile.h:43
const int * node_selection
Definition finley/src/ElementFile.h:52
const int * offsets
offset to sides (borrowed reference)
Definition finley/src/ElementFile.h:45
ElementFile_Jacobians(const_ShapeFunction_ptr basis)
Definition finley/src/ElementFile_jacobians.cpp:23
int numQuadTotal
Definition finley/src/ElementFile.h:41
dim_t numElements
number of elements
Definition finley/src/ElementFile.h:54