Escript  Revision_4320
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
escript::AbstractDomain Class Reference

#include <AbstractDomain.h>

Inheritance diagram for escript::AbstractDomain:
escript::AbstractContinuousDomain escript::NullDomain escript::TestDomain dudley::MeshAdapter finley::MeshAdapter ripley::RipleyDomain ripley::Brick ripley::Rectangle

Classes

struct  ValueBuffer

Public Types

typedef int StatusType
typedef struct ValueBuffer ValueBuffer
typedef std::map< int,
ValueBuffer
BufferMapType

Public Member Functions

Domain_ptr getPtr ()
 Returns smart pointer which is managing this object. If one does not exist yet it creates one.
const_Domain_ptr getPtr () const
 AbstractDomain ()
 Default constructor for AbstractDomain.
virtual ~AbstractDomain ()
 Destructor for AbstractDomain.
virtual int getMPISize () const
 return the number of processors used for this domain
virtual int getMPIRank () const
 return the number MPI rank of this processor
virtual void MPIBarrier () const
 If compiled for MPI then execute an MPI_Barrier, else do nothing.
virtual bool onMasterProcessor () const
 Return true if on MPI master, else false.
virtual unsigned int getMPIComm () const
 get the communicator for this domain. Returns 0 on non-MPI builds Routine must be implemented by the DomainAdapter
virtual bool isValidFunctionSpaceType (int functionSpaceType) const
 Returns true if the given integer is a valid function space type for this domain.
virtual std::string getDescription () const
 Return a description for this domain.
virtual std::string functionSpaceTypeAsString (int functionSpaceType) const
 Return a description for the given function space type code.
virtual int getDim () const
 Returns the spatial dimension of the domain.
virtual bool operator== (const AbstractDomain &other) const
 Return true if given domains are equal.
virtual bool operator!= (const AbstractDomain &other) const
virtual void write (const std::string &filename) const
 Writes the domain to an external file filename.
virtual void dump (const std::string &filename) const
 dumps the domain to an external file filename.
virtual std::pair< int, int > getDataShape (int functionSpaceCode) const
 Return the number of data points per sample, and the number of samples as a pair.
virtual int getTagFromSampleNo (int functionSpaceType, int sampleNo) const
 Return the tag key for the given sample number.
virtual void setTagMap (const std::string &name, int tag)
 sets a map from a clear tag name to a tag key
virtual int getTag (const std::string &name) const
 Return the tag key for tag name.
virtual bool isValidTagName (const std::string &name) const
 Returns True if name is a defined tag name.
virtual std::string showTagNames () const
 Returns all tag names in a single string sperated by commas.
virtual const int * borrowSampleReferenceIDs (int functionSpaceType) const
 Return a borrowed pointer to the sample reference number id list.
virtual void setNewX (const escript::Data &arg)
 Assigns new location to the domain.
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 domain.
virtual bool probeInterpolationOnDomain (int functionSpaceType_source, int functionSpaceType_target) const
 True if interpolation is possible from source to target.
virtual signed char preferredInterpolationOnDomain (int functionSpaceType_source, int functionSpaceType_target) const
 Preferred direction of interpolation.
