escript
Revision_
|
(Testing use only) Provides a domain to wrap a collection of values. More...
#include <TestDomain.h>
Public Member Functions | |
TestDomain (int pointspersample, int numsamples, int dpsize=1) | |
Default constructor for TestDomain. | |
~TestDomain () | |
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 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. TestDomain only has one FunctionSpace so this makes target a shallow copy of source. | |
virtual bool | probeInterpolationOnDomain (int functionSpaceType_source, int functionSpaceType_target) const |
True if interpolation is possible from source to target. | |
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::Data | getX () const |
Returns locations in the domain. | |
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. We do not permit interpolation into the TestDomain so this method always throws. | |
virtual bool | probeInterpolationACross (int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const |
virtual int | getDefaultCode () const |
Return a continuous FunctionSpace. | |
virtual int | getContinuousFunctionCode () const |
Return a continuous FunctionSpace. | |
virtual int | getFunctionCode () const |
Return a function FunctionSpace. | |
virtual int | getFunctionOnBoundaryCode () const |
Return a function on boundary FunctionSpace. | |
virtual int | getFunctionOnContactZeroCode () const |
Return a FunctionSpace. | |
virtual int | getFunctionOnContactOneCode () const |
Return a FunctionSpace. | |
virtual int | getSolutionCode () const |
Return a FunctionSpace. | |
virtual int | getReducedSolutionCode () const |
Return a FunctionSpace. | |
virtual int | getDiracDeltaFunctionsCode () const |
Return a FunctionSpace. | |
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 const int * | borrowSampleReferenceIDs (int functionSpaceType) const |
Return a borrowed pointer to the sample reference number id list. | |
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 bool | canTag (int functionSpaceCode) const |
Checks if this domain allows tags for the specified functionSpaceCode. | |
virtual int | getNumberOfTagsInUse (int functionSpaceCode) const |
return the number of tags in use. For this class the answer is always 1(the default tag). | |
virtual const int * | borrowListOfTagsInUse (int functionSpaceCode) const |
returns a pointer to an array with the tags used. For this class the answer will always be {0} | |
virtual escript::Data | randomFill (const DataTypes::ShapeType &shape, const FunctionSpace &what, long seed, const boost::python::tuple &filter) const |
Fills the data object with filtered random values. | |
Private Attributes | |
int | m_samples |
int | m_dpps |
int | m_dpsize |
int * | m_samplerefids |
(Testing use only) Provides a domain to wrap a collection of values.
This domain provides more functionality than NullDomain in that it can store varying numbers of samples and points per sample.
It currently supports a single function space which does not support tagging. No effort has been made to make this work with MPI
escript::TestDomain::TestDomain | ( | int | pointspersample, |
int | numsamples, | ||
int | dpsize = 1 |
||
) |
Default constructor for TestDomain.
Description: Default constructor for TestDomain.
References escript::getMPIRankWorld(), escript::getMPISizeWorld(), m_samplerefids, and m_samples.
References m_samplerefids.
const int * escript::TestDomain::borrowListOfTagsInUse | ( | int | functionSpaceCode | ) | const [virtual] |
returns a pointer to an array with the tags used. For this class the answer will always be {0}
Reimplemented from escript::AbstractDomain.
const int * escript::TestDomain::borrowSampleReferenceIDs | ( | int | functionSpaceType | ) | const [virtual] |
Return a borrowed pointer to the sample reference number id list.
functionSpaceType | Input - The function space type. |
Reimplemented from escript::AbstractDomain.
References m_samplerefids.
bool escript::TestDomain::canTag | ( | int | functionSpaceCode | ) | const [virtual] |
Checks if this domain allows tags for the specified functionSpaceCode.
Reimplemented from escript::AbstractDomain.
bool escript::TestDomain::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 from escript::AbstractDomain.
std::string escript::TestDomain::functionSpaceTypeAsString | ( | int | functionSpaceType | ) | const [virtual] |
Return a description for the given function space type code.
Reimplemented from escript::AbstractDomain.
int escript::TestDomain::getContinuousFunctionCode | ( | ) | const [virtual] |
Return a continuous FunctionSpace.
std::pair< int, int > escript::TestDomain::getDataShape | ( | int | functionSpaceCode | ) | const [virtual] |
Return the number of data points per sample, and the number of samples as a pair.
functionSpaceCode | Input - Code for the function space type. |
Reimplemented from escript::AbstractDomain.
int escript::TestDomain::getDefaultCode | ( | ) | const [virtual] |
Return a continuous FunctionSpace.
Referenced by escript::getTestDomainFunctionSpace(), and getX().
std::string escript::TestDomain::getDescription | ( | ) | const [virtual] |
Return a description for this domain.
Reimplemented from escript::AbstractDomain.
int escript::TestDomain::getDim | ( | ) | const [virtual] |
Returns the spatial dimension of the domain.
This has to be implemented by the actual Domain adapter.
Reimplemented from escript::AbstractDomain.
int escript::TestDomain::getDiracDeltaFunctionsCode | ( | ) | const [virtual] |
Return a FunctionSpace.
int escript::TestDomain::getFunctionCode | ( | ) | const [virtual] |
Return a function FunctionSpace.
int escript::TestDomain::getFunctionOnBoundaryCode | ( | ) | const [virtual] |
Return a function on boundary FunctionSpace.
int escript::TestDomain::getFunctionOnContactOneCode | ( | ) | const [virtual] |
Return a FunctionSpace.
int escript::TestDomain::getFunctionOnContactZeroCode | ( | ) | const [virtual] |
Return a FunctionSpace.
int escript::TestDomain::getNumberOfTagsInUse | ( | int | functionSpaceCode | ) | const [virtual] |
return the number of tags in use. For this class the answer is always 1(the default tag).
Reimplemented from escript::AbstractDomain.
int escript::TestDomain::getReducedSolutionCode | ( | ) | const [virtual] |
Return a FunctionSpace.
int escript::TestDomain::getSolutionCode | ( | ) | const [virtual] |
Return a FunctionSpace.
int escript::TestDomain::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 from escript::AbstractDomain.
escript::Data escript::TestDomain::getX | ( | ) | const [virtual] |
Returns locations in the domain.
Reimplemented from escript::AbstractDomain.
References getDefaultCode(), escript::AbstractDomain::getPtr(), escript::Data::getReady(), escript::DataReady::getVectorRW(), m_dpps, m_dpsize, m_samples, and escript::DataTypes::scalarShape.
void escript::TestDomain::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. We do not permit interpolation into the TestDomain so this method always throws.
Reimplemented from escript::AbstractDomain.
void escript::TestDomain::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. TestDomain only has one FunctionSpace so this makes target a shallow copy of source.
Reimplemented from escript::AbstractDomain.
References escript::FunctionSpace::getDomain(), and escript::Data::getFunctionSpace().
bool escript::TestDomain::isValidFunctionSpaceType | ( | int | functionSpaceType | ) | const [virtual] |
Returns true if the given integer is a valid function space type for this domain.
Reimplemented from escript::AbstractDomain.
bool escript::TestDomain::operator!= | ( | const AbstractDomain & | other | ) | const [virtual] |
Reimplemented from escript::AbstractDomain.
bool escript::TestDomain::operator== | ( | const AbstractDomain & | other | ) | const [virtual] |
Return true if given domains are equal.
Reimplemented from escript::AbstractDomain.
bool escript::TestDomain::probeInterpolationACross | ( | int | functionSpaceType_source, |
const AbstractDomain & | targetDomain, | ||
int | functionSpaceType_target | ||
) | const [virtual] |
Reimplemented from escript::AbstractDomain.
bool escript::TestDomain::probeInterpolationOnDomain | ( | int | functionSpaceType_source, |
int | functionSpaceType_target | ||
) | const [virtual] |
True if interpolation is possible from source to target.
Reimplemented from escript::AbstractDomain.
escript::Data escript::TestDomain::randomFill | ( | const DataTypes::ShapeType & | shape, |
const FunctionSpace & | what, | ||
long | seed, | ||
const boost::python::tuple & | filter | ||
) | const [virtual] |
Fills the data object with filtered random values.
Implements escript::AbstractDomain.
References escript::Data::getExpandedVectorReference(), esysUtils::randomFillArray(), and escript::DataVector::size().
int escript::TestDomain::m_dpps [private] |
Referenced by getDataShape(), and getX().
int escript::TestDomain::m_dpsize [private] |
Referenced by getX().
int* escript::TestDomain::m_samplerefids [private] |
Referenced by borrowSampleReferenceIDs(), TestDomain(), and ~TestDomain().
int escript::TestDomain::m_samples [private] |
Referenced by getDataShape(), getX(), and TestDomain().