escript  Revision_
Public Types | Public Member Functions | List of all members
escript::AbstractDomain Class Referenceabstract

Base class for all escript domains. More...

#include <AbstractDomain.h>

Inheritance diagram for escript::AbstractDomain:
escript::AbstractContinuousDomain escript::NullDomain dudley::DudleyDomain finley::FinleyDomain ripley::RipleyDomain speckley::SpeckleyDomain escript::TestDomain ripley::Brick ripley::Rectangle speckley::Brick speckley::Rectangle ripley::MultiBrick ripley::MultiRectangle

Public Types

typedef int StatusType
 

Public Member Functions

Domain_ptr getPtr ()
 Returns smart pointer which is managing this object. If one does not exist yet it creates one. More...
 
const_Domain_ptr getPtr () const
 
virtual ~AbstractDomain ()
 Destructor for AbstractDomain. More...
 
virtual JMPI getMPI () const =0
 returns a shared pointer to the MPI information wrapper for this domain More...
 
virtual int getMPISize () const =0
 return the number of processors used for this domain More...
 
virtual int getMPIRank () const =0
 return the number MPI rank of this processor More...
 
virtual void MPIBarrier () const =0
 If compiled for MPI then execute an MPI_Barrier, else do nothing. More...
 
virtual bool onMasterProcessor () const =0
 Return true if on MPI master, else false. More...
 
virtual MPI_Comm getMPIComm () const =0
 get the communicator for this domain. Returns an integer on non-MPI builds Routine must be implemented by the DomainAdapter. More...
 
virtual bool isValidFunctionSpaceType (int functionSpaceType) const =0
 Returns true if the given integer is a valid function space type for this domain. More...
 
virtual std::string getDescription () const =0
 Return a description for this domain. More...
 
virtual std::string functionSpaceTypeAsString (int functionSpaceType) const =0
 Return a description for the given function space type code. More...
 
virtual int getDim () const =0
 Returns the spatial dimension of the domain. More...
 
virtual bool operator== (const AbstractDomain &other) const =0
 Return true if given domains are equal. More...
 
virtual bool operator!= (const AbstractDomain &other) const =0
 Return true if given domains are not equal. More...
 
virtual void write (const std::string &filename) const =0
 Writes the domain to an external file filename. More...
 
virtual void dump (const std::string &filename) const =0
 dumps the domain to an external file filename. More...
 
virtual std::pair< int, DataTypes::dim_tgetDataShape (int functionSpaceCode) const =0
 Returns the number of data points per sample, and the number of samples as a pair. More...
 
virtual int getTagFromSampleNo (int functionSpaceType, DataTypes::index_t sampleNo) const =0
 Return the tag key for the given sample number. More...
 
virtual void setTagMap (const std::string &name, int tag)=0
 sets a map from a clear tag name to a tag key More...
 
virtual int getTag (const std::string &name) const =0
 Return the tag key for tag name. More...
 
virtual bool isValidTagName (const std::string &name) const
 Returns True if name is a defined tag name. More...
 
virtual std::string showTagNames () const =0
 Returns all tag names in a single string sperated by commas. More...
 
virtual const DataTypes::dim_tborrowSampleReferenceIDs (int functionSpaceType) const =0
 Returns a borrowed pointer to the sample reference number id list. More...
 
virtual void setNewX (const escript::Data &arg)=0
 Assigns new location to the domain. More...
 
virtual void interpolateOnDomain (escript::Data &target, const escript::Data &source) const =0
 Interpolates data given on source onto target where source and target have to be given on the same domain. More...
 
virtual bool probeInterpolationOnDomain (int functionSpaceType_source, int functionSpaceType_target) const =0
 True if interpolation is possible from source to target. More...
 
virtual signed char preferredInterpolationOnDomain (int functionSpaceType_source, int functionSpaceType_target) const =0
 Preferred direction of interpolation. If you really need to test for a particular direction, then use probeInterpolation. More...
 
virtual bool commonFunctionSpace (const std::vector< int > &fs, int &resultcode) const =0
 given a vector of FunctionSpace type codes, pass back a code which then can all be interpolated to. More...
 
