escript  Revision_4925
finley/src/ElementFile.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 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 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 
30 
32  int status;
34  int numDim;
41  int numSides;
43  const int* offsets;
45  int numSub;
50  const int* node_selection;
54  double* volume;
57  double* DSDX;
58 };
59 
61 {
62 public:
64  Esys_MPIInfo *mpiInfo);
65  ~ElementFile();
66 
67  void allocTable(int numElements);
68  void freeTable();
69 
70  void distributeByRankOfDOF(const std::vector<int>& mpiRankOfDOF, int *Id);
71  void createColoring(const std::vector<int>& dofMap);
73  void optimizeOrdering();
75  void relabelNodes(const std::vector<int>& newNode, int offset);
76  void markNodes(std::vector<short>& mask, int offset, bool useLinear);
77  void scatter(int* index, const ElementFile* in);
78  void gather(int* index, const ElementFile* in);
79  void copyTable(int offset, int nodeOffset, int idOffset,
80  const ElementFile* in);
81 
82  void markDOFsConnectedToRange(int* mask, int offset, int marker,
83  int firstDOF, int lastDOF,
84  const int *dofIndex, bool useLinear);
85 
86  void setTags(const int newTag, const escript::Data& mask);
87  ElementFile_Jacobians* borrowJacobians(const NodeFile*, bool, bool) const;
90  inline std::pair<int,int> getNodeRange() const;
91 
94  inline void updateTagList();
95 
96 private:
97  void swapTable(ElementFile* other);
98 
99 public:
101 
109  int *Id;
111  int *Tag;
113  int *Owner;
115  std::vector<int> tagsInUse;
117  int numNodes;
122  int *Nodes;
127  int *Color;
129  int minColor;
131  int maxColor;
143 };
144 
145 inline std::pair<int,int> ElementFile::getNodeRange() const
146 {
148 }
149 
150 
152 {
154 }
155 
156 } // namespace finley
157 
158 #endif // __FINLEY_ELEMENTFILE_H__
159 
void gather(int *index, const ElementFile *in)
Definition: finley/src/ElementFile.cpp:132
~ElementFile_Jacobians()
Definition: ElementFile_jacobians.cpp:33
int * Id
Definition: finley/src/ElementFile.h:109
Esys_MPIInfo * MPIInfo
Definition: finley/src/ElementFile.h:100
int status
status of mesh when jacobians were updated last time
Definition: finley/src/ElementFile.h:32
void scatter(int *index, const ElementFile *in)
Definition: finley/src/ElementFile.cpp:151
int maxColor
maximum color
Definition: finley/src/ElementFile.h:131
void copyTable(int offset, int nodeOffset, int idOffset, const ElementFile *in)
Definition: finley/src/ElementFile.cpp:112
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition: ReferenceElementSets.h:85
const_ReferenceElementSet_ptr referenceElementSet
the reference element to be used
Definition: finley/src/ElementFile.h:103
ElementFile_Jacobians * jacobians
jacobians of the shape function used for solution approximation
Definition: finley/src/ElementFile.h:133
void freeTable()
deallocates the element table within this element file
Definition: finley/src/ElementFile.cpp:97
int numElements
number of elements
Definition: finley/src/ElementFile.h:105
ElementFile_Jacobians(const_ShapeFunction_ptr basis)
Definition: ElementFile_jacobians.cpp:22
Struct that holds MPI communicator, rank, size and a tag counter.
Definition: Esys_MPI.h:48
std::pair< int, int > getMinMaxInt(int dim, int N, const int *values)
Definition: finley/src/Util.cpp:277
int numQuadTotal
Definition: finley/src/ElementFile.h:39
Definition: finley/src/ElementFile.h:27
void relabelNodes(const std::vector< int > &newNode, int offset)
assigns new node reference numbers to the elements
Definition: finley/src/ElementFile.cpp:212
void setTags(const int newTag, const escript::Data &mask)
Definition: finley/src/ElementFile.cpp:223
ElementFile(const_ReferenceElementSet_ptr refElementSet, Esys_MPIInfo *mpiInfo)
Definition: finley/src/ElementFile.cpp:33
void setValuesInUse(const int *values, const int numValues, std::vector< int > &valuesInUse, Esys_MPIInfo *mpiinfo)
Definition: finley/src/Util.cpp:346
int minColor
minimum color
Definition: finley/src/ElementFile.h:129
std::pair< int, int > getNodeRange() const
Definition: finley/src/ElementFile.h:145
void markDOFsConnectedToRange(int *mask, int offset, int marker, int firstDOF, int lastDOF, const int *dofIndex, bool useLinear)
Definition: finley/src/ElementFile.cpp:347
~ElementFile()
destructor
Definition: finley/src/ElementFile.cpp:60
double * volume
local volume
Definition: finley/src/ElementFile.h:54
int numNodes
number of nodes per element
Definition: finley/src/ElementFile.h:117
std::vector< int > tagsInUse
array of tags which are actually used
Definition: finley/src/ElementFile.h:115
void optimizeOrdering()
reorders the elements so that they are stored close to the nodes
Definition: finley/src/ElementFile.cpp:181
void updateTagList()
Definition: finley/src/ElementFile.h:151
int numSub
number of subelements
Definition: finley/src/ElementFile.h:45
void distributeByRankOfDOF(const std::vector< int > &mpiRankOfDOF, int *Id)
redistributes the elements including overlap by rank
Definition: finley/src/ElementFile.cpp:391
int * Color
Definition: finley/src/ElementFile.h:127
int numElements
number of elements
Definition: finley/src/ElementFile.h:52
Data represents a collection of datapoints.
Definition: Data.h:71
Definition: finley/src/NodeFile.h:31
void allocTable(int numElements)
allocates the element table within this element file to hold NE elements.
Definition: finley/src/ElementFile.cpp:71
const int * node_selection
Definition: finley/src/ElementFile.h:50
const int * offsets
offset to sides (borrowed reference)
Definition: finley/src/ElementFile.h:43
const_ShapeFunction_ptr BasisFunctions
basis function used
Definition: finley/src/ElementFile.h:36
ElementFile_Jacobians * jacobians_reducedQ
Definition: finley/src/ElementFile.h:139
int numDim
number of spatial dimensions
Definition: finley/src/ElementFile.h:34
void swapTable(ElementFile *other)
Definition: finley/src/ElementFile.cpp:168
boost::shared_ptr< const ShapeFunction > const_ShapeFunction_ptr
Definition: ShapeFunctions.h:99
double * DSDX
Definition: finley/src/ElementFile.h:57
int numShapesTotal
total number of shape functions = BasisFunctions->numShapes * numSides
Definition: finley/src/ElementFile.h:47
int numSides
number of sides (=1 normal, =2 contact)
Definition: finley/src/ElementFile.h:41
ElementFile_Jacobians * jacobians_reducedS_reducedQ
Definition: finley/src/ElementFile.h:142
int * Tag
Tag[i] is the tag of element i.
Definition: finley/src/ElementFile.h:111
void markNodes(std::vector< short > &mask, int offset, bool useLinear)
Definition: finley/src/ElementFile.cpp:323
void createColoring(const std::vector< int > &dofMap)
Tries to reduce the number of colours used to colour the elements.
Definition: finley/src/ElementFile.cpp:260
int * Nodes
Definition: finley/src/ElementFile.h:122
int * Owner
Owner[i] contains the rank that owns element i.
Definition: finley/src/ElementFile.h:113
ElementFile_Jacobians * borrowJacobians(const NodeFile *, bool, bool) const
Definition: ElementFile_jacobians.cpp:40
ElementFile_Jacobians * jacobians_reducedS
Definition: finley/src/ElementFile.h:136
Definition: finley/src/ElementFile.h:60