ESYS13
Revision_
|
#include <AbstractDomain.h>
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 |
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 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 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 |
typedef std::map<int, ValueBuffer> escript::AbstractDomain::BufferMapType |
typedef int escript::AbstractDomain::StatusType |
typedef struct ValueBuffer escript::AbstractDomain::ValueBuffer |
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.
const int * escript::AbstractDomain::borrowListOfTagsInUse | ( | int | functionSpaceCode | ) | const [virtual] |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, and escript::NullDomain.
const int * escript::AbstractDomain::borrowSampleReferenceIDs | ( | int | functionSpaceType | ) | const [virtual] |
Return a borrowed pointer to the sample reference number id list.
functionSpaceType | Input - The function space type. |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, and escript::NullDomain.
bool escript::AbstractDomain::canTag | ( | int | functionspacecode | ) | const [virtual] |
Checks if this domain allows tags for the specified functionSpaceCode.
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, 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.
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, 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 finley::MeshAdapter, and dudley::MeshAdapter.
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, 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, and dudley::MeshAdapter.
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.
functionSpaceCode | Input - Code for the function space type. |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::AbstractContinuousDomain, escript::TestDomain, and escript::NullDomain.
std::string escript::AbstractDomain::getDescription | ( | ) | const [virtual] |
Return a description for this domain.
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::AbstractContinuousDomain, escript::TestDomain, and escript::NullDomain.
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, and escript::NullDomain.
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, and dudley::MeshAdapter.
Referenced by weipa::EscriptDataset::setDomain().
int escript::AbstractDomain::getMPIRank | ( | ) | const [virtual] |
return the number MPI rank of this processor
Reimplemented in finley::MeshAdapter, and dudley::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 finley::MeshAdapter, and dudley::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 finley::MeshAdapter, and dudley::MeshAdapter.
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, escript::TestDomain, and escript::NullDomain.
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(), dudley::brick(), escript::continuousFunction(), escript::diracDeltaFunctions(), escript::functionOnBoundary(), escript::functionOnContactOne(), escript::functionOnContactZero(), escript::TestDomain::getX(), escript::load(), finley::loadMesh(), dudley::loadMesh(), finley::meshMerge(), dudley::readGmsh(), finley::readGmsh(), dudley::readMesh(), finley::readMesh(), finley::rectangle(), dudley::rectangle(), escript::reducedContinuousFunction(), escript::reducedFunction(), escript::reducedFunctionOnBoundary(), escript::reducedFunctionOnContactOne(), escript::reducedFunctionOnContactZero(), escript::reducedSolution(), finley::MeshAdapter::saveVTK(), and escript::solution().
escript::Data escript::AbstractDomain::getSize | ( | ) | const [virtual] |
Returns the local size of samples. The function space is chosen appropriately.
Reimplemented in finley::MeshAdapter, and dudley::MeshAdapter.
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, and dudley::MeshAdapter.
Referenced by BOOST_PYTHON_MODULE().
int escript::AbstractDomain::getTag | ( | const std::string & | name | ) | const [virtual] |
Return the tag key for tag name.
name | Input - tag name |
Reimplemented in finley::MeshAdapter, and dudley::MeshAdapter.
Referenced by BOOST_PYTHON_MODULE().
int escript::AbstractDomain::getTagFromSampleNo | ( | int | functionSpaceType, |
int | sampleNo | ||
) | const [virtual] |
Return the tag key for the given sample number.
functionSpaceType | Input - The function space type. |
sampleNo | Input - The sample number. |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, and escript::NullDomain.
escript::Data escript::AbstractDomain::getX | ( | ) | const [virtual] |
Returns locations in the domain. The function space is chosen appropriately.
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, 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, 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, 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, and dudley::MeshAdapter.
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, 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.
name | Input - tag name |
Reimplemented in finley::MeshAdapter, and dudley::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, and dudley::MeshAdapter.
Referenced by BOOST_PYTHON_MODULE().
bool escript::AbstractDomain::onMasterProcessor | ( | ) | const [virtual] |
Return true if on MPI master, else false.
Reimplemented in finley::MeshAdapter, and dudley::MeshAdapter.
Referenced by BOOST_PYTHON_MODULE().
bool escript::AbstractDomain::operator!= | ( | const AbstractDomain & | other | ) | const [virtual] |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, and escript::NullDomain.
bool escript::AbstractDomain::operator== | ( | const AbstractDomain & | other | ) | const [virtual] |
Return true if given domains are equal.
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, and escript::NullDomain.
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 finley::MeshAdapter, and dudley::MeshAdapter.
bool escript::AbstractDomain::probeInterpolationACross | ( | int | functionSpaceType_source, |
const AbstractDomain & | targetDomain, | ||
int | functionSpaceType_target | ||
) | const [virtual] |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, and escript::NullDomain.
bool escript::AbstractDomain::probeInterpolationOnDomain | ( | int | functionSpaceType_source, |
int | functionSpaceType_target | ||
) | const [virtual] |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, escript::TestDomain, and escript::NullDomain.
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, and dudley::MeshAdapter.
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.
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 finley::MeshAdapter, dudley::MeshAdapter, and escript::AbstractContinuousDomain.
void escript::AbstractDomain::setTagMap | ( | const std::string & | name, |
int | tag | ||
) | [virtual] |
sets a map from a clear tag name to a tag key
name | Input - tag name. |
tag | Input - tag key. |
Reimplemented in finley::MeshAdapter, and dudley::MeshAdapter.
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, and dudley::MeshAdapter.
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, and dudley::MeshAdapter.
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, and dudley::MeshAdapter.
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, and dudley::MeshAdapter.
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, and dudley::MeshAdapter.
std::string escript::AbstractDomain::showTagNames | ( | ) | const [virtual] |
Returns all tag names in a single string sperated by commas.
Reimplemented in finley::MeshAdapter, and dudley::MeshAdapter.
Referenced by BOOST_PYTHON_MODULE().
bool escript::AbstractDomain::supportsContactElements | ( | ) | const [virtual] |
Reimplemented in finley::MeshAdapter, dudley::MeshAdapter, and escript::NullDomain.
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.
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.