virtual void interpolateAcross (escript::Data &target, const escript::Data &source) const =0
 Interpolates data given on source onto target where source and target are given on different domains. More...
 
virtual bool probeInterpolationAcross (int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const =0
 
virtual escript::Data getX () const =0
 Returns locations in the domain. The function space is chosen appropriately. More...
 
virtual escript::Data getNormal () const =0
 Return boundary normals. The function space is chosen appropriately. More...
 
virtual escript::Data getSize () const =0
 Returns the local size of samples. The function space is chosen appropriately. More...
 
virtual void setToX (escript::Data &out) const =0
 Copies the location of data points on the domain into out. The actual function space to be considered is defined by out. out has to be defined on this. More...
 
virtual void setToNormal (escript::Data &out) const =0
 Copies the surface normals at data points into out. The actual function space to be considered is defined by out. out has to be defined on this. More...
 
virtual void setToSize (escript::Data &out) const =0
 Copies the size of samples into out. The actual function space to be considered is defined by out. out has to be defined on this. More...
 
virtual void setToGradient (escript::Data &grad, const escript::Data &arg) const =0
 Copies the gradient of arg into grad. The actual function space to be considered for the gradient is defined by grad. arg and grad have to be defined on this. More...
 
virtual bool ownSample (int fs_code, DataTypes::index_t id) const =0
 True if this rank owns the sample(id) Must be implemented by the Domain adapter. More...
 
virtual void setTags (int functionSpaceType, int newTag, const escript::Data &mask) const =0
 assigns new tag newTag to all samples of functionspace with a positive value of mask for any its sample point. More...
 
virtual bool isCellOriented (int functionSpaceCode) const =0
 returns true if data on this domain and a function space of type functionSpaceCode has to considered as cell centered data. More...
 
virtual StatusType getStatus () const
 Returns a status indicator of the domain. The status identifier should be unique over the live time if the object but may be updated if changes to the domain happen, e.g. modifications to its geometry. More...
 
void throwStandardException (const std::string &functionName) const
 Throw a standard exception. This function is called if any attempt is made to use a base class function. More...
 
virtual int getNumberOfTagsInUse (int functionSpaceCode) const =0
 returns the number of tags in use and a pointer to an array with the number of tags in use More...
 
virtual const int * borrowListOfTagsInUse (int functionSpaceCode) const =0
 
virtual bool canTag (int functionspacecode) const =0
 Checks if this domain allows tags for the specified functionSpaceCode. More...
 
virtual int getApproximationOrder (const int functionSpaceCode) const =0
 returns the approximation order used for a function space functionSpaceCode More...
 
virtual bool supportsContactElements () const =0
 
virtual bool supportsFilter (const boost::python::tuple &t) const
 true if this domain can handle to specified tuple of filter options. More...
 
virtual escript::Data randomFill (const DataTypes::ShapeType &shape, const FunctionSpace &what, long seed, const boost::python::tuple &filter) const =0
 Fills the data object with filtered random values. More...
 

Detailed Description

Base class for all escript domains.

Member Typedef Documentation

◆ StatusType

Constructor & Destructor Documentation

◆ ~AbstractDomain()

virtual escript::AbstractDomain::~AbstractDomain ( )
inlinevirtual

Member Function Documentation

◆ borrowListOfTagsInUse()

virtual const int* escript::AbstractDomain::borrowListOfTagsInUse ( int  functionSpaceCode) const
pure virtual

◆ borrowSampleReferenceIDs()

virtual const DataTypes::dim_t* escript::AbstractDomain::borrowSampleReferenceIDs ( int  functionSpaceType) const
pure virtual

Returns a borrowed pointer to the sample reference number id list.

Parameters
functionSpaceTypeInput - The function space type.

Implemented in ripley::RipleyDomain, speckley::SpeckleyDomain, finley::FinleyDomain, dudley::DudleyDomain, ripley::MultiBrick, speckley::Rectangle, ripley::Rectangle, speckley::Brick, ripley::Brick, escript::TestDomain, and escript::NullDomain.

◆ canTag()

virtual bool escript::AbstractDomain::canTag ( int  functionspacecode) const
pure virtual

Checks if this domain allows tags for the specified functionSpaceCode.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

◆ commonFunctionSpace()

virtual bool escript::AbstractDomain::commonFunctionSpace ( const std::vector< int > &  fs,
int &  resultcode 
) const
pure virtual

given a vector of FunctionSpace type codes, pass back a code which then can all be interpolated to.

Note
This method must be called on the domain which the FunctionSpaces point to
Returns
true is result is valid, false if not

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

◆ dump()

virtual void escript::AbstractDomain::dump ( const std::string &  filename) const
pure virtual

dumps the domain to an external file filename.

This has to be implemented by the actual Domain adapter.

Implemented in ripley::RipleyDomain, speckley::SpeckleyDomain, finley::FinleyDomain, dudley::DudleyDomain, escript::NullDomain, ripley::MultiBrick, ripley::MultiRectangle, speckley::Brick, speckley::Rectangle, ripley::Rectangle, and ripley::Brick.

Referenced by BOOST_PYTHON_MODULE().

◆ functionSpaceTypeAsString()

virtual std::string escript::AbstractDomain::functionSpaceTypeAsString ( int  functionSpaceType) const
pure virtual

Return a description for the given function space type code.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

◆ getApproximationOrder()

virtual int escript::AbstractDomain::getApproximationOrder ( const int  functionSpaceCode) const
pure virtual

returns the approximation order used for a function space functionSpaceCode

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

◆ getDataShape()

virtual std::pair<int,DataTypes::dim_t> escript::AbstractDomain::getDataShape ( int  functionSpaceCode) const
pure virtual

Returns the number of data points per sample, and the number of samples as a pair.

This has to be implemented by the actual Domain adapter.

Parameters
functionSpaceCodeInput - Code for the function space type.
Returns
pair, first - number of data points per sample, second - number of samples

Implemented in finley::FinleyDomain, dudley::DudleyDomain, escript::AbstractContinuousDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::TestDomain, and escript::NullDomain.

◆ getDescription()

virtual std::string escript::AbstractDomain::getDescription ( ) const
pure virtual

◆ getDim()

virtual int escript::AbstractDomain::getDim ( ) const
pure virtual

Returns the spatial dimension of the domain.

This has to be implemented by the actual Domain adapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::TestDomain, and escript::NullDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ getMPI()

virtual JMPI escript::AbstractDomain::getMPI ( ) const
pure virtual

returns a shared pointer to the MPI information wrapper for this domain

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::TestDomain, and escript::NullDomain.

Referenced by escript::load().

◆ getMPIComm()

virtual MPI_Comm escript::AbstractDomain::getMPIComm ( ) const
pure virtual

get the communicator for this domain. Returns an integer on non-MPI builds Routine must be implemented by the DomainAdapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

Referenced by weipa::EscriptDataset::setDomain().

◆ getMPIRank()

virtual int escript::AbstractDomain::getMPIRank ( ) const
pure virtual

◆ getMPISize()

virtual int escript::AbstractDomain::getMPISize ( ) const
pure virtual

◆ getNormal()

virtual escript::Data escript::AbstractDomain::getNormal ( ) const
pure virtual

Return boundary normals. The function space is chosen appropriately.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ getNumberOfTagsInUse()

virtual int escript::AbstractDomain::getNumberOfTagsInUse ( int  functionSpaceCode) const
pure virtual

returns the number of tags in use and a pointer to an array with the number of tags in use

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

◆ getPtr() [1/2]

Domain_ptr escript::AbstractDomain::getPtr ( )

◆ getPtr() [2/2]

const_Domain_ptr escript::AbstractDomain::getPtr ( ) const

◆ getSize()

virtual escript::Data escript::AbstractDomain::getSize ( ) const
pure virtual

Returns the local size of samples. The function space is chosen appropriately.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ getStatus()

AbstractDomain::StatusType escript::AbstractDomain::getStatus ( ) const
virtual

Returns a status indicator of the domain. The status identifier should be unique over the live time if the object but may be updated if changes to the domain happen, e.g. modifications to its geometry.

This has to be implemented by the actual Domain adapter.

Reimplemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, and speckley::SpeckleyDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ getTag()

virtual int escript::AbstractDomain::getTag ( const std::string &  name) const
pure virtual

Return the tag key for tag name.

Parameters
nameInput - tag name

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ getTagFromSampleNo()

virtual int escript::AbstractDomain::getTagFromSampleNo ( int  functionSpaceType,
DataTypes::index_t  sampleNo 
) const
pure virtual

Return the tag key for the given sample number.

Parameters
functionSpaceTypeInput - The function space type.
sampleNoInput - The sample number.

Implemented in escript::TestDomain, and escript::NullDomain.

◆ getX()

virtual escript::Data escript::AbstractDomain::getX ( ) const
pure virtual

Returns locations in the domain. The function space is chosen appropriately.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ interpolateAcross()

virtual void escript::AbstractDomain::interpolateAcross ( escript::Data target,
const escript::Data source 
) const
pure virtual

Interpolates data given on source onto target where source and target are given on different domains.

This has to be implemented by the actual Domain adapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, speckley::Rectangle, speckley::Brick, escript::TestDomain, escript::NullDomain, ripley::MultiBrick, and ripley::MultiRectangle.

◆ interpolateOnDomain()

virtual void escript::AbstractDomain::interpolateOnDomain ( escript::Data target,
const escript::Data source 
) const
pure virtual

Interpolates data given on source onto target where source and target have to be given on the same domain.

This has to be implemented by the actual Domain adapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

◆ isCellOriented()

virtual bool escript::AbstractDomain::isCellOriented ( int  functionSpaceCode) const
pure virtual

returns true if data on this domain and a function space of type functionSpaceCode has to considered as cell centered data.

This has to be implemented by the actual Domain adapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

◆ isValidFunctionSpaceType()

virtual bool escript::AbstractDomain::isValidFunctionSpaceType ( int  functionSpaceType) const
pure virtual

Returns true if the given integer is a valid function space type for this domain.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::AbstractContinuousDomain, escript::NullDomain, and escript::TestDomain.

Referenced by escript::load().

◆ isValidTagName()

bool escript::AbstractDomain::isValidTagName ( const std::string &  name) const
virtual

Returns True if name is a defined tag name.

Parameters
nameInput - tag name

Reimplemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, and speckley::SpeckleyDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ MPIBarrier()

virtual void escript::AbstractDomain::MPIBarrier ( ) const
pure virtual

If compiled for MPI then execute an MPI_Barrier, else do nothing.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ onMasterProcessor()

virtual bool escript::AbstractDomain::onMasterProcessor ( ) const
pure virtual

◆ operator!=()

virtual bool escript::AbstractDomain::operator!= ( const AbstractDomain other) const
pure virtual

◆ operator==()

virtual bool escript::AbstractDomain::operator== ( const AbstractDomain other) const
pure virtual

◆ ownSample()

virtual bool escript::AbstractDomain::ownSample ( int  fs_code,
DataTypes::index_t  id 
) const
pure virtual

True if this rank owns the sample(id) Must be implemented by the Domain adapter.

Implemented in escript::NullDomain.

◆ preferredInterpolationOnDomain()

virtual signed char escript::AbstractDomain::preferredInterpolationOnDomain ( int  functionSpaceType_source,
int  functionSpaceType_target 
) const
pure virtual

Preferred direction of interpolation. If you really need to test for a particular direction, then use probeInterpolation.

Returns
0 for not possible, 1 for possible and preferred, -1 other direction preferred (does not mean this direction is possible)

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

◆ probeInterpolationAcross()

virtual bool escript::AbstractDomain::probeInterpolationAcross ( int  functionSpaceType_source,
const AbstractDomain targetDomain,
int  functionSpaceType_target 
) const
pure virtual

◆ probeInterpolationOnDomain()

virtual bool escript::AbstractDomain::probeInterpolationOnDomain ( int  functionSpaceType_source,
int  functionSpaceType_target 
) const
pure virtual

True if interpolation is possible from source to target.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, escript::NullDomain, and escript::TestDomain.

◆ randomFill()

virtual escript::Data escript::AbstractDomain::randomFill ( const DataTypes::ShapeType shape,
const FunctionSpace what,
long  seed,
const boost::python::tuple &  filter 
) const
pure virtual

◆ setNewX()

virtual void escript::AbstractDomain::setNewX ( const escript::Data arg)
pure virtual

Assigns new location to the domain.

This has to be implemented by the actual Domain adapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, escript::AbstractContinuousDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

◆ setTagMap()

virtual void escript::AbstractDomain::setTagMap ( const std::string &  name,
int  tag 
)
pure virtual

sets a map from a clear tag name to a tag key

Parameters
nameInput - tag name.
tagInput - tag key.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ setTags()

virtual void escript::AbstractDomain::setTags ( int  functionSpaceType,
int  newTag,
const escript::Data mask 
) const
pure virtual

assigns new tag newTag to all samples of functionspace with a positive value of mask for any its sample point.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

◆ setToGradient()

virtual void escript::AbstractDomain::setToGradient ( escript::Data grad,
const escript::Data arg 
) const
pure virtual

Copies the gradient of arg into grad. The actual function space to be considered for the gradient is defined by grad. arg and grad have to be defined on this.

This has to be implemented by the actual Domain adapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

◆ setToNormal()

virtual void escript::AbstractDomain::setToNormal ( escript::Data out) const
pure virtual

Copies the surface normals at data points into out. The actual function space to be considered is defined by out. out has to be defined on this.

This has to be implemented by the actual Domain adapter.

Implemented in ripley::RipleyDomain, finley::FinleyDomain, speckley::SpeckleyDomain, dudley::DudleyDomain, escript::NullDomain, ripley::MultiBrick, speckley::Rectangle, ripley::Rectangle, speckley::Brick, and ripley::Brick.

◆ setToSize()

virtual void escript::AbstractDomain::setToSize ( escript::Data out) const
pure virtual

Copies the size of samples into out. The actual function space to be considered is defined by out. out has to be defined on this.

This has to be implemented by the actual Domain adapter.

Implemented in ripley::RipleyDomain, finley::FinleyDomain, speckley::SpeckleyDomain, dudley::DudleyDomain, ripley::MultiBrick, escript::NullDomain, speckley::Rectangle, ripley::Rectangle, speckley::Brick, and ripley::Brick.

◆ setToX()

virtual void escript::AbstractDomain::setToX ( escript::Data out) const
pure virtual

Copies the location of data points on the domain into out. The actual function space to be considered is defined by out. out has to be defined on this.

This has to be implemented by the actual Domain adapter.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

◆ showTagNames()

virtual std::string escript::AbstractDomain::showTagNames ( ) const
pure virtual

Returns all tag names in a single string sperated by commas.

Implemented in finley::FinleyDomain, dudley::DudleyDomain, ripley::RipleyDomain, speckley::SpeckleyDomain, and escript::NullDomain.

Referenced by BOOST_PYTHON_MODULE().

◆ supportsContactElements()

virtual bool escript::AbstractDomain::supportsContactElements ( ) const
pure virtual

◆ supportsFilter()

bool escript::AbstractDomain::supportsFilter ( const boost::python::tuple &  t) const
virtual

true if this domain can handle to specified tuple of filter options.

Reimplemented in ripley::RipleyDomain, and speckley::SpeckleyDomain.

◆ throwStandardException()

void escript::AbstractDomain::throwStandardException ( const std::string &  functionName) const

◆ write()

virtual void escript::AbstractDomain::write ( const std::string &  filename) const
pure virtual

Writes the domain to an external file filename.

This has to be implemented by the actual Domain adapter.

Implemented in ripley::RipleyDomain, speckley::SpeckleyDomain, finley::FinleyDomain, dudley::DudleyDomain, escript::NullDomain, speckley::Brick, speckley::Rectangle, ripley::Rectangle, and ripley::Brick.


The documentation for this class was generated from the following files: