finley/src/ElementFile.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2017 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014 by Centre for Geoscience Computing (GeoComp)
*
*****************************************************************************/
#ifndef __FINLEY_ELEMENTFILE_H__
#define __FINLEY_ELEMENTFILE_H__
#include "Finley.h"
#include "NodeFile.h"
#include "ReferenceElementSets.h"
#include "Util.h"
namespace finley {
struct ElementFile_Jacobians
{
ElementFile_Jacobians(const_ShapeFunction_ptr basis);
~ElementFile_Jacobians();
int status;
int numDim;
const_ShapeFunction_ptr BasisFunctions;
int numQuadTotal;
int numSides;
const int* offsets;
int numSub;
int numShapesTotal;
const int* node_selection;
dim_t numElements;
double* volume;
double* DSDX;
};
class ElementFile
{
public:
ElementFile(const_ReferenceElementSet_ptr refElementSet,
escript::JMPI mpiInfo);
~ElementFile();
void allocTable(dim_t NE);
void freeTable();
void copyTable(index_t offset, index_t nodeOffset, index_t idOffset,
const ElementFile* in);
void distributeByRankOfDOF(const std::vector<int>& mpiRankOfDOF,
index_t* nodesId);
void createColoring(const IndexVector& dofMap);
void optimizeOrdering();
void relabelNodes(const IndexVector& newNode, index_t offset);
void markNodes(std::vector<short>& mask, int offset, bool useLinear);
void gather(const index_t* index, const ElementFile* in);
void scatter(index_t* index, const ElementFile* in);
void setTags(const int newTag, const escript::Data& mask);
ElementFile_Jacobians* borrowJacobians(const NodeFile*, bool, bool) const;
inline std::pair<index_t,index_t> getNodeRange() const;
inline void updateTagList();
private:
void swapTable(ElementFile* other);
public:
escript::JMPI MPIInfo;
const_ReferenceElementSet_ptr referenceElementSet;
dim_t numElements;
index_t* Id;
int* Tag;
int* Owner;
std::vector<int> tagsInUse;
int numNodes;
index_t* Nodes;
index_t* Color;
index_t minColor;
index_t maxColor;
ElementFile_Jacobians* jacobians;
ElementFile_Jacobians* jacobians_reducedS;
ElementFile_Jacobians* jacobians_reducedQ;
ElementFile_Jacobians* jacobians_reducedS_reducedQ;
};
inline std::pair<index_t,index_t> ElementFile::getNodeRange() const
{
return util::getMinMaxInt(numNodes, numElements, Nodes);
}
inline void ElementFile::updateTagList()
{
util::setValuesInUse(Tag, numElements, tagsInUse, MPIInfo);
}
} // namespace finley
#endif // __FINLEY_ELEMENTFILE_H__
finley::ElementFile::Nodes
index_t * Nodes
Definition: finley/src/ElementFile.h:143
finley::ElementFile_Jacobians::~ElementFile_Jacobians
~ElementFile_Jacobians()
Definition: finley/src/ElementFile_jacobians.cpp:33
finley::ElementFile_Jacobians::status
int status
status of mesh when jacobians were updated last time
Definition: finley/src/ElementFile.h:33
finley::ElementFile::MPIInfo
escript::JMPI MPIInfo
Definition: finley/src/ElementFile.h:116
finley::const_ReferenceElementSet_ptr
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition: ReferenceElementSets.h:79
finley::ElementFile::referenceElementSet
const_ReferenceElementSet_ptr referenceElementSet
the reference element to be used
Definition: finley/src/ElementFile.h:119
finley::ElementFile::jacobians
ElementFile_Jacobians * jacobians
jacobians of the shape function used for solution approximation
Definition: finley/src/ElementFile.h:158
finley::ElementFile_Jacobians::ElementFile_Jacobians
ElementFile_Jacobians(const_ShapeFunction_ptr basis)
Definition: finley/src/ElementFile_jacobians.cpp:22
finley::Nodes
Definition: Finley.h:63
finley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: finley/src/ElementFile.h:155
escript::DataTypes::IndexVector
std::vector< index_t > IndexVector
Definition: DataTypes.h:62
finley::ElementFile_Jacobians::numQuadTotal
int numQuadTotal
Definition: finley/src/ElementFile.h:40
finley::ElementFile_Jacobians
Definition: finley/src/ElementFile.h:27
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
finley::util::setValuesInUse
void setValuesInUse(const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
Definition: finley/src/Util.cpp:342
ReferenceElementSets.h
finley::ElementFile_Jacobians::numElements
dim_t numElements
number of elements
Definition: finley/src/ElementFile.h:53
finley
A suite of factory methods for creating various finley domains.
Definition: finley/src/Assemble.h:31
finley::ElementFile::minColor
index_t minColor
minimum color value
Definition: finley/src/ElementFile.h:152
finley::ElementFile_Jacobians::volume
double * volume
local volume
Definition: finley/src/ElementFile.h:55
finley::ElementFile::numNodes
int numNodes
number of nodes per element
Definition: finley/src/ElementFile.h:137
finley::ElementFile::Color
index_t * Color
Definition: finley/src/ElementFile.h:149
finley::ElementFile::tagsInUse
std::vector< int > tagsInUse
array of tags which are actually used
Definition: finley/src/ElementFile.h:134
Util.h
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
finley::ElementFile::updateTagList
void updateTagList()
Definition: finley/src/ElementFile.h:178
finley::ElementFile_Jacobians::numSub
int numSub
number of subelements
Definition: finley/src/ElementFile.h:46
finley::ElementFile::Id
index_t * Id
Definition: finley/src/ElementFile.h:125
finley::util::getMinMaxInt
IndexPair getMinMaxInt(int dim, dim_t N, const index_t *values)
Definition: finley/src/Util.cpp:277
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:63
finley::NodeFile
Definition: finley/src/NodeFile.h:40
finley::ElementFile_Jacobians::node_selection
const int * node_selection
Definition: finley/src/ElementFile.h:51
finley::ElementFile_Jacobians::offsets
const int * offsets
offset to sides (borrowed reference)
Definition: finley/src/ElementFile.h:44
finley::ElementFile_Jacobians::BasisFunctions
const_ShapeFunction_ptr BasisFunctions
basis function used
Definition: finley/src/ElementFile.h:37
finley::ElementFile::jacobians_reducedQ
ElementFile_Jacobians * jacobians_reducedQ
Definition: finley/src/ElementFile.h:166
finley::ElementFile_Jacobians::numDim
int numDim
number of spatial dimensions
Definition: finley/src/ElementFile.h:35
finley::const_ShapeFunction_ptr
boost::shared_ptr< const ShapeFunction > const_ShapeFunction_ptr
Definition: ShapeFunctions.h:99
finley::ElementFile_Jacobians::DSDX
double * DSDX
Definition: finley/src/ElementFile.h:58
dudley::util::gather
void gather(int len, const index_t *index, int numData, const double *in, double *out)
Definition: dudley/src/Util.cpp:43
finley::ElementFile_Jacobians::numShapesTotal
int numShapesTotal
total number of shape functions = BasisFunctions->numShapes * numSides
Definition: finley/src/ElementFile.h:48
finley::ElementFile_Jacobians::numSides
int numSides
number of sides (=1 normal, =2 contact)
Definition: finley/src/ElementFile.h:42
finley::ElementFile::jacobians_reducedS_reducedQ
ElementFile_Jacobians * jacobians_reducedS_reducedQ
Definition: finley/src/ElementFile.h:170
finley::ElementFile::numElements
dim_t numElements
number of elements
Definition: finley/src/ElementFile.h:121
finley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: finley/src/ElementFile.h:128
Finley.h
finley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: finley/src/ElementFile.h:131
finley::ElementFile::getNodeRange
std::pair< index_t, index_t > getNodeRange() const
Definition: finley/src/ElementFile.h:173
NodeFile.h
finley::ElementFile::jacobians_reducedS
ElementFile_Jacobians * jacobians_reducedS
Definition: finley/src/ElementFile.h:162
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:64
finley::ElementFile
Definition: finley/src/ElementFile.h:61