TestDomain.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __ESCRIPT_TESTDOMAIN_H__
#define __ESCRIPT_TESTDOMAIN_H__
#include "system_dep.h"
#include "NullDomain.h"
#include <vector>
namespace escript {
class ESCRIPT_DLL_API TestDomain : public NullDomain
{
public:
TestDomain(int pointspersample, int numsamples, int dpsize=1);
virtual ~TestDomain();
virtual int getMPISize() const;
virtual int getMPIRank() const;
virtual void MPIBarrier() const;
virtual bool onMasterProcessor() const;
virtual escript::JMPI getMPI() const;
virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
virtual std::string getDescription() const;
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
bool commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const;
virtual escript::Data getX() const;
virtual void interpolateAcross(escript::Data& target, const escript::Data& source) const;
virtual bool probeInterpolationAcross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;
virtual int getDefaultCode() const;
virtual int getContinuousFunctionCode() const;
virtual int getFunctionCode() const;
virtual int getFunctionOnBoundaryCode() const;
virtual int getFunctionOnContactZeroCode() const;
virtual int getFunctionOnContactOneCode() const;
virtual int getSolutionCode() const;
virtual int getReducedSolutionCode() const;
virtual int getDiracDeltaFunctionsCode() const;
virtual std::pair<int,DataTypes::dim_t> getDataShape(int functionSpaceCode) const;
virtual int getTagFromSampleNo(int functionSpaceType, DataTypes::index_t sampleNo) const;
virtual const DataTypes::dim_t* borrowSampleReferenceIDs(int functionSpaceType) const;
virtual int getDim() const;
virtual bool operator==(const AbstractDomain& other) const;
virtual bool operator!=(const AbstractDomain& other) const;
virtual bool canTag(int functionSpaceCode) const;
virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
virtual escript::Data randomFill(const DataTypes::ShapeType& shape,
const FunctionSpace& what, long seed,
const boost::python::tuple& filter) const;
void addUsedTag(int t);
void clearUsedTags();
void assignTags(std::vector<int> t);
void resetTagAssignments();
private:
DataTypes::dim_t m_totalsamples; // samples in all worlds
DataTypes::dim_t m_samples; // number of samples
DataTypes::dim_t m_originsample;
DataTypes::dim_t m_endsample;
int m_dpps; // data points per sample
int m_dpsize; // how big are the datapoints?
DataTypes::dim_t* m_samplerefids; // sample reference ids
std::vector<int> mytags;
std::vector<int> tag_assignment; // which tag is assigned to each sample
// to make testing easier, the tags in use list is
// controlled separately
escript::JMPI myworld;
};
ESCRIPT_DLL_API
FunctionSpace getTestDomainFunctionSpace(int dpps, DataTypes::dim_t samples, int dpsize);
} // end of namespace
#endif // __ESCRIPT_TESTDOMAIN_H__
NullDomain.h
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:51
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
escript::FunctionSpace
Definition: FunctionSpace.h:36
escript::NullDomain
NullDomain provides a null value for domain. Needed for the construction of a default FunctionSpace.
Definition: NullDomain.h:41
escript::TestDomain
(Testing use only) Provides a domain to wrap a collection of values.
Definition: TestDomain.h:43
escript::TestDomain::tag_assignment
std::vector< int > tag_assignment
Definition: TestDomain.h:123
escript::TestDomain::m_dpps
int m_dpps
Definition: TestDomain.h:118
escript::TestDomain::m_dpsize
int m_dpsize
Definition: TestDomain.h:119
escript::TestDomain::m_samplerefids
DataTypes::dim_t * m_samplerefids
Definition: TestDomain.h:120
escript::TestDomain::myworld
escript::JMPI myworld
Definition: TestDomain.h:126
escript::TestDomain::m_endsample
DataTypes::dim_t m_endsample
Definition: TestDomain.h:115
escript::TestDomain::m_samples
DataTypes::dim_t m_samples
Definition: TestDomain.h:113
escript::TestDomain::m_totalsamples
DataTypes::dim_t m_totalsamples
Definition: TestDomain.h:112
escript::TestDomain::mytags
std::vector< int > mytags
Definition: TestDomain.h:122
escript::TestDomain::m_originsample
DataTypes::dim_t m_originsample
Definition: TestDomain.h:114
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
escript
Definition: AbstractContinuousDomain.cpp:23
escript::getTestDomainFunctionSpace
FunctionSpace getTestDomainFunctionSpace(int dpps, DataTypes::dim_t samples, int dpsize)
Definition: TestDomain.cpp:338
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
speckley::probeInterpolationAcross
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition: CrossDomainCoupler.cpp:32
system_dep.h