finley/src/FinleyDomain.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_DOMAIN_H__
#define __FINLEY_DOMAIN_H__
/****************************************************************************
Finley: Domain
A mesh is built from nodes and elements which describe the domain, surface,
and point sources (the latter are needed to establish links with other
codes, in particular particle codes). The nodes are stored in a NodeFile
and elements in ElementFiles. Finley domains have four ElementFiles
containing the elements, surface, contact and point sources, respectively.
Notice that the surface elements do not necessarily cover the entire
surface of the domain.
The element type is fixed by the reference element, see ReferenceElement.h.
The numbering of the nodes starts with 0.
Important: it is assumed that every node appears in at least one element or
surface element and that any node used in an element, surface element or as
a point is specified in the NodeFile, see also resolveNodeIds.
In some cases it is useful to refer to a mesh entirely built from
order 1 (=linear) elements. The linear version of the mesh can be
accessed by referring to the first few nodes of each element
(thanks to the way the nodes are ordered). As the numbering of
these nodes is not continuous a relabeling vector is introduced
in the NodeFile. This feature is not fully implemented yet.
All nodes and elements are tagged. The tag allows to group nodes and
elements. A typical application is to mark surface elements on a
certain portion of the domain with the same tag. All these surface
elements can then be assigned the same value e.g. for the pressure.
The spatial dimensionality is determined by the type of elements
used and can be queried using getDim(). Notice that the element type
also determines the type of surface elements to be used.
*****************************************************************************/
#include <finley/Finley.h>
#include <finley/ElementFile.h>
#include <finley/NodeFile.h>
#include <finley/Util.h>
#include <escript/AbstractContinuousDomain.h>
#include <escript/FunctionSpace.h>
#include <escript/FunctionSpaceFactory.h>
#ifdef ESYS_HAVE_PASO
#include <paso/SystemMatrixPattern.h>
#endif
#ifdef ESYS_HAVE_TRILINOS
#include <trilinoswrap/types.h>
#endif
#include <map>
#include <string>
#include <vector>
namespace finley {
typedef std::map<std::string, int> TagMap;
enum SystemMatrixType {
SMT_PASO = 1<<8,
SMT_TRILINOS = 1<<10,
SMT_COMPLEX = 1<<16,
SMT_UNROLL = 1<<17
};
class FinleyDomain : public escript::AbstractContinuousDomain
{
public:
static escript::Domain_ptr load(const std::string& filename);
static escript::Domain_ptr read(escript::JMPI mpiInfo,
const std::string& fileName,
int integrationOrder = -1,
int reducedIntegrationOrder = -1,
bool optimize = false);
static escript::Domain_ptr readGmsh(escript::JMPI mpiInfo,
const std::string& filename,
int numDim, int integrationOrder = -1,
int reducedIntegrationOrder = -1,
bool optimize = false,
bool useMacroElements = false);
static escript::Domain_ptr createRec4(dim_t NE0, dim_t NE1,
double L0, double L1,
bool periodic0, bool periodic1, int order,
int reducedOrder, bool useElementsOnFace,
bool optimize, escript::JMPI jmpi);
static escript::Domain_ptr createRec8(dim_t NE0, dim_t NE1,
double l0, double l1,
bool periodic0, bool periodic1, int order,
int reducedOrder, bool useElementsOnFace,
bool useFullElementOrder,
bool useMacroElements, bool optimize,
escript::JMPI jmpi);
static escript::Domain_ptr createHex8(dim_t NE0, dim_t NE1, dim_t NE2,
double l0, double l1, double l2,
bool periodic0, bool periodic1, bool periodic2,
int order, int reducedOrder,
bool useElementsOnFace,
bool optimize, escript::JMPI jmpi);
static escript::Domain_ptr createHex20(dim_t NE0, dim_t NE1, dim_t NE2,
double l0, double l1, double l2,
bool periodic0, bool periodic1, bool periodic2,
int order, int reducedOrder,
bool useElementsOnFace,
bool useFullElementOrder,
bool useMacroElements, bool optimize,
escript::JMPI jmpi);
FinleyDomain(const std::string& name, int numDim, escript::JMPI jmpi);
FinleyDomain(const FinleyDomain& in);
~FinleyDomain();
void addDiracPoints(const std::vector<double>& points,
const std::vector<int>& tags);
NodeFile* getNodes() const { return m_nodes; }
void setElements(ElementFile* elements);
ElementFile* getElements() const { return m_elements; }
void setFaceElements(ElementFile* elements);
ElementFile* getFaceElements() const { return m_faceElements; }
void setContactElements(ElementFile* elements);
ElementFile* getContactElements() const { return m_contactElements; }
void setPoints(ElementFile* elements);
ElementFile* getPoints() const { return m_points; }
virtual escript::JMPI getMPI() const { return m_mpiInfo; }
virtual int getMPISize() const { return m_mpiInfo->size; }
virtual int getMPIRank() const { return m_mpiInfo->rank; }
virtual void MPIBarrier() const;
virtual bool onMasterProcessor() const { return getMPIRank() == 0; }
MPI_Comm getMPIComm() const { return m_mpiInfo->comm; }
void write(const std::string& fileName) const;
void Print_Mesh_Info(bool full=false) const;
void dump(const std::string& fileName) const;
int getTagFromSampleNo(int functionSpaceType, index_t sampleNo) const;
const index_t* borrowSampleReferenceIDs(int functionSpaceType) const;
virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
virtual std::string getDescription() const;
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
void setFunctionSpaceTypeNames();
virtual int getContinuousFunctionCode() const;
virtual int getReducedContinuousFunctionCode() const;
virtual int getFunctionCode() const;
virtual int getReducedFunctionCode() const;
virtual int getFunctionOnBoundaryCode() const;
virtual int getReducedFunctionOnBoundaryCode() const;
virtual int getFunctionOnContactZeroCode() const;
virtual int getReducedFunctionOnContactZeroCode() const;
virtual int getFunctionOnContactOneCode() const;
virtual int getReducedFunctionOnContactOneCode() const;
virtual int getSolutionCode() const;
virtual int getReducedSolutionCode() const;
virtual int getDiracDeltaFunctionsCode() const;
typedef std::map<int, std::string> FunctionSpaceNamesMapType;
virtual int getDim() const { return m_nodes->numDim; }
virtual StatusType getStatus() const;
virtual dim_t getNumDataPointsGlobal() const;
virtual std::pair<int,dim_t> getDataShape(int functionSpaceCode) const;
virtual void setToX(escript::Data& arg) const;
virtual void setTagMap(const std::string& name, int tag);
virtual int getTag(const std::string& name) const;
virtual bool isValidTagName(const std::string& name) const;
virtual std::string showTagNames() const;
virtual void setNewX(const escript::Data& arg);
virtual void interpolateOnDomain(escript::Data& target,
const escript::Data& source) const;
virtual bool probeInterpolationOnDomain(int functionSpaceType_source,
int functionSpaceType_target) const;
virtual signed char preferredInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const;
bool commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const;
virtual void interpolateAcross(escript::Data& target, const escript::Data& source) const;
virtual bool probeInterpolationAcross(int functionSpaceType_source,
const escript::AbstractDomain& targetDomain,
int functionSpaceType_target) const;
virtual void setToNormal(escript::Data& out) const;
virtual void setToSize(escript::Data& out) const;
virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;
virtual void setToIntegrals(std::vector<escript::DataTypes::real_t>& integrals,
const escript::Data& arg) const;
virtual void setToIntegrals(std::vector<escript::DataTypes::cplx_t>& integrals,
const escript::Data& arg) const;
virtual int getSystemMatrixTypeId(const boost::python::object& options) const;
virtual int getTransportTypeId(int solver, int preconditioner, int package,
bool symmetry) const;
virtual bool isCellOriented(int functionSpaceCode) const;
virtual bool ownSample(int fsCode, index_t id) const;
virtual void addPDEToSystem(
escript::AbstractSystemMatrix& mat, escript::Data& rhs,
const escript::Data& A, const escript::Data& B,
const escript::Data& C, const escript::Data& D,
const escript::Data& X, const escript::Data& Y,
const escript::Data& d, const escript::Data& y,
const escript::Data& d_contact,
const escript::Data& y_contact,
const escript::Data& d_dirac,
const escript::Data& y_dirac) const;
virtual void addPDEToLumpedSystem(escript::Data& mat,
const escript::Data& D,
const escript::Data& d,
const escript::Data& d_dirac,
bool useHRZ) const;
virtual void addPDEToRHS(escript::Data& rhs, const escript::Data& X,
const escript::Data& Y, const escript::Data& y,
const escript::Data& y_contact,
const escript::Data& y_dirac) const;
virtual void addPDEToTransportProblem(
escript::AbstractTransportProblem& tp,
escript::Data& source, const escript::Data& M,
const escript::Data& A, const escript::Data& B,
const escript::Data& C, const escript::Data& D,
const escript::Data& X, const escript::Data& Y,
const escript::Data& d, const escript::Data& y,
const escript::Data& d_contact,
const escript::Data& y_contact,
const escript::Data& d_dirac,
const escript::Data& y_dirac) const;
escript::ASM_ptr newSystemMatrix(
int row_blocksize,
const escript::FunctionSpace& row_functionspace,
int column_blocksize,
const escript::FunctionSpace& column_functionspace,
int type) const;
escript::ATP_ptr newTransportProblem(int blocksize,
const escript::FunctionSpace& functionspace,
int type) const;
virtual escript::Data getX() const;
virtual escript::Data getNormal() const;
virtual escript::Data getSize() const;
virtual bool operator==(const escript::AbstractDomain& other) const;
virtual bool operator!=(const escript::AbstractDomain& other) const;
virtual void setTags(int functionSpaceType, int newTag,
const escript::Data& mask) const;
virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
virtual bool canTag(int functionSpaceCode) const;
virtual int getApproximationOrder(int functionSpaceCode) const;
virtual bool supportsContactElements() const { return true; }
virtual escript::Data randomFill(const escript::DataTypes::ShapeType& shape,
const escript::FunctionSpace& what, long seed,
const boost::python::tuple& filter) const;
const TagMap& getTagMap() const { return m_tagMap; }
void createMappings(const IndexVector& dofDistribution,
const IndexVector& nodeDistribution);
#ifdef ESYS_HAVE_PASO
paso::SystemMatrixPattern_ptr getPasoPattern(bool reducedRowOrder,
bool reducedColOrder) const;
#endif
#ifdef ESYS_HAVE_TRILINOS
esys_trilinos::const_TrilinosGraph_ptr getTrilinosGraph(bool reducedOrder) const;
#endif
void glueFaces(double safetyFactor, double tolerance, bool optimize);
void joinFaces(double safetyFactor, double tolerance, bool optimize);
static FinleyDomain* merge(const std::vector<const FinleyDomain*>& meshes);
private:
void prepare(bool optimize);
void setOrders();
void resolveNodeIds();
void relabelElementNodes(const IndexVector& newNode, index_t offset);
template<typename Scalar>
void setToIntegralsWorker(std::vector<Scalar>& integrals,
const escript::Data& arg) const;
#ifdef ESYS_HAVE_PASO
paso::SystemMatrixPattern_ptr makePasoPattern(bool reducedRowOrder,
bool reducedColOrder) const;
#endif
#ifdef ESYS_HAVE_TRILINOS
esys_trilinos::GraphType* createTrilinosGraph(bool reducedOrder) const;
#endif
void createColoring(const IndexVector& dofMap);
void distributeByRankOfDOF(const IndexVector& distribution);
void markNodes(std::vector<short>& mask, index_t offset, bool useLinear) const;
void optimizeDOFDistribution(IndexVector& distribution);
void optimizeDOFLabeling(const IndexVector& distribution);
void optimizeElementOrdering();
void findMatchingFaces(double safetyFactor, double tolerance, int* numPairs,
int* elem0, int* elem1, int* matchingNodes) const;
void updateTagList();
void printElementInfo(const ElementFile* e, const std::string& title,
const std::string& defaultType, bool full) const;
void writeElementInfo(std::ostream& stream, const ElementFile* e,
const std::string& defaultType) const;
escript::JMPI m_mpiInfo;
std::string m_name;
int approximationOrder;
int reducedApproximationOrder;
int integrationOrder;
int reducedIntegrationOrder;
NodeFile* m_nodes;
ElementFile* m_elements;
ElementFile* m_faceElements;
ElementFile* m_contactElements;
ElementFile* m_points;
TagMap m_tagMap;
#ifdef ESYS_HAVE_PASO
// pointer to the sparse matrix patterns
mutable paso::SystemMatrixPattern_ptr FullFullPattern;
mutable paso::SystemMatrixPattern_ptr FullReducedPattern;
mutable paso::SystemMatrixPattern_ptr ReducedFullPattern;
mutable paso::SystemMatrixPattern_ptr ReducedReducedPattern;
#endif
#ifdef ESYS_HAVE_TRILINOS
mutable esys_trilinos::TrilinosGraph_ptr m_fullGraph;
mutable esys_trilinos::TrilinosGraph_ptr m_reducedGraph;
#endif
static FunctionSpaceNamesMapType m_functionSpaceTypeNames;
};
} // end of namespace
#endif // __FINLEY_DOMAIN_H__
finley::FinleyDomain::setToSize
virtual void setToSize(escript::Data &out) const
copies the size of samples into out. The actual function space to be considered is defined by out...
Definition: finley/src/FinleyDomain.cpp:1819
finley::FinleyDomain::getPoints
ElementFile * getPoints() const
returns a pointer to this domain&#39;s point (nodal) element file
Definition: finley/src/FinleyDomain.h:332
escript::AbstractContinuousDomain
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:45
escript::FunctionSpace
Definition: FunctionSpace.h:34
finley::FinleyDomain::writeElementInfo
void writeElementInfo(std::ostream &stream, const ElementFile *e, const std::string &defaultType) const
Definition: finley/src/Mesh_write.cpp:33
finley::FinleyDomain::relabelElementNodes
void relabelElementNodes(const IndexVector &newNode, index_t offset)
Definition: finley/src/FinleyDomain.cpp:201
finley::SMT_UNROLL
Definition: finley/src/FinleyDomain.h:85
finley::FinleyDomain::newTransportProblem
escript::ATP_ptr newTransportProblem(int blocksize, const escript::FunctionSpace &functionspace, int type) const
creates a TransportProblem
Definition: finley/src/FinleyDomain.cpp:1963
finley::FinleyDomain::getSystemMatrixTypeId
virtual int getSystemMatrixTypeId(const boost::python::object &options) const
return the identifier of the matrix type to be used for the global stiffness matrix when a particular...
Definition: finley/src/FinleyDomain.cpp:2303
paso::util::l2
double l2(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:501
finley::FinleyDomain::setNewX
virtual void setNewX(const escript::Data &arg)
assigns new location to the domain
Definition: finley/src/FinleyDomain.cpp:1857
finley::FinleyDomain::getX
virtual escript::Data getX() const
returns locations in the FEM nodes
Definition: finley/src/FinleyDomain.cpp:2375
finley::FinleyDomain::Print_Mesh_Info
void Print_Mesh_Info(bool full=false) const
Definition: finley/src/Mesh_write.cpp:147
finley::SMT_PASO
Definition: finley/src/FinleyDomain.h:82
finley::TagMap
std::map< std::string, int > TagMap
Definition: finley/src/FinleyDomain.h:79
finley::FinleyDomain::getTagFromSampleNo
int getTagFromSampleNo(int functionSpaceType, index_t sampleNo) const
Return the tag key for the given sample number.
Definition: finley/src/FinleyDomain.cpp:2431
finley::FinleyDomain::getFaceElements
ElementFile * getFaceElements() const
returns a pointer to this domain&#39;s face element file
Definition: finley/src/FinleyDomain.h:308
finley::FinleyDomain::optimizeDOFDistribution
void optimizeDOFDistribution(IndexVector &distribution)
Definition: finley/src/Mesh_optimizeDOFDistribution.cpp:65
finley::FinleyDomain::m_points
ElementFile * m_points
the table of points (treated as elements of dimension 0)
Definition: finley/src/FinleyDomain.h:883
finley::FinleyDomain::glueFaces
void glueFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_glueFaces.cpp:32
finley::FinleyDomain::m_faceElements
ElementFile * m_faceElements
the table of face elements
Definition: finley/src/FinleyDomain.h:879
finley::FinleyDomain::setTags
virtual void setTags(int functionSpaceType, int newTag, const escript::Data &mask) const
assigns new tag newTag to all samples of functionspace with a positive value of mask for any its samp...
Definition: finley/src/FinleyDomain.cpp:2471
finley::FinleyDomain::setToIntegralsWorker
void setToIntegralsWorker(std::vector< Scalar > &integrals, const escript::Data &arg) const
Definition: finley/src/FinleyDomain.cpp:1710
finley::NodeFile::numDim
int numDim
number of spatial dimensions
Definition: finley/src/NodeFile.h:161
escript::Domain_ptr
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:36
finley::FinleyDomain::interpolateOnDomain
virtual void interpolateOnDomain(escript::Data &target, const escript::Data &source) const
interpolates data given on source onto target where source and target have to be given on the same do...
Definition: finley/src/FinleyDomain.cpp:1249
finley::FinleyDomain
FinleyDomain implements the AbstractContinuousDomain interface for the Finley library.
Definition: finley/src/FinleyDomain.h:93
finley::FinleyDomain::getNodes
NodeFile * getNodes() const
returns a pointer to this domain&#39;s node file
Definition: finley/src/FinleyDomain.h:284
finley::FinleyDomain::joinFaces
void joinFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_joinFaces.cpp:32
finley::FinleyDomain::setToIntegrals
virtual void setToIntegrals(std::vector< escript::DataTypes::real_t > &integrals, const escript::Data &arg) const
copies the integrals of the function defined by arg into integrals. arg has to be defined on this...
finley::FinleyDomain::m_mpiInfo
escript::JMPI m_mpiInfo
MPI information.
Definition: finley/src/FinleyDomain.h:867
finley::FinleyDomain::prepare
void prepare(bool optimize)
prepares the mesh for further use
Definition: finley/src/FinleyDomain.cpp:2684
finley::FinleyDomain::integrationOrder
int integrationOrder
Definition: finley/src/FinleyDomain.h:872
finley::FinleyDomain::functionSpaceTypeAsString
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const
Return a description for the given function space type code.
Definition: finley/src/FinleyDomain.cpp:930
finley::FinleyDomain::getElements
ElementFile * getElements() const
returns a pointer to this domain&#39;s element file
Definition: finley/src/FinleyDomain.h:296
finley::FinleyDomain::isValidFunctionSpaceType
virtual bool isValidFunctionSpaceType(int functionSpaceType) const
Returns true if the given integer is a valid function space type for this domain. ...
Definition: finley/src/FinleyDomain.cpp:941
finley::FinleyDomain::getDiracDeltaFunctionsCode
virtual int getDiracDeltaFunctionsCode() const
Return a DiracDeltaFunctions code.
Definition: finley/src/FinleyDomain.cpp:1038
escript::DataTypes::IndexVector
std::vector< index_t > IndexVector
Definition: DataTypes.h:62
finley::FinleyDomain::addPDEToSystem
virtual void addPDEToSystem(escript::AbstractSystemMatrix &mat, escript::Data &rhs, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y, const escript::Data &d, const escript::Data &y, const escript::Data &d_contact, const escript::Data &y_contact, const escript::Data &d_dirac, const escript::Data &y_dirac) const
adds a PDE onto the stiffness matrix mat and a rhs
Definition: finley/src/FinleyDomain.cpp:1137
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
finley::FinleyDomain::getFunctionCode
virtual int getFunctionCode() const
Return a function FunctionSpace code.
Definition: finley/src/FinleyDomain.cpp:988
finley::FinleyDomain::setToNormal
virtual void setToNormal(escript::Data &out) const
copies the surface normals at data points into out. The actual function space to be considered is def...
Definition: finley/src/FinleyDomain.cpp:1663
finley::FinleyDomain::createHex20
static escript::Domain_ptr createHex20(dim_t NE0, dim_t NE1, dim_t NE2, double l0, double l1, double l2, bool periodic0, bool periodic1, bool periodic2, int order, int reducedOrder, bool useElementsOnFace, bool useFullElementOrder, bool useMacroElements, bool optimize, escript::JMPI jmpi)
Creates a 3-dimensional rectangular domain with second order (Hex20 or Hex27) elements.
Definition: Mesh_hex20.cpp:38
finley::FinleyDomain::showTagNames
virtual std::string showTagNames() const
Returns all tag names in a single string sperated by commas.
Definition: finley/src/FinleyDomain.cpp:2529
finley::FinleyDomain::resolveNodeIds
void resolveNodeIds()
Definition: finley/src/FinleyDomain.cpp:2872
finley::FinleyDomain::markNodes
void markNodes(std::vector< short > &mask, index_t offset, bool useLinear) const
Definition: finley/src/FinleyDomain.cpp:192
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:42
finley::FinleyDomain::interpolateAcross
virtual void interpolateAcross(escript::Data &target, const escript::Data &source) const
interpolates data given on source onto target where source and target are given on different domains...
Definition: finley/src/FinleyDomain.cpp:1687
paso::M
static dim_t M
Definition: SparseMatrix_saveHB.cpp:37
finley::FinleyDomain::getSolutionCode
virtual int getSolutionCode() const
Return a Solution code.
Definition: finley/src/FinleyDomain.cpp:1028
finley::FinleyDomain::m_functionSpaceTypeNames
static FunctionSpaceNamesMapType m_functionSpaceTypeNames
Definition: finley/src/FinleyDomain.h:898
finley::FinleyDomain::probeInterpolationAcross
virtual bool probeInterpolationAcross(int functionSpaceType_source, const escript::AbstractDomain &targetDomain, int functionSpaceType_target) const
determines whether interpolation from source to target is possible.
Definition: finley/src/FinleyDomain.cpp:2279
finley::FinleyDomain::getDescription
virtual std::string getDescription() const
Return a description for this domain.
Definition: finley/src/FinleyDomain.cpp:925
finley
A suite of factory methods for creating various finley domains.
Definition: finley/src/Assemble.h:31
finley::FinleyDomain::getMPISize
virtual int getMPISize() const
returns the number of processors used for this domain
Definition: finley/src/FinleyDomain.h:344
finley::FinleyDomain::addPDEToTransportProblem
virtual void addPDEToTransportProblem(escript::AbstractTransportProblem &tp, escript::Data &source, const escript::Data &M, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y, const escript::Data &d, const escript::Data &y, const escript::Data &d_contact, const escript::Data &y_contact, const escript::Data &d_dirac, const escript::Data &y_dirac) const
adds a PDE onto a transport problem
Definition: finley/src/FinleyDomain.cpp:1208
paso::SystemMatrixPattern_ptr
boost::shared_ptr< SystemMatrixPattern > SystemMatrixPattern_ptr
Definition: SystemMatrixPattern.h:39
escript::ATP_ptr
boost::shared_ptr< AbstractTransportProblem > ATP_ptr
Definition: AbstractTransportProblem.h:160
finley::FinleyDomain::getReducedFunctionCode
virtual int getReducedFunctionCode() const
Return a function with reduced integration order FunctionSpace code.
Definition: finley/src/FinleyDomain.cpp:993
finley::FinleyDomain::readGmsh
static escript::Domain_ptr readGmsh(escript::JMPI mpiInfo, const std::string &filename, int numDim, int integrationOrder=-1, int reducedIntegrationOrder=-1, bool optimize=false, bool useMacroElements=false)
reads a gmsh mesh file.
Definition: finley/src/Mesh_readGmsh.cpp:1149
finley::FinleyDomain::optimizeElementOrdering
void optimizeElementOrdering()
redistributes elements to minimize communication during assemblage
Definition: finley/src/FinleyDomain.cpp:2963
finley::FinleyDomain::commonFunctionSpace
bool commonFunctionSpace(const std::vector< int > &fs, int &resultcode) const
given a vector of FunctionSpace typecodes, pass back a code which then can all be interpolated to...
Definition: finley/src/FinleyDomain.cpp:2020
finley::FinleyDomain::getSize
virtual escript::Data getSize() const
returns the element size
Definition: finley/src/FinleyDomain.cpp:2385
finley::FinleyDomain::getFunctionOnBoundaryCode
virtual int getFunctionOnBoundaryCode() const
Return a function on boundary FunctionSpace code.
Definition: finley/src/FinleyDomain.cpp:998
finley::FinleyDomain::onMasterProcessor
virtual bool onMasterProcessor() const
returns true if on MPI processor 0, else false
Definition: finley/src/FinleyDomain.h:362
finley::FinleyDomain::borrowListOfTagsInUse
virtual const int * borrowListOfTagsInUse(int functionSpaceCode) const
Definition: finley/src/FinleyDomain.cpp:2573
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
finley::FinleyDomain::distributeByRankOfDOF
void distributeByRankOfDOF(const IndexVector &distribution)
Definition: finley/src/FinleyDomain.cpp:2741
finley::FinleyDomain::findMatchingFaces
void findMatchingFaces(double safetyFactor, double tolerance, int *numPairs, int *elem0, int *elem1, int *matchingNodes) const
Definition: Mesh_findMatchingFaces.cpp:68
finley::FinleyDomain::setTagMap
virtual void setTagMap(const std::string &name, int tag)
sets a map from a clear tag name to a tag key
Definition: finley/src/FinleyDomain.cpp:2508
finley::FinleyDomain::m_name
std::string m_name
domain description
Definition: finley/src/FinleyDomain.h:869
finley::FinleyDomain::merge
static FinleyDomain * merge(const std::vector< const FinleyDomain *> &meshes)
Definition: Mesh_merge.cpp:24
finley::FinleyDomain::isValidTagName
virtual bool isValidTagName(const std::string &name) const
Returns true if name is a defined tag name.
Definition: finley/src/FinleyDomain.cpp:2524
finley::FinleyDomain::operator==
virtual bool operator==(const escript::AbstractDomain &other) const
comparison operators
Definition: finley/src/FinleyDomain.cpp:2285
finley::FinleyDomain::canTag
virtual bool canTag(int functionSpaceCode) const
Checks if this domain allows tags for the specified functionSpace code.
Definition: finley/src/FinleyDomain.cpp:2619
finley::FinleyDomain::probeInterpolationOnDomain
virtual bool probeInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
True if interpolation is possible from source to target.
Definition: finley/src/FinleyDomain.cpp:2141
finley::FinleyDomain::setFaceElements
void setFaceElements(ElementFile *elements)
replaces the face element file by elements
Definition: finley/src/FinleyDomain.cpp:126
finley::FinleyDomain::getReducedFunctionOnBoundaryCode
virtual int getReducedFunctionOnBoundaryCode() const
Return a function on boundary with reduced integration order FunctionSpace code.
Definition: finley/src/FinleyDomain.cpp:1003
finley::FinleyDomain::getDim
virtual int getDim() const
returns the dimensionality of this domain
Definition: finley/src/FinleyDomain.h:513
finley::FinleyDomain::addDiracPoints
void addDiracPoints(const std::vector< double > &points, const std::vector< int > &tags)
adds Dirac delta points. Do NOT call this at any time other than construction! Using them later creat...
Definition: Mesh_addPoints.cpp:48
finley::FinleyDomain::FunctionSpaceNamesMapType
std::map< int, std::string > FunctionSpaceNamesMapType
Definition: finley/src/FinleyDomain.h:508
finley::FinleyDomain::getMPI
virtual escript::JMPI getMPI() const
returns a reference to the MPI information wrapper for this domain
Definition: finley/src/FinleyDomain.h:338
escript::AbstractDomain::StatusType
int StatusType
Definition: AbstractDomain.h:48
finley::FinleyDomain::getApproximationOrder
virtual int getApproximationOrder(int functionSpaceCode) const
returns the approximation order used for a function space functionSpaceCode
Definition: finley/src/FinleyDomain.cpp:2643
finley::FinleyDomain::getContactElements
ElementFile * getContactElements() const
returns a pointer to this domain&#39;s contact element file
Definition: finley/src/FinleyDomain.h:320
finley::FinleyDomain::isCellOriented
virtual bool isCellOriented(int functionSpaceCode) const
returns true if data on this domain and a function space of type functionSpaceCode has to considered ...
Definition: finley/src/FinleyDomain.cpp:1995
finley::FinleyDomain::reducedApproximationOrder
int reducedApproximationOrder
Definition: finley/src/FinleyDomain.h:871
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:63
finley::FinleyDomain::createMappings
void createMappings(const IndexVector &dofDistribution, const IndexVector &nodeDistribution)
Definition: finley/src/FinleyDomain.cpp:183
finley::FinleyDomain::getDataShape
virtual std::pair< int, dim_t > getDataShape(int functionSpaceCode) const
Return the number of data points per sample, and the number of samples as a pair. ...
Definition: finley/src/FinleyDomain.cpp:1055
finley::FinleyDomain::getContinuousFunctionCode
virtual int getContinuousFunctionCode() const
Return a continuous FunctionSpace code.
Definition: finley/src/FinleyDomain.cpp:978
finley::NodeFile
Definition: finley/src/NodeFile.h:40
finley::FinleyDomain::getTag
virtual int getTag(const std::string &name) const
Return the tag key for tag name.
Definition: finley/src/FinleyDomain.cpp:2513
finley::FinleyDomain::reducedIntegrationOrder
int reducedIntegrationOrder
Definition: finley/src/FinleyDomain.h:873
finley::FinleyDomain::printElementInfo
void printElementInfo(const ElementFile *e, const std::string &title, const std::string &defaultType, bool full) const
Definition: finley/src/Mesh_write.cpp:52
finley::FinleyDomain::getReducedSolutionCode
virtual int getReducedSolutionCode() const
Return a ReducedSolution code.
Definition: finley/src/FinleyDomain.cpp:1033
finley::FinleyDomain::getTagMap
const TagMap & getTagMap() const
returns a reference to the tag name->value map
Definition: finley/src/FinleyDomain.h:798
finley::FinleyDomain::setElements
void setElements(ElementFile *elements)
replaces the element file by elements
Definition: finley/src/FinleyDomain.cpp:120
finley::FinleyDomain::getMPIRank
virtual int getMPIRank() const
returns the number MPI rank of this processor
Definition: finley/src/FinleyDomain.h:350
finley::FinleyDomain::createRec4
static escript::Domain_ptr createRec4(dim_t NE0, dim_t NE1, double L0, double L1, bool periodic0, bool periodic1, int order, int reducedOrder, bool useElementsOnFace, bool optimize, escript::JMPI jmpi)
Creates a 2-dimensional rectangular domain with first order (Rec4) elements in the rectangle [0...
Definition: Mesh_rec4.cpp:25
finley::FinleyDomain::optimizeDOFLabeling
void optimizeDOFLabeling(const IndexVector &distribution)
optimizes the labeling of the DOFs on each processor
Definition: finley/src/FinleyDomain.cpp:2791
finley::SMT_COMPLEX
Definition: finley/src/FinleyDomain.h:84
finley::FinleyDomain::setFunctionSpaceTypeNames
void setFunctionSpaceTypeNames()
Build the table of function space type names.
Definition: finley/src/FinleyDomain.cpp:948
finley::FinleyDomain::setOrders
void setOrders()
Definition: finley/src/FinleyDomain.cpp:144
finley::FinleyDomain::MPIBarrier
virtual void MPIBarrier() const
If compiled for MPI then execute an MPI_Barrier, else do nothing.
Definition: finley/src/FinleyDomain.cpp:113
finley::FinleyDomain::addPDEToLumpedSystem
virtual void addPDEToLumpedSystem(escript::Data &mat, const escript::Data &D, const escript::Data &d, const escript::Data &d_dirac, bool useHRZ) const
adds a PDE onto the lumped stiffness matrix matrix
Definition: finley/src/FinleyDomain.cpp:1170
MPI_Comm
int MPI_Comm
Definition: EsysMPI.h:41
finley::FinleyDomain::load
static escript::Domain_ptr load(const std::string &filename)
recovers domain from a dump file
Definition: finley/src/DomainFactory.cpp:490
finley::FinleyDomain::getMPIComm
MPI_Comm getMPIComm() const
get the communicator for this domain. Returns an integer on non-MPI builds Routine must be implemente...
Definition: finley/src/FinleyDomain.h:364
finley::FinleyDomain::read
static escript::Domain_ptr read(escript::JMPI mpiInfo, const std::string &fileName, int integrationOrder=-1, int reducedIntegrationOrder=-1, bool optimize=false)
reads a mesh from a fly file. For MPI parallel runs fans out the mesh to multiple processes...
Definition: finley/src/Mesh_read.cpp:152
finley::FinleyDomain::ownSample
virtual bool ownSample(int fsCode, index_t id) const
Definition: finley/src/FinleyDomain.cpp:1870
finley::FinleyDomain::getReducedFunctionOnContactZeroCode
virtual int getReducedFunctionOnContactZeroCode() const
Return a FunctionOnContactZero code with reduced integration order.
Definition: finley/src/FinleyDomain.cpp:1013
finley::FinleyDomain::setContactElements
void setContactElements(ElementFile *elements)
replaces the contact element file by elements
Definition: finley/src/FinleyDomain.cpp:132
escript::AbstractTransportProblem
Give a short description of what AbstractTransportProblem does.
Definition: AbstractTransportProblem.h:43
finley::FinleyDomain::setPoints
void setPoints(ElementFile *elements)
replaces the point element file by elements
Definition: finley/src/FinleyDomain.cpp:138
finley::FinleyDomain::getTransportTypeId
virtual int getTransportTypeId(int solver, int preconditioner, int package, bool symmetry) const
return the identifier of the transport problem type to be used when a particular solver, perconditioner, package and symmetric matrix is used.
Definition: finley/src/FinleyDomain.cpp:2363
finley::FinleyDomain::setToX
virtual void setToX(escript::Data &arg) const
copies the location of data points into arg. The domain of arg has to match this. has to be implement...
Definition: finley/src/FinleyDomain.cpp:1644
finley::FinleyDomain::getFunctionOnContactZeroCode
virtual int getFunctionOnContactZeroCode() const
Return a FunctionOnContactZero code.
Definition: finley/src/FinleyDomain.cpp:1008
finley::FinleyDomain::getStatus
virtual StatusType getStatus() const
Returns a status indicator of the domain. The status identifier should be unique over the live time i...
Definition: finley/src/FinleyDomain.cpp:2638
finley::FinleyDomain::setToGradient
virtual void setToGradient(escript::Data &grad, const escript::Data &arg) const
copies the gradient of arg into grad. The actual function space to be considered for the gradient is ...
Definition: finley/src/FinleyDomain.cpp:1753
finley::FinleyDomain::newSystemMatrix
escript::ASM_ptr newSystemMatrix(int row_blocksize, const escript::FunctionSpace &row_functionspace, int column_blocksize, const escript::FunctionSpace &column_functionspace, int type) const
creates a stiffness matrix and initializes it with zeros
Definition: finley/src/FinleyDomain.cpp:1900
finley::FinleyDomain::m_contactElements
ElementFile * m_contactElements
the table of contact elements
Definition: finley/src/FinleyDomain.h:881
escript::AbstractSystemMatrix
Base class for escript system matrices.
Definition: AbstractSystemMatrix.h:42
finley::FinleyDomain::m_elements
ElementFile * m_elements
the table of the elements
Definition: finley/src/FinleyDomain.h:877
finley::FinleyDomain::createRec8
static escript::Domain_ptr createRec8(dim_t NE0, dim_t NE1, double l0, double l1, bool periodic0, bool periodic1, int order, int reducedOrder, bool useElementsOnFace, bool useFullElementOrder, bool useMacroElements, bool optimize, escript::JMPI jmpi)
Creates a 2-dimensional rectangular domain with second order (Rec8 or Rec9) elements in the rectangle...
Definition: Mesh_rec8.cpp:25
finley::FinleyDomain::m_tagMap
TagMap m_tagMap
the tag map mapping names to tag keys
Definition: finley/src/FinleyDomain.h:885
finley::FinleyDomain::createColoring
void createColoring(const IndexVector &dofMap)
tries to reduce the number of colours for all element files
Definition: finley/src/FinleyDomain.cpp:2954
finley::FinleyDomain::updateTagList
void updateTagList()
regenerates list of tags in use for node file and element files
Definition: finley/src/FinleyDomain.cpp:2972
finley::FinleyDomain::getNormal
virtual escript::Data getNormal() const
returns boundary normals at the quadrature point on the face elements
Definition: finley/src/FinleyDomain.cpp:2380
finley::FinleyDomain::dump
void dump(const std::string &fileName) const
dumps the mesh to a file with the given name.
Definition: finley/src/FinleyDomain.cpp:562
escript::ASM_ptr
boost::shared_ptr< AbstractSystemMatrix > ASM_ptr
Definition: AbstractSystemMatrix.h:32
finley::FinleyDomain::createHex8
static escript::Domain_ptr createHex8(dim_t NE0, dim_t NE1, dim_t NE2, double l0, double l1, double l2, bool periodic0, bool periodic1, bool periodic2, int order, int reducedOrder, bool useElementsOnFace, bool optimize, escript::JMPI jmpi)
Creates a 3-dimensional rectangular domain with first order (Hex8) elements.
Definition: Mesh_hex8.cpp:39
finley::FinleyDomain::FinleyDomain
FinleyDomain(const std::string &name, int numDim, escript::JMPI jmpi)
Constructor for FinleyDomain.
Definition: finley/src/FinleyDomain.cpp:71
finley::SMT_TRILINOS
Definition: finley/src/FinleyDomain.h:83
finley::FinleyDomain::borrowSampleReferenceIDs
const index_t * borrowSampleReferenceIDs(int functionSpaceType) const
Return the reference number of the given sample number.
Definition: finley/src/FinleyDomain.cpp:2390
finley::SystemMatrixType
SystemMatrixType
Definition: finley/src/FinleyDomain.h:81
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:45
finley::FinleyDomain::getNumDataPointsGlobal
virtual dim_t getNumDataPointsGlobal() const
Return the number of data points summed across all MPI processes.
Definition: finley/src/FinleyDomain.cpp:1046
finley::FinleyDomain::getReducedFunctionOnContactOneCode
virtual int getReducedFunctionOnContactOneCode() const
Return a FunctionOnContactOne code with reduced integration order.
Definition: finley/src/FinleyDomain.cpp:1023
finley::FinleyDomain::write
void write(const std::string &fileName) const
writes the current mesh to a file with the given name in the fly file format.
Definition: finley/src/Mesh_write.cpp:87
finley::FinleyDomain::supportsContactElements
virtual bool supportsContactElements() const
Definition: finley/src/FinleyDomain.h:788
finley::FinleyDomain::getNumberOfTagsInUse
virtual int getNumberOfTagsInUse(int functionSpaceCode) const
returns the number of tags in use and a pointer to an array with the number of tags in use ...
Definition: finley/src/FinleyDomain.cpp:2542
finley::FinleyDomain::getFunctionOnContactOneCode
virtual int getFunctionOnContactOneCode() const
Return a FunctionOnContactOne code.
Definition: finley/src/FinleyDomain.cpp:1018
finley::FinleyDomain::addPDEToRHS
virtual void addPDEToRHS(escript::Data &rhs, const escript::Data &X, const escript::Data &Y, const escript::Data &y, const escript::Data &y_contact, const escript::Data &y_dirac) const
adds a PDE onto the stiffness matrix mat and a rhs
Definition: finley/src/FinleyDomain.cpp:1184
finley::FinleyDomain::approximationOrder
int approximationOrder
Definition: finley/src/FinleyDomain.h:870
finley::FinleyDomain::getReducedContinuousFunctionCode
virtual int getReducedContinuousFunctionCode() const
Return a continuous on reduced order nodes FunctionSpace code.
Definition: finley/src/FinleyDomain.cpp:983
finley::FinleyDomain::preferredInterpolationOnDomain
virtual signed char preferredInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
Preferred direction of interpolation. If you really need to test for a particular direction...
Definition: finley/src/FinleyDomain.cpp:2268
finley::FinleyDomain::m_nodes
NodeFile * m_nodes
the table of the nodes
Definition: finley/src/FinleyDomain.h:875
finley::FinleyDomain::~FinleyDomain
~FinleyDomain()
Destructor for FinleyDomain.
Definition: finley/src/FinleyDomain.cpp:104
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:64
finley::ElementFile
Definition: finley/src/ElementFile.h:61
finley::FinleyDomain::operator!=
virtual bool operator!=(const escript::AbstractDomain &other) const
Return true if given domains are not equal.
Definition: finley/src/FinleyDomain.cpp:2298
finley::FinleyDomain::randomFill
virtual escript::Data randomFill(const escript::DataTypes::ShapeType &shape, const escript::FunctionSpace &what, long seed, const boost::python::tuple &filter) const
Fills the data object with filtered random values.
Definition: finley/src/FinleyDomain.cpp:2670