escript::AbstractDomain Class Reference

#include <AbstractDomain.h>

Inheritance diagram for escript::AbstractDomain:

escript::AbstractContinuousDomain escript::NullDomain escript::TestDomain finley::MeshAdapter

List of all members.

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 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
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 void saveDX (const std::string &filename, const boost::python::dict &arg) const
 Saves a dictonary of Data objects to an OpenDX input file. The keywords are used as identifier.
virtual void saveVTK (const std::string &filename, const boost::python::dict &arg, const std::string &metadata, const std::string &metadata_schema) const
 Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier. metadata is string representing some meta data to be added. metadata_schema assign schema to namespaces used in the meta data.
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.

Private Attributes

BufferMapType m_x_buffer
BufferMapType m_normal_buffer
BufferMapType m_size_buffer

Classes

struct  ValueBuffer


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.

Referenced by finley::MeshAdapter::asAbstractDomain().

escript::AbstractDomain::~AbstractDomain (  )  [virtual]

Destructor for AbstractDomain.

Description: Destructor for AbstractDomain.


Member Function Documentation

Domain_ptr escript::AbstractDomain::getPtr (  ) 

const_Domain_ptr escript::AbstractDomain::getPtr (  )  const

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

return the number of processors used for this domain

Reimplemented in finley::MeshAdapter.

Referenced by BOOST_PYTHON_MODULE().

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

return the number MPI rank of this processor

Reimplemented in finley::MeshAdapter.

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.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

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

Return true if on MPI master, else false.

Reimplemented in finley::MeshAdapter.

Referenced by BOOST_PYTHON_MODULE().

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 escript::AbstractContinuousDomain, escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

Referenced by escript::load().

std::string escript::AbstractDomain::getDescription (  )  const [virtual]

Return a description for this domain.

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

References throwStandardException().

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

Return a description for the given function space type code.

Reimplemented in escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

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 escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

bool escript::AbstractDomain::operator== ( const AbstractDomain other  )  const [virtual]

Return true if given domains are equal.

Reimplemented in escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

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

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.

References throwStandardException().

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 finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

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:
functionSpaceCode Input - Code for the function space type.
Returns:
pair, first - number of data points per sample, second - number of samples

Reimplemented in escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

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

Return the tag key for the given sample number.

Parameters:
functionSpaceType Input - The function space type.
sampleNo Input - The sample number.

Reimplemented in escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

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

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

Parameters:
name Input - tag name.
tag Input - tag key.

Reimplemented in finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

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

Return the tag key for tag name.

Parameters:
name Input - tag name

Reimplemented in finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

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

Returns True if name is a defined tag name.

Parameters:
name Input - tag name

Reimplemented in finley::MeshAdapter.

Referenced by BOOST_PYTHON_MODULE().

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

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

Reimplemented in finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

const int * escript::AbstractDomain::borrowSampleReferenceIDs ( int  functionSpaceType  )  const [virtual]

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

Parameters:
functionSpaceType Input - The function space type.

Reimplemented in escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

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.

References throwStandardException().

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 escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

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

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 escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

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

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

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

Reimplemented in finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

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

Return boundary normals. The function space is chosen appropriately.

Reimplemented in finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

escript::Data escript::AbstractDomain::getSize (  )  const [virtual]

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

Reimplemented in finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

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.

References throwStandardException().

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 finley::MeshAdapter.

References throwStandardException().

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 finley::MeshAdapter.

References throwStandardException().

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.

References throwStandardException().

void escript::AbstractDomain::saveDX ( const std::string &  filename,
const boost::python::dict &  arg 
) const [virtual]

Saves a dictonary of Data objects to an OpenDX input file. The keywords are used as identifier.

This has to be implemented by the actual Domain adapter.

Reimplemented in finley::MeshAdapter.

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

void escript::AbstractDomain::saveVTK ( const std::string &  filename,
const boost::python::dict &  arg,
const std::string &  metadata,
const std::string &  metadata_schema 
) const [virtual]

Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier. metadata is string representing some meta data to be added. metadata_schema assign schema to namespaces used in the meta data.

This has to be implemented by the actual Domain adapter.

Reimplemented in finley::MeshAdapter.

References throwStandardException().

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.

References throwStandardException().

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.

References throwStandardException().

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.

Referenced by BOOST_PYTHON_MODULE().

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.

Referenced by borrowListOfTagsInUse(), borrowSampleReferenceIDs(), canTag(), dump(), functionSpaceTypeAsString(), escript::AbstractContinuousDomain::getContinuousFunctionCode(), getDataShape(), getDescription(), escript::AbstractContinuousDomain::getDescription(), getDim(), escript::AbstractContinuousDomain::getDiracDeltaFunctionCode(), escript::AbstractContinuousDomain::getFunctionCode(), escript::AbstractContinuousDomain::getFunctionOnBoundaryCode(), escript::AbstractContinuousDomain::getFunctionOnContactOneCode(), escript::AbstractContinuousDomain::getFunctionOnContactZeroCode(), getNormal(), getNumberOfTagsInUse(), escript::AbstractContinuousDomain::getReducedContinuousFunctionCode(), escript::AbstractContinuousDomain::getReducedFunctionCode(), escript::AbstractContinuousDomain::getReducedFunctionOnBoundaryCode(), escript::AbstractContinuousDomain::getReducedFunctionOnContactOneCode(), escript::AbstractContinuousDomain::getReducedFunctionOnContactZeroCode(), escript::AbstractContinuousDomain::getReducedSolutionCode(), getSize(), escript::AbstractContinuousDomain::getSolutionCode(), getTag(), getTagFromSampleNo(), getX(), interpolateACross(), interpolateOnDomain(), isCellOriented(), isValidFunctionSpaceType(), escript::AbstractContinuousDomain::isValidFunctionSpaceType(), MPIBarrier(), operator!=(), operator==(), probeInterpolationACross(), probeInterpolationOnDomain(), saveDX(), saveVTK(), setNewX(), setTagMap(), setTags(), setToGradient(), escript::AbstractContinuousDomain::setToIntegrals(), setToNormal(), setToSize(), setToX(), showTagNames(), and write().

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 escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().

const int * escript::AbstractDomain::borrowListOfTagsInUse ( int  functionSpaceCode  )  const [virtual]

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

Checks if this domain allows tags for the specified functionSpaceCode.

Reimplemented in escript::NullDomain, escript::TestDomain, and finley::MeshAdapter.

References throwStandardException().


Member Data Documentation


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

Generated on Mon Aug 10 10:04:44 2009 for ESYS13 by  doxygen 1.5.6