Go to the documentation of this file.
17 #ifndef __ESCRIPT_TESTDOMAIN_H__
18 #define __ESCRIPT_TESTDOMAIN_H__
44 TestDomain(
int pointspersample,
int numsamples,
int dpsize=1);
46 virtual ~TestDomain();
48 virtual int getMPISize()
const;
49 virtual int getMPIRank()
const;
50 virtual void MPIBarrier()
const;
51 virtual bool onMasterProcessor()
const;
55 virtual bool isValidFunctionSpaceType(
int functionSpaceType)
const;
57 virtual std::string getDescription()
const;
59 virtual std::string functionSpaceTypeAsString(
int functionSpaceType)
const;
63 virtual bool probeInterpolationOnDomain(
int functionSpaceType_source,
int functionSpaceType_target)
const;
65 bool commonFunctionSpace(
const std::vector<int>& fs,
int& resultcode)
const;
73 virtual int getDefaultCode()
const;
74 virtual int getContinuousFunctionCode()
const;
75 virtual int getFunctionCode()
const;
76 virtual int getFunctionOnBoundaryCode()
const;
77 virtual int getFunctionOnContactZeroCode()
const;
78 virtual int getFunctionOnContactOneCode()
const;
79 virtual int getSolutionCode()
const;
80 virtual int getReducedSolutionCode()
const;
81 virtual int getDiracDeltaFunctionsCode()
const;
83 virtual std::pair<int,DataTypes::dim_t> getDataShape(
int functionSpaceCode)
const;
85 virtual int getTagFromSampleNo(
int functionSpaceType,
DataTypes::index_t sampleNo)
const;
87 virtual const DataTypes::dim_t* borrowSampleReferenceIDs(
int functionSpaceType)
const;
89 virtual int getDim()
const;
95 virtual bool canTag(
int functionSpaceCode)
const;
97 virtual int getNumberOfTagsInUse(
int functionSpaceCode)
const;
99 virtual const int* borrowListOfTagsInUse(
int functionSpaceCode)
const;
103 const boost::python::tuple& filter)
const;
105 void addUsedTag(
int t);
106 void clearUsedTags();
107 void assignTags(std::vector<int> t);
108 void resetTagAssignments();
121 std::vector<int> mytags;
122 std::vector<int> tag_assignment;
133 #endif // __ESCRIPT_TESTDOMAIN_H__
const DataReady * getReady() const
Definition: Data.h:1772
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:28
void MPIBarrierWorld()
performs a barrier synchronization across all processors.
Definition: Utils.cpp:376
virtual ~TestDomain()
Definition: TestDomain.cpp:77
virtual int getSolutionCode() const
Definition: TestDomain.cpp:200
virtual int getContinuousFunctionCode() const
Definition: TestDomain.cpp:175
Definition: DomainException.h:37
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:149
virtual bool isValidFunctionSpaceType(int functionSpaceType) const
Returns true if the given integer is a valid function space type for this domain.
Definition: TestDomain.cpp:116
virtual int getTagFromSampleNo(int functionSpaceType, DataTypes::index_t sampleNo) const
Return the tag key for the given sample number.
Definition: TestDomain.cpp:220
void randomFillArray(long seed, double *array, size_t n)
Definition: Random.cpp:73
virtual int getFunctionOnContactZeroCode() const
Definition: TestDomain.cpp:190
(Testing use only) Provides a domain to wrap a collection of values.
Definition: TestDomain.h:52
void assignTags(std::vector< int > t)
Definition: TestDomain.cpp:325
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:47
virtual const DataTypes::dim_t * borrowSampleReferenceIDs(int functionSpaceType) const
Returns a borrowed pointer to the sample reference number id list.
Definition: TestDomain.cpp:231
int getMPISizeWorld()
returns the total number of available MPI processes for MPI_COMM_WORLD
Definition: Utils.cpp:93
virtual int getMPIRank() const
return the number MPI rank of this processor
Definition: TestDomain.cpp:87
virtual bool operator!=(const AbstractDomain &other) const
Return true if given domains are not equal.
Definition: TestDomain.cpp:247
Definition: FunctionSpace.h:45
JMPI makeInfo(MPI_Comm comm, bool owncom)
Definition: EsysMPI.cpp:39
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:461
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition: CrossDomainCoupler.cpp:30
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:101
virtual escript::JMPI getMPI() const
returns a shared pointer to the MPI information wrapper for this domain
Definition: TestDomain.cpp:109
TestDomain(int pointspersample, int numsamples, int dpsize=1)
Definition: TestDomain.cpp:48
#define MPI_COMM_WORLD
Definition: EsysMPI.h:46
Data represents a collection of datapoints.
Definition: Data.h:62
Definition: DataException.h:37
virtual int getFunctionOnBoundaryCode() const
Definition: TestDomain.cpp:185
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:290
index_t dim_t
Definition: DataTypes.h:87
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:65
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:70
virtual const int * borrowListOfTagsInUse(int functionSpaceCode) const
Definition: TestDomain.cpp:320
virtual escript::Data getX() const
Returns locations in the domain. The function space is chosen appropriately.
Definition: TestDomain.cpp:262
void resetTagAssignments()
Definition: TestDomain.cpp:339
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:215
virtual int getDefaultCode() const
Definition: TestDomain.cpp:170
void addUsedTag(int t)
Definition: TestDomain.cpp:302
virtual int getMPISize() const
return the number of processors used for this domain
Definition: TestDomain.cpp:82
virtual bool operator==(const AbstractDomain &other) const
Return true if given domains are equal.
Definition: TestDomain.cpp:241
virtual int getReducedSolutionCode() const
Definition: TestDomain.cpp:205
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const
Return a description for the given function space type code.
Definition: TestDomain.cpp:126
virtual bool canTag(int functionSpaceCode) const
Checks if this domain allows tags for the specified functionSpaceCode.
Definition: TestDomain.cpp:252
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:160
virtual void MPIBarrier() const
If compiled for MPI then execute an MPI_Barrier, else do nothing.
Definition: TestDomain.cpp:92
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:131
void clearUsedTags()
Definition: TestDomain.cpp:314
FunctionSpace getTestDomainFunctionSpace(int dpps, DataTypes::dim_t samples, int dpsize)
Definition: TestDomain.cpp:349
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:257
virtual int getDiracDeltaFunctionsCode() const
Definition: TestDomain.cpp:210
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:82
Definition: AbstractContinuousDomain.cpp:22
size_type size() const
Return the number of elements in this DataVectorAlt.
Definition: DataVectorAlt.h:237
virtual DataTypes::RealVectorType & getVectorRW()=0
Provide access to underlying storage. Internal use only!
virtual bool probeInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
True if interpolation is possible from source to target.
Definition: TestDomain.cpp:140
virtual int getFunctionOnContactOneCode() const
Definition: TestDomain.cpp:195
virtual bool probeInterpolationAcross(int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const
Definition: TestDomain.cpp:154
virtual std::string getDescription() const
Return a description for this domain.
Definition: TestDomain.cpp:121
Base class for all escript domains.
Definition: AbstractDomain.h:56
int getMPIRankWorld()
returns the MPI processor number within MPI_COMM_WORLD
Definition: Utils.cpp:102
virtual bool onMasterProcessor() const
Return true if on MPI master, else false.
Definition: TestDomain.cpp:97
virtual int getFunctionCode() const
Definition: TestDomain.cpp:180
virtual int getDim() const
Returns the spatial dimension of the domain.
Definition: TestDomain.cpp:236
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:69