NullDomain.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2017 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 by Centre for Geoscience Computing (GeoComp)
*
*****************************************************************************/
#ifndef __ESCRIPT_NULLDOMAIN_H__
#define __ESCRIPT_NULLDOMAIN_H__
#include "system_dep.h"
#include "AbstractDomain.h"
namespace escript {
class ESCRIPT_DLL_API NullDomain : public AbstractDomain
{
private:
static int NullDomainFS;
static DataTypes::dim_t referenceID;
public:
NullDomain() {}
virtual JMPI getMPI() const;
virtual int getMPISize() const { return 1; }
virtual int getMPIRank() const { return 0; }
virtual void MPIBarrier() const {}
virtual bool onMasterProcessor() const { return true; }
virtual MPI_Comm getMPIComm() const { return MPI_COMM_WORLD; }
virtual bool isValidFunctionSpaceType(int fsCode) const {
return fsCode==NullDomainFS;
}
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;
virtual void interpolateAcross(escript::Data& target, const escript::Data& source) const;
virtual bool probeInterpolationAcross(int, const AbstractDomain&, int) const {
return false;
}
virtual int getContinuousFunctionCode() const { return NullDomainFS; }
virtual int getFunctionCode() const { return NullDomainFS; }
virtual int getFunctionOnBoundaryCode() const { return NullDomainFS; }
virtual int getFunctionOnContactZeroCode() const { return NullDomainFS; }
virtual int getFunctionOnContactOneCode() const { return NullDomainFS; }
virtual int getSolutionCode() const { return NullDomainFS; }
virtual int getReducedSolutionCode() const { return NullDomainFS; }
virtual int getDiracDeltaFunctionsCode() const { return NullDomainFS; }
virtual std::pair<int,DataTypes::dim_t> getDataShape(int functionSpaceCode) const;
virtual int getTagFromSampleNo(int, DataTypes::index_t) const { return 1; }
virtual const DataTypes::dim_t* borrowSampleReferenceIDs(int) const { return &referenceID; }
virtual int getDim() const { return 1; }
virtual bool operator==(const AbstractDomain& other) const;
virtual bool operator!=(const AbstractDomain& other) const {
return !(*this==other);
}
virtual void write(const std::string& filename) const;
virtual void dump(const std::string& filename) const;
virtual void setTagMap(const std::string& name, int tag);
virtual int getTag(const std::string& name) const;
virtual bool canTag(int) const { return true; }
virtual std::string showTagNames() const;
virtual int getNumberOfTagsInUse(int) const { return 1; }
virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
virtual void setTags(int functionSpaceType, int newTag, const escript::Data& mask) const;
bool supportsContactElements() const { return false; }
virtual void setNewX(const escript::Data& arg);
virtual signed char preferredInterpolationOnDomain(
int functionSpaceType_source,
int functionSpaceType_target) const;
virtual bool commonFunctionSpace(const std::vector<int>& fs,
int& resultcode) const;
virtual bool isCellOriented(int functionSpaceCode) const;
virtual int getApproximationOrder(const int functionSpaceCode) const;
virtual escript::Data getX() const;
virtual escript::Data getNormal() const;
virtual escript::Data getSize() const;
virtual void setToX(escript::Data& out) const;
virtual void setToNormal(escript::Data& out) const;
virtual void setToSize(escript::Data& out) const;
virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;
virtual bool ownSample(int fs_code, DataTypes::index_t id) const;
virtual escript::Data randomFill(const DataTypes::ShapeType& shape,
const FunctionSpace& what, long seed,
const boost::python::tuple& filter) const;
};
} // end of namespace
#endif // __ESCRIPT_NULLDOMAIN_H__
escript::FunctionSpace
Definition: FunctionSpace.h:34
escript::NullDomain::getDiracDeltaFunctionsCode
virtual int getDiracDeltaFunctionsCode() const
Definition: NullDomain.h:80
escript::NullDomain
NullDomain provides a null value for domain. Needed for the construction of a default FunctionSpace...
Definition: NullDomain.h:39
escript::NullDomain::getSolutionCode
virtual int getSolutionCode() const
Definition: NullDomain.h:78
escript
Definition: AbstractContinuousDomain.cpp:22
escript::NullDomain::getFunctionCode
virtual int getFunctionCode() const
Definition: NullDomain.h:74
escript::NullDomain::MPIBarrier
virtual void MPIBarrier() const
If compiled for MPI then execute an MPI_Barrier, else do nothing.
Definition: NullDomain.h:51
escript::NullDomain::getTagFromSampleNo
virtual int getTagFromSampleNo(int, DataTypes::index_t) const
Return the tag key for the given sample number.
Definition: NullDomain.h:84
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
escript::NullDomain::getNumberOfTagsInUse
virtual int getNumberOfTagsInUse(int) const
returns the number of tags in use and a pointer to an array with the number of tags in use ...
Definition: NullDomain.h:108
escript::NullDomain::getReducedSolutionCode
virtual int getReducedSolutionCode() const
Definition: NullDomain.h:79
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:42
escript::NullDomain::getMPIRank
virtual int getMPIRank() const
return the number MPI rank of this processor
Definition: NullDomain.h:50
escript::NullDomain::borrowSampleReferenceIDs
virtual const DataTypes::dim_t * borrowSampleReferenceIDs(int) const
Returns a borrowed pointer to the sample reference number id list.
Definition: NullDomain.h:86
system_dep.h
escript::NullDomain::supportsContactElements
bool supportsContactElements() const
Definition: NullDomain.h:114
escript::NullDomain::getContinuousFunctionCode
virtual int getContinuousFunctionCode() const
Definition: NullDomain.h:73
MPI_COMM_WORLD
#define MPI_COMM_WORLD
Definition: EsysMPI.h:47
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
escript::NullDomain::getFunctionOnContactZeroCode
virtual int getFunctionOnContactZeroCode() const
Definition: NullDomain.h:76
escript::NullDomain::getDim
virtual int getDim() const
Returns the spatial dimension of the domain.
Definition: NullDomain.h:88
escript::NullDomain::isValidFunctionSpaceType
virtual bool isValidFunctionSpaceType(int fsCode) const
Returns true if the given integer is a valid function space type for this domain. ...
Definition: NullDomain.h:55
escript::NullDomain::onMasterProcessor
virtual bool onMasterProcessor() const
Return true if on MPI master, else false.
Definition: NullDomain.h:52
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:63
escript::NullDomain::getMPISize
virtual int getMPISize() const
return the number of processors used for this domain
Definition: NullDomain.h:49
getTag
int getTag(unsigned char sourcex, unsigned char sourcey, unsigned char sourcez, unsigned char targetx, unsigned char targety, unsigned char targetz)
Definition: blocktools.cpp:412
escript::NullDomain::referenceID
static DataTypes::dim_t referenceID
Definition: NullDomain.h:43
escript::NullDomain::probeInterpolationAcross
virtual bool probeInterpolationAcross(int, const AbstractDomain &, int) const
Definition: NullDomain.h:69
escript::NullDomain::NullDomainFS
static int NullDomainFS
Definition: NullDomain.h:42
MPI_Comm
int MPI_Comm
Definition: EsysMPI.h:41
escript::NullDomain::getFunctionOnContactOneCode
virtual int getFunctionOnContactOneCode() const
Definition: NullDomain.h:77
AbstractDomain.h
escript::NullDomain::getFunctionOnBoundaryCode
virtual int getFunctionOnBoundaryCode() const
Definition: NullDomain.h:75
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
escript::NullDomain::canTag
virtual bool canTag(int) const
Checks if this domain allows tags for the specified functionSpaceCode.
Definition: NullDomain.h:104
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:45
escript::NullDomain::operator!=
virtual bool operator!=(const AbstractDomain &other) const
Return true if given domains are not equal.
Definition: NullDomain.h:92
escript::NullDomain::getMPIComm
virtual MPI_Comm getMPIComm() const
get the communicator for this domain. Returns an integer on non-MPI builds Routine must be implemente...
Definition: NullDomain.h:53
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:64
escript::NullDomain::NullDomain
NullDomain()
Definition: NullDomain.h:46