Classes | Public Types | Public Member Functions | Private Attributes

escript::AbstractDomain Class Reference

#include <AbstractDomain.h>

Inheritance diagram for escript::AbstractDomain:
escript::AbstractContinuousDomain escript::NullDomain escript::TestDomain dudley::MeshAdapter finley::MeshAdapter

List of all members.

Classes

struct  ValueBuffer

Public Types

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

Public Member Functions

ESCRIPT_DLL_API Domain_ptr getPtr ()
 Returns smart pointer which is managing this object. If one does not exist yet it creates one.
ESCRIPT_DLL_API const_Domain_ptr getPtr () const
ESCRIPT_DLL_API AbstractDomain ()
 Default constructor for AbstractDomain.
virtual ESCRIPT_DLL_API ~AbstractDomain ()
 Destructor for AbstractDomain.
virtual ESCRIPT_DLL_API int getMPISize () const
 return the number of processors used for this domain
virtual ESCRIPT_DLL_API int getMPIRank () const
 return the number MPI rank of this processor
virtual ESCRIPT_DLL_API void MPIBarrier () const
 If compiled for MPI then execute an MPI_Barrier, else do nothing.
virtual ESCRIPT_DLL_API bool onMasterProcessor () const
 Return true if on MPI master, else false.
virtual ESCRIPT_DLL_API
unsigned int 
getMPIComm () const
 get the communicator for this domain. Returns 0 on non-MPI builds Routine must be implemented by the DomainAdapter
virtual ESCRIPT_DLL_API bool isValidFunctionSpaceType (int functionSpaceType) const
 Returns true if the given integer is a valid function space type for this domain.
virtual ESCRIPT_DLL_API std::string getDescription () const
 Return a description for this domain.
virtual ESCRIPT_DLL_API std::string functionSpaceTypeAsString (int functionSpaceType) const
 Return a description for the given function space type code.
virtual ESCRIPT_DLL_API int getDim () const
 Returns the spatial dimension of the domain.
virtual ESCRIPT_DLL_API bool operator== (const AbstractDomain &other) const
 Return true if given domains are equal.
virtual ESCRIPT_DLL_API bool operator!= (const AbstractDomain &other) const
virtual ESCRIPT_DLL_API void write (const std::string &filename) const
 Writes the domain to an external file filename.
virtual ESCRIPT_DLL_API void dump (const std::string &filename) const
 dumps the domain to an external file filename.
virtual ESCRIPT_DLL_API
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 ESCRIPT_DLL_API int getTagFromSampleNo (int functionSpaceType, int sampleNo) const
 Return the tag key for the given sample number.
virtual ESCRIPT_DLL_API void setTagMap (const std::string &name, int tag)
 sets a map from a clear tag name to a tag key
virtual ESCRIPT_DLL_API int getTag (const std::string &name) const
 Return the tag key for tag name.
virtual ESCRIPT_DLL_API bool isValidTagName (const std::string &name) const
 Returns True if name is a defined tag name.
virtual ESCRIPT_DLL_API std::string showTagNames () const
 Returns all tag names in a single string sperated by commas.
virtual ESCRIPT_DLL_API const int * borrowSampleReferenceIDs (int functionSpaceType) const
 Return a borrowed pointer to the sample reference number id list.
virtual ESCRIPT_DLL_API void setNewX (const escript::Data &arg)
 Assigns new location to the domain.
