escript  Revision_
finley/src/ElementFile.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 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 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 #ifndef __FINLEY_ELEMENTFILE_H__
18 #define __FINLEY_ELEMENTFILE_H__
19 
20 #include "Finley.h"
21 #include "NodeFile.h"
22 #include "ReferenceElementSets.h"
23 #include "Util.h"
24 
25 namespace finley {
26 
28 {
31 
33  int status;
35  int numDim;
42  int numSides;
44  const int* offsets;
46  int numSub;
51  const int* node_selection;
55  double* volume;
58  double* DSDX;
59 };
60 
62 {
63 public:
65  escript::JMPI mpiInfo);
66  ~ElementFile();
67 
69  void allocTable(dim_t NE);
70 
72  void freeTable();
73 
76  void copyTable(index_t offset, index_t nodeOffset, index_t idOffset,
77  const ElementFile* in);
78 
80  void distributeByRankOfDOF(const std::vector<int>& mpiRankOfDOF,
81  index_t* nodesId);
82 
85  void createColoring(const IndexVector& dofMap);
86 
88  void optimizeOrdering();
89 
92  void relabelNodes(const IndexVector& newNode, index_t offset);
93 
94  void markNodes(std::vector<short>& mask, int offset, bool useLinear);
95 
96  void gather(const index_t* index, const ElementFile* in);
97 
98  void scatter(index_t* index, const ElementFile* in);
99 
100  void setTags(const int newTag, const escript::Data& mask);
101 
102  ElementFile_Jacobians* borrowJacobians(const NodeFile*, bool, bool) const;
103 
106  inline std::pair<index_t,index_t> getNodeRange() const;
107 
110  inline void updateTagList();
111 
112 private:
113  void swapTable(ElementFile* other);
114 
115 public:
117 
126 
128  int* Tag;
129 
131  int* Owner;
132 
134  std::vector<int> tagsInUse;
135 
137  int numNodes;
138 
144 
150 
153 
156 
159 
163 
167 
171 };
172 
173 inline std::pair<index_t,index_t> ElementFile::getNodeRange() const
174 {
175  return util::getMinMaxInt(numNodes, numElements, Nodes);
176 }
177 
179 {
180  util::setValuesInUse(Tag, numElements, tagsInUse, MPIInfo);
181 }
182 
183 } // namespace finley
184 
185 #endif // __FINLEY_ELEMENTFILE_H__
186 
index_t * Nodes
Definition: finley/src/ElementFile.h:143
~ElementFile_Jacobians()
Definition: finley/src/ElementFile_jacobians.cpp:33
int status
status of mesh when jacobians were updated last time
Definition: finley/src/ElementFile.h:33
escript::JMPI MPIInfo
Definition: finley/src/ElementFile.h:116
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition: ReferenceElementSets.h:79
const_ReferenceElementSet_ptr referenceElementSet
the reference element to be used
Definition: finley/src/ElementFile.h:119
ElementFile_Jacobians * jacobians
jacobians of the shape function used for solution approximation
Definition: finley/src/ElementFile.h:158
ElementFile_Jacobians(const_ShapeFunction_ptr basis)
Definition: finley/src/ElementFile_jacobians.cpp:22
Definition: Finley.h:63
index_t maxColor
maximum color value
Definition: finley/src/ElementFile.h:155
std::vector< index_t > IndexVector
Definition: DataTypes.h:62
int numQuadTotal
Definition: finley/src/ElementFile.h:40
Definition: finley/src/ElementFile.h:27
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
void setValuesInUse(const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
Definition: finley/src/Util.cpp:332
dim_t numElements
number of elements
Definition: finley/src/ElementFile.h:53
A suite of factory methods for creating various finley domains.
Definition: finley/src/Assemble.h:31
index_t minColor
minimum color value
Definition: finley/src/ElementFile.h:152
double * volume
local volume
Definition: finley/src/ElementFile.h:55
int numNodes
number of nodes per element
Definition: finley/src/ElementFile.h:137
index_t * Color
Definition: finley/src/ElementFile.h:149
std::vector< int > tagsInUse
array of tags which are actually used
Definition: finley/src/ElementFile.h:134
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
void updateTagList()
Definition: finley/src/ElementFile.h:178
int numSub
number of subelements
Definition: finley/src/ElementFile.h:46
index_t * Id
Definition: finley/src/ElementFile.h:125
IndexPair getMinMaxInt(int dim, dim_t N, const index_t *values)
Definition: finley/src/Util.cpp:267
Data represents a collection of datapoints.
Definition: Data.h:63
Definition: finley/src/NodeFile.h:40
const int * node_selection
Definition: finley/src/ElementFile.h:51
const int * offsets
offset to sides (borrowed reference)
Definition: finley/src/ElementFile.h:44
const_ShapeFunction_ptr BasisFunctions
basis function used
Definition: finley/src/ElementFile.h:37
ElementFile_Jacobians * jacobians_reducedQ
Definition: finley/src/ElementFile.h:166
int numDim
number of spatial dimensions
Definition: finley/src/ElementFile.h:35
boost::shared_ptr< const ShapeFunction > const_ShapeFunction_ptr
Definition: ShapeFunctions.h:99
double * DSDX
Definition: finley/src/ElementFile.h:58
void gather(int len, const index_t *index, int numData, const double *in, double *out)
Definition: dudley/src/Util.cpp:43
int numShapesTotal
total number of shape functions = BasisFunctions->numShapes * numSides
Definition: finley/src/ElementFile.h:48
int numSides
number of sides (=1 normal, =2 contact)
Definition: finley/src/ElementFile.h:42
ElementFile_Jacobians * jacobians_reducedS_reducedQ
Definition: finley/src/ElementFile.h:170
dim_t numElements
number of elements
Definition: finley/src/ElementFile.h:121
int * Tag
Tag[i] is the tag of element i.
Definition: finley/src/ElementFile.h:128
int * Owner
Owner[i] contains the rank that owns element i.
Definition: finley/src/ElementFile.h:131
std::pair< index_t, index_t > getNodeRange() const
Definition: finley/src/ElementFile.h:173
ElementFile_Jacobians * jacobians_reducedS
Definition: finley/src/ElementFile.h:162
index_t dim_t
Definition: DataTypes.h:64
Definition: finley/src/ElementFile.h:61