dudley/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 __DUDLEY_ELEMENTFILE_H__
#define __DUDLEY_ELEMENTFILE_H__
#include "Dudley.h"
#include "NodeFile.h"
#include "ElementType.h"
#include "Util.h"
namespace dudley {
struct ElementFile_Jacobians
{
ElementFile_Jacobians();
~ElementFile_Jacobians();
int status;
int numDim;
int numQuad;
int numShapes;
dim_t numElements;
double *absD;
double quadweight;
double* DSDX;
};
class ElementFile
{
public:
ElementFile(ElementTypeId etype, 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 print(const index_t* nodesId) const;
void distributeByRankOfDOF(const int* mpiRankOfDOF,
const index_t* nodesId);
void createColoring(dim_t numNodes, const index_t* degreeOfFreedom);
void optimizeOrdering();
void relabelNodes(const index_t* newNode, index_t offset);
void markNodes(std::vector<short>& mask, index_t offset) const;
void gather(const index_t* index, const ElementFile* in);
void setTags(int newTag, const escript::Data& mask);
ElementFile_Jacobians* borrowJacobians(const NodeFile* nodes,
bool reducedOrder) const;
inline std::pair<index_t,index_t> getNodeRange() const;
inline void updateTagList();
private:
void swapTable(ElementFile* other);
public:
escript::JMPI MPIInfo;
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;
int numDim;
int numLocalDim;
ElementTypeId etype;
const char *ename;
int numShapes;
private:
ElementFile_Jacobians* jacobians;
ElementFile_Jacobians* jacobians_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 dudley
#endif // __DUDLEY_ELEMENTFILE_H__
dudley::ElementFile::jacobians
ElementFile_Jacobians * jacobians
jacobians of the shape function used for solution approximation
Definition: dudley/src/ElementFile.h:162
dudley::Nodes
Definition: Dudley.h:52
dudley::ElementFile::Nodes
index_t * Nodes
Nodes[INDEX(k, i, numNodes)] is the k-th node in the i-th element.
Definition: dudley/src/ElementFile.h:132
dudley::ElementFile::MPIInfo
escript::JMPI MPIInfo
Definition: dudley/src/ElementFile.h:109
dudley::ElementFile::numNodes
int numNodes
number of nodes per element
Definition: dudley/src/ElementFile.h:129
dudley::ElementFile_Jacobians::~ElementFile_Jacobians
~ElementFile_Jacobians()
Definition: dudley/src/ElementFile_jacobians.cpp:34
dudley::util::getMinMaxInt
IndexPair getMinMaxInt(int dim, dim_t N, const index_t *values)
Definition: dudley/src/Util.cpp:158
dudley::ElementFile::ename
const char * ename
name of element type
Definition: dudley/src/ElementFile.h:155
dudley::ElementFile_Jacobians::numShapes
int numShapes
number of shape functions
Definition: dudley/src/ElementFile.h:39
dudley::ElementFile::numLocalDim
int numLocalDim
dimension of the element e.g. 2 for a line in 2D or 3D
Definition: dudley/src/ElementFile.h:149
dudley::ElementFile::etype
ElementTypeId etype
element type ID
Definition: dudley/src/ElementFile.h:152
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
dudley::ElementFile_Jacobians::numQuad
int numQuad
number of quadrature nodes used to calculate jacobians
Definition: dudley/src/ElementFile.h:37
NodeFile.h
Dudley.h
dudley::ElementFile_Jacobians::numDim
int numDim
number of spatial dimensions
Definition: dudley/src/ElementFile.h:35
dudley::ElementFile::Id
index_t * Id
Definition: dudley/src/ElementFile.h:117
dudley::ElementFile_Jacobians::DSDX
double * DSDX
Definition: dudley/src/ElementFile.h:48
dudley::util::setValuesInUse
void setValuesInUse(const int *values, dim_t numValues, std::vector< int > &valuesInUse, escript::JMPI mpiinfo)
Definition: dudley/src/Util.cpp:223
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
dudley::ElementFile_Jacobians::ElementFile_Jacobians
ElementFile_Jacobians()
Definition: dudley/src/ElementFile_jacobians.cpp:23
dudley::ElementFile::numDim
int numDim
number of spatial dimensions of the domain
Definition: dudley/src/ElementFile.h:146
dudley::ElementFile::numShapes
int numShapes
number of shape functions
Definition: dudley/src/ElementFile.h:158
dudley::ElementFile::Color
index_t * Color
Definition: dudley/src/ElementFile.h:137
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:63
dudley::ElementFile_Jacobians::quadweight
double quadweight
used to compute volume
Definition: dudley/src/ElementFile.h:45
dudley::ElementTypeId
ElementTypeId
Definition: ElementType.h:24
dudley::ElementFile::jacobians_reducedQ
ElementFile_Jacobians * jacobians_reducedQ
Definition: dudley/src/ElementFile.h:166
dudley::ElementFile
Definition: dudley/src/ElementFile.h:51
dudley::ElementFile::getNodeRange
std::pair< index_t, index_t > getNodeRange() const
Definition: dudley/src/ElementFile.h:169
dudley
A suite of factory methods for creating 2D and 3D dudley domains.
Definition: dudley/src/Assemble.h:31
ElementType.h
dudley::ElementFile::updateTagList
void updateTagList()
Definition: dudley/src/ElementFile.h:174
dudley::util::gather
void gather(int len, const index_t *index, int numData, const double *in, double *out)
Definition: dudley/src/Util.cpp:43
dudley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: dudley/src/ElementFile.h:123
dudley::ElementFile_Jacobians::status
int status
status of mesh when jacobians were updated last time
Definition: dudley/src/ElementFile.h:33
dudley::ElementFile_Jacobians
Definition: dudley/src/ElementFile.h:27
dudley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: dudley/src/ElementFile.h:143
dudley::ElementFile::tagsInUse
std::vector< int > tagsInUse
array of tags which are actually used
Definition: dudley/src/ElementFile.h:126
dudley::NodeFile
Definition: dudley/src/NodeFile.h:38
dudley::ElementFile_Jacobians::absD
double * absD
used to compute volume
Definition: dudley/src/ElementFile.h:43
dudley::ElementFile::minColor
index_t minColor
minimum color value
Definition: dudley/src/ElementFile.h:140
Util.h
dudley::ElementFile::numElements
dim_t numElements
number of elements
Definition: dudley/src/ElementFile.h:112
dudley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: dudley/src/ElementFile.h:120
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:64
dudley::ElementFile_Jacobians::numElements
dim_t numElements
number of elements
Definition: dudley/src/ElementFile.h:41