virtual ESCRIPT_DLL_API 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 ESCRIPT_DLL_API bool probeInterpolationOnDomain (int functionSpaceType_source, int functionSpaceType_target) const
virtual ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API bool probeInterpolationACross (int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const
virtual ESCRIPT_DLL_API
escript::Data 
getX () const
 Returns locations in the domain. The function space is chosen appropriately.
virtual ESCRIPT_DLL_API
escript::Data 
getNormal () const
 Return boundary normals. The function space is chosen appropriately.
virtual ESCRIPT_DLL_API
escript::Data 
getSize () const
 Returns the local size of samples. The function space is chosen appropriately.
virtual ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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.
ESCRIPT_DLL_API 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 ESCRIPT_DLL_API 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 ESCRIPT_DLL_API const int * borrowListOfTagsInUse (int functionSpaceCode) const
virtual ESCRIPT_DLL_API bool canTag (int functionspacecode) const
 Checks if this domain allows tags for the specified functionSpaceCode.
virtual ESCRIPT_DLL_API int getApproximationOrder (const int functionSpaceCode) const
 returns the approximation order used for a function space functionSpaceCode
virtual ESCRIPT_DLL_API 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:
functionSpaceType Input - The function space type.

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

References throwStandardException().

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

Checks if this domain allows tags for the specified functionSpaceCode.

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

References throwStandardException().

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

References throwStandardException().

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

References throwStandardException().

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

returns the approximation order used for a function space functionSpaceCode

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

References throwStandardException().

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

References throwStandardException().

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

References throwStandardException().

Referenced by BOOST_PYTHON_MODULE().

ESCRIPT_DLL_API 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 dudley::MeshAdapter, and finley::MeshAdapter.

References throwStandardException().

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

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

return the number MPI rank of this processor

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

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

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

References throwStandardException().

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

References throwStandardException().

const_Domain_ptr escript::AbstractDomain::getPtr (  )  const
Domain_ptr escript::AbstractDomain::getPtr (  ) 

Returns smart pointer which is managing this object. If one does not exist yet it creates one.

Note: This is _not_ equivalent to weak_ptr::lock.

Referenced by finley::brick(), escript::TestDomain::getX(), finley::rectangle(), and finley::MeshAdapter::saveVTK().

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

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

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

References throwStandardException().

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

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

References throwStandardException().

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:
functionSpaceType Input - The function space type.
sampleNo Input - The sample number.

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

References throwStandardException().

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

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

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

References throwStandardException().

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

References throwStandardException().

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

References throwStandardException().

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

Referenced by BOOST_PYTHON_MODULE().

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

Return true if given domains are equal.

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

References throwStandardException().

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

References throwStandardException().

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]
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 dudley::MeshAdapter, and 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::setNewX ( const escript::Data arg  )  [virtual]

Assigns new location to the domain.

This has to be implemented by the actual Domain adapter.

Reimplemented in escript::AbstractContinuousDomain, dudley::MeshAdapter, 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 dudley::MeshAdapter, and 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 dudley::MeshAdapter, and 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 dudley::MeshAdapter, and 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 dudley::MeshAdapter, and 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 dudley::MeshAdapter, and finley::MeshAdapter.

References throwStandardException().

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

References throwStandardException().

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

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

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

References throwStandardException().

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.

Referenced by escript::AbstractContinuousDomain::addPDEToRHS(), escript::AbstractContinuousDomain::addPDEToSystem(), escript::AbstractContinuousDomain::addPDEToTransportProblem(), borrowListOfTagsInUse(), borrowSampleReferenceIDs(), canTag(), commonFunctionSpace(), dump(), functionSpaceTypeAsString(), getApproximationOrder(), escript::AbstractContinuousDomain::getContinuousFunctionCode(), getDataShape(), escript::AbstractContinuousDomain::getDataShape(), getDescription(), escript::AbstractContinuousDomain::getDescription(), getDim(), escript::AbstractContinuousDomain::getDiracDeltaFunctionsCode(), escript::AbstractContinuousDomain::getFunctionCode(), escript::AbstractContinuousDomain::getFunctionOnBoundaryCode(), escript::AbstractContinuousDomain::getFunctionOnContactOneCode(), escript::AbstractContinuousDomain::getFunctionOnContactZeroCode(), getMPIComm(), getNormal(), getNumberOfTagsInUse(), escript::AbstractContinuousDomain::getNumDataPointsGlobal(), 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(), escript::AbstractContinuousDomain::newSystemMatrix(), escript::AbstractContinuousDomain::newTransportProblem(), operator!=(), operator==(), ownSample(), escript::AbstractContinuousDomain::Print_Mesh_Info(), probeInterpolationACross(), probeInterpolationOnDomain(), saveDX(), saveVTK(), setNewX(), escript::AbstractContinuousDomain::setNewX(), setTagMap(), setTags(), setToGradient(), escript::AbstractContinuousDomain::setToIntegrals(), setToNormal(), setToSize(), setToX(), showTagNames(), supportsContactElements(), and write().

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

References throwStandardException().


Member Data Documentation


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