Go to the documentation of this file.
18 #ifndef __ESCRIPT_TESTDOMAIN_H__
19 #define __ESCRIPT_TESTDOMAIN_H__
45 TestDomain(
int pointspersample,
int numsamples,
int dpsize=1);
47 virtual ~TestDomain();
49 virtual int getMPISize()
const;
50 virtual int getMPIRank()
const;
51 virtual void MPIBarrier()
const;
52 virtual bool onMasterProcessor()
const;
56 virtual bool isValidFunctionSpaceType(
int functionSpaceType)
const;
58 virtual std::string getDescription()
const;
60 virtual std::string functionSpaceTypeAsString(
int functionSpaceType)
const;
64 virtual bool probeInterpolationOnDomain(
int functionSpaceType_source,
int functionSpaceType_target)
const;
66 bool commonFunctionSpace(
const std::vector<int>& fs,
int& resultcode)
const;
74 virtual int getDefaultCode()
const;
75 virtual int getContinuousFunctionCode()
const;
76 virtual int getFunctionCode()
const;
77 virtual int getFunctionOnBoundaryCode()
const;
78 virtual int getFunctionOnContactZeroCode()
const;
79 virtual int getFunctionOnContactOneCode()
const;
80 virtual int getSolutionCode()
const;
81 virtual int getReducedSolutionCode()
const;
82 virtual int getDiracDeltaFunctionsCode()
const;
84 virtual std::pair<int,DataTypes::dim_t> getDataShape(
int functionSpaceCode)
const;
86 virtual int getTagFromSampleNo(
int functionSpaceType,
DataTypes::index_t sampleNo)
const;
88 virtual const DataTypes::dim_t* borrowSampleReferenceIDs(
int functionSpaceType)
const;
90 virtual int getDim()
const;
96 virtual bool canTag(
int functionSpaceCode)
const;
98 virtual int getNumberOfTagsInUse(
int functionSpaceCode)
const;
100 virtual const int* borrowListOfTagsInUse(
int functionSpaceCode)
const;
104 const boost::python::tuple& filter)
const;
106 void addUsedTag(
int t);
107 void clearUsedTags();
108 void assignTags(std::vector<int> t);
109 void resetTagAssignments();
122 std::vector<int> mytags;
123 std::vector<int> tag_assignment;
134 #endif // __ESCRIPT_TESTDOMAIN_H__
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
void MPIBarrierWorld()
performs a barrier synchronization across all processors.
Definition: Utils.cpp:377
virtual ~TestDomain()
Definition: TestDomain.cpp:79
virtual int getSolutionCode() const
Definition: TestDomain.cpp:202
virtual int getContinuousFunctionCode() const
Definition: TestDomain.cpp:177
Definition: DomainException.h:39
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.
Definition: TestDomain.cpp:151
virtual bool isValidFunctionSpaceType(int functionSpaceType) const
Returns true if the given integer is a valid function space type for this domain.
Definition: TestDomain.cpp:118
virtual int getTagFromSampleNo(int functionSpaceType, DataTypes::index_t sampleNo) const
Return the tag key for the given sample number.
Definition: TestDomain.cpp:222
void randomFillArray(long seed, double *array, size_t n)
Definition: Random.cpp:74
virtual int getFunctionOnContactZeroCode() const
Definition: TestDomain.cpp:192
(Testing use only) Provides a domain to wrap a collection of values.
Definition: TestDomain.h:54
void assignTags(std::vector< int > t)
Definition: TestDomain.cpp:327
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:53
virtual const DataTypes::dim_t * borrowSampleReferenceIDs(int functionSpaceType) const
Returns a borrowed pointer to the sample reference number id list.
Definition: TestDomain.cpp:233
int getMPISizeWorld()
returns the total number of available MPI processes for MPI_COMM_WORLD
Definition: Utils.cpp:94
virtual int getMPIRank() const
return the number MPI rank of this processor
Definition: TestDomain.cpp:89
virtual bool operator!=(const AbstractDomain &other) const
Return true if given domains are not equal.
Definition: TestDomain.cpp:249
Definition: FunctionSpace.h:47
JMPI makeInfo(MPI_Comm comm, bool owncom)
Definition: EsysMPI.cpp:41
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:462
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition: CrossDomainCoupler.cpp:31
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:102
virtual escript::JMPI getMPI() const
returns a shared pointer to the MPI information wrapper for this domain
Definition: TestDomain.cpp:111
TestDomain(int pointspersample, int numsamples, int dpsize=1)
Definition: TestDomain.cpp:50
#define MPI_COMM_WORLD
Definition: EsysMPI.h:47
Data represents a collection of datapoints.
Definition: Data.h:63
Definition: DataException.h:39
virtual int getFunctionOnBoundaryCode() const
Definition: TestDomain.cpp:187
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.
Definition: TestDomain.cpp:292
index_t dim_t
Definition: DataTypes.h:90
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:68
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
virtual const int * borrowListOfTagsInUse(int functionSpaceCode) const
Definition: TestDomain.cpp:322
virtual escript::Data getX() const
Returns locations in the domain. The function space is chosen appropriately.
Definition: TestDomain.cpp:264
void resetTagAssignments()
Definition: TestDomain.cpp:341
virtual std::pair< int, DataTypes::dim_t > getDataShape(int functionSpaceCode) const
Returns the number of data points per sample, and the number of samples as a pair.
Definition: TestDomain.cpp:217
virtual int getDefaultCode() const
Definition: TestDomain.cpp:172
void addUsedTag(int t)
Definition: TestDomain.cpp:304
virtual int getMPISize() const
return the number of processors used for this domain
Definition: TestDomain.cpp:84
virtual bool operator==(const AbstractDomain &other) const
Return true if given domains are equal.
Definition: TestDomain.cpp:243
virtual int getReducedSolutionCode() const
Definition: TestDomain.cpp:207
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const
Return a description for the given function space type code.
Definition: TestDomain.cpp:128
virtual bool canTag(int functionSpaceCode) const
Checks if this domain allows tags for the specified functionSpaceCode.
Definition: TestDomain.cpp:254
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.
Definition: TestDomain.cpp:162
virtual void MPIBarrier() const
If compiled for MPI then execute an MPI_Barrier, else do nothing.
Definition: TestDomain.cpp:94
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 do...
Definition: TestDomain.cpp:133
void clearUsedTags()
Definition: TestDomain.cpp:316
FunctionSpace getTestDomainFunctionSpace(int dpps, DataTypes::dim_t samples, int dpsize)
Definition: TestDomain.cpp:351
virtual int getNumberOfTagsInUse(int functionSpaceCode) const
returns the number of tags in use and a pointer to an array with the number of tags in use
Definition: TestDomain.cpp:259
virtual int getDiracDeltaFunctionsCode() const
Definition: TestDomain.cpp:212
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:85
Definition: AbstractContinuousDomain.cpp:23
size_type size() const
Return the number of elements in this DataVectorAlt.
Definition: DataVectorAlt.h:240
virtual bool probeInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
True if interpolation is possible from source to target.
Definition: TestDomain.cpp:142
virtual int getFunctionOnContactOneCode() const
Definition: TestDomain.cpp:197
virtual bool probeInterpolationAcross(int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const
Definition: TestDomain.cpp:156
virtual std::string getDescription() const
Return a description for this domain.
Definition: TestDomain.cpp:123
Base class for all escript domains.
Definition: AbstractDomain.h:62
int getMPIRankWorld()
returns the MPI processor number within MPI_COMM_WORLD
Definition: Utils.cpp:103
virtual bool onMasterProcessor() const
Return true if on MPI master, else false.
Definition: TestDomain.cpp:99
virtual int getFunctionCode() const
Definition: TestDomain.cpp:182
virtual int getDim() const
Returns the spatial dimension of the domain.
Definition: TestDomain.cpp:238
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:72