virtual bool commonFunctionSpace (const std::vector< int > &fs, int &resultcode) const
 given a vector of FunctionSpace type codes, pass back a code which then can all be interpolated to.
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.
virtual bool probeInterpolationACross (int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const
virtual escript::Data getX () const
 Returns locations in the domain. The function space is chosen appropriately.
virtual escript::Data getNormal () const
 Return boundary normals. The function space is chosen appropriately.
virtual escript::Data getSize () const
 Returns the local size of samples. The function space is chosen appropriately.
virtual void setToX (escript::Data &out) const
 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.
virtual void setToNormal (escript::Data &out) const
 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.
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. out has to be defined on this.
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 defined by grad. arg and grad have to be defined on this.
virtual bool ownSample (int fs_code, index_t id) const
 True if this rank owns the sample(id) Must be implemented by the Domain adapter.
virtual void setTags (const int functionSpaceType, const 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 sample point.
virtual bool isCellOriented (int functionSpaceCode) const
 returns true if data on this domain and a function space of type functionSpaceCode has to considered as cell centered data.
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.
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.
virtual int getNumberOfTagsInUse (int functionSpaceCode) const
 return the number of tags in use and a pointer to an array with the number of tags in use
virtual const int * borrowListOfTagsInUse (int functionSpaceCode) const
virtual bool canTag (int functionspacecode) const
 Checks if this domain allows tags for the specified functionSpaceCode.
virtual int getApproximationOrder (const int functionSpaceCode) const
 returns the approximation order used for a function space functionSpaceCode
virtual bool supportsContactElements () const

Private Attributes

BufferMapType m_x_buffer
BufferMapType m_normal_buffer
BufferMapType m_size_buffer

Member Typedef Documentation

Constructor & Destructor Documentation

escript::AbstractDomain::AbstractDomain ( )

Default constructor for AbstractDomain.

Description: Default constructor for AbstractDomain. As the name suggests this is intended to be an abstract base class but by making it constructable we avoid a boost.python wrapper class. A call to almost any of the base class functions will throw an exception as they are not intended to be used directly, but are overridden by the underlying solver package which escript is linked to.

By default, this class is overridden by the class NullDomain.

Preconditions: Describe any preconditions.

Throws: Describe any exceptions thrown.

escript::AbstractDomain::~AbstractDomain ( )
virtual

Destructor for AbstractDomain.

Description: Destructor for AbstractDomain.

Member Function Documentation

const int * escript::AbstractDomain::borrowListOfTagsInUse ( int  functionSpaceCode) const
virtual
const int * escript::AbstractDomain::borrowSampleReferenceIDs ( int  functionSpaceType) const
virtual

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

Parameters
functionSpaceTypeInput - The function space type.

Reimplemented in ripley::RipleyDomain, finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, escript::NullDomain, ripley::Brick, and ripley::Rectangle.

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

Checks if this domain allows tags for the specified functionSpaceCode.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, escript::TestDomain, and escript::NullDomain.

bool escript::AbstractDomain::commonFunctionSpace ( const std::vector< int > &  fs,
int &  resultcode 
) const
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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, and escript::TestDomain.

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

dumps the domain to an external file filename.

This has to be implemented by the actual Domain adapter.

Reimplemented in ripley::RipleyDomain, finley::MeshAdapter, dudley::MeshAdapter, ripley::Brick, and ripley::Rectangle.

Referenced by BOOST_PYTHON_MODULE().

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

Return a description for the given function space type code.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, escript::TestDomain, and escript::NullDomain.

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

returns the approximation order used for a function space functionSpaceCode

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

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

Return 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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::AbstractContinuousDomain, escript::TestDomain, escript::NullDomain, and ripley::RipleyDomain.

std::string escript::AbstractDomain::getDescription ( ) const
virtual
int escript::AbstractDomain::getDim ( ) const
virtual

Returns the spatial dimension of the domain.

This has to be implemented by the actual Domain adapter.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, escript::NullDomain, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

unsigned int escript::AbstractDomain::getMPIComm ( ) const
virtual

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

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

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

return the number MPI rank of this processor

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE(), and weipa::EscriptDataset::setDomain().

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

return the number of processors used for this domain

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE(), and weipa::EscriptDataset::setDomain().

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

Return boundary normals. The function space is chosen appropriately.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

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

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, escript::TestDomain, and escript::NullDomain.

Domain_ptr escript::AbstractDomain::getPtr ( )
const_Domain_ptr escript::AbstractDomain::getPtr ( ) const
escript::Data escript::AbstractDomain::getSize ( ) const
virtual

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

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::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

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

Return the tag key for tag name.

Parameters
nameInput - tag name

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

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

Return the tag key for the given sample number.

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, escript::NullDomain, and ripley::RipleyDomain.

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

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, and escript::TestDomain.

Referenced by BOOST_PYTHON_MODULE().

void escript::AbstractDomain::interpolateACross ( escript::Data target,
const escript::Data source 
) const
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.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, escript::TestDomain, and escript::NullDomain.

void escript::AbstractDomain::interpolateOnDomain ( escript::Data target,
const escript::Data source 
) const
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.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, escript::TestDomain, and escript::NullDomain.

bool escript::AbstractDomain::isCellOriented ( int  functionSpaceCode) const
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.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

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

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, escript::AbstractContinuousDomain, escript::TestDomain, and escript::NullDomain.

Referenced by escript::load().

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::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

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

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

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

Return true if on MPI master, else false.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

bool escript::AbstractDomain::operator!= ( const AbstractDomain other) const
virtual
bool escript::AbstractDomain::operator== ( const AbstractDomain other) const
virtual
bool escript::AbstractDomain::ownSample ( int  fs_code,
index_t  id 
) const
virtual

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

Reimplemented in ripley::RipleyDomain, finley::MeshAdapter, dudley::MeshAdapter, ripley::Brick, and ripley::Rectangle.

signed char escript::AbstractDomain::preferredInterpolationOnDomain ( int  functionSpaceType_source,
int  functionSpaceType_target 
) const
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)

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

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

True if interpolation is possible from source to target.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, ripley::RipleyDomain, escript::TestDomain, and escript::NullDomain.

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

Assigns new location to the domain.

This has to be implemented by the actual Domain adapter.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::AbstractContinuousDomain, and ripley::RipleyDomain.

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

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

Parameters
nameInput - tag name.
tagInput - tag key.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

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

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

void escript::AbstractDomain::setToGradient ( escript::Data grad,
const escript::Data arg 
) const
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.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

void escript::AbstractDomain::setToNormal ( escript::Data out) const
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.

Reimplemented in ripley::RipleyDomain, finley::MeshAdapter, dudley::MeshAdapter, ripley::Brick, and ripley::Rectangle.

void escript::AbstractDomain::setToSize ( escript::Data out) const
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.

Reimplemented in ripley::RipleyDomain, finley::MeshAdapter, dudley::MeshAdapter, ripley::Brick, and ripley::Rectangle.

void escript::AbstractDomain::setToX ( escript::Data out) const
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.

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

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

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

Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and ripley::RipleyDomain.

Referenced by BOOST_PYTHON_MODULE().

bool escript::AbstractDomain::supportsContactElements ( ) const
virtual
void escript::AbstractDomain::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.

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

Writes the domain to an external file filename.

This has to be implemented by the actual Domain adapter.

Reimplemented in finley::MeshAdapter, and dudley::MeshAdapter.

Member Data Documentation

BufferMapType escript::AbstractDomain::m_normal_buffer
private
BufferMapType escript::AbstractDomain::m_size_buffer
private
BufferMapType escript::AbstractDomain::m_x_buffer
private

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