NullDomain.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_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;
#ifdef ESYS_HAVE_BOOST_NUMPY
virtual boost::python::numpy::ndarray getNumpyX() const;
#endif
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_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript::NullDomain::probeInterpolationOnDomain
virtual bool probeInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
True if interpolation is possible from source to target.
Definition: NullDomain.cpp:71
escript::NullDomain::getDescription
virtual std::string getDescription() const
Return a description for this domain.
Definition: NullDomain.cpp:47
getTag
int getTag(unsigned char sourcex, unsigned char sourcey, unsigned char sourcez, unsigned char targetx, unsigned char targety, unsigned char targetz)
Definition: blocktools.cpp:413
escript::NullDomain::preferredInterpolationOnDomain
virtual signed char preferredInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
Preferred direction of interpolation. If you really need to test for a particular direction,...
Definition: NullDomain.cpp:142
escript::NullDomain
NullDomain provides a null value for domain. Needed for the construction of a default FunctionSpace.
Definition: NullDomain.h:54
escript::DomainException
Definition: DomainException.h:41
escript::AbstractDomain::throwStandardException
void throwStandardException(const std::string &functionName) const
Throw a standard exception. This function is called if any attempt is made to use a base class functi...
Definition: AbstractDomain.cpp:57
escript::NullDomain::getNormal
virtual escript::Data getNormal() const
Return boundary normals. The function space is chosen appropriately.
Definition: NullDomain.cpp:169
escript::NullDomain::write
virtual void write(const std::string &filename) const
Writes the domain to an external file filename.
Definition: NullDomain.cpp:118
escript::NullDomain::setToGradient
virtual void setToGradient(escript::Data &grad, const escript::Data &arg) const
Copies the gradient of arg into grad. The actual function space to be considered for the gradient is ...
Definition: NullDomain.cpp:178
escript::FunctionSpace
Definition: FunctionSpace.h:49
escript::Data::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
escript::NullDomain::borrowListOfTagsInUse
virtual const int * borrowListOfTagsInUse(int functionSpaceCode) const
Definition: NullDomain.cpp:104
speckley::probeInterpolationAcross
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition: CrossDomainCoupler.cpp:32
escript::FunctionSpace::getDomain
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:103
weipa::VisItControl::initialize
bool initialize(const std::string &simFile, const std::string &comment)
Definition: VisItControl.cpp:206
system_dep.h
MPI_COMM_WORLD
#define MPI_COMM_WORLD
Definition: EsysMPI.h:48
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
escript::NullDomain::functionSpaceTypeAsString
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const
Return a description for the given function space type code.
Definition: NullDomain.cpp:52
escript::NullDomain::ownSample
virtual bool ownSample(int fs_code, DataTypes::index_t id) const
True if this rank owns the sample(id) Must be implemented by the Domain adapter.
Definition: NullDomain.cpp:132
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:71
escript::NullDomain::getDataShape
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: NullDomain.cpp:85
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:72
escript::NullDomain::randomFill
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: NullDomain.cpp:109
DomainException.h
escript::NullDomain::getSize
virtual escript::Data getSize() const
Returns the local size of samples. The function space is chosen appropriately.
Definition: NullDomain.cpp:182
AbstractDomain.h
escript::NullDomain::setToX
virtual void setToX(escript::Data &out) const
Copies the location of data points on the domain into out. The actual function space to be considered...
Definition: NullDomain.cpp:207
escript::NullDomain::dump
virtual void dump(const std::string &filename) const
dumps the domain to an external file filename.
Definition: NullDomain.cpp:114
escript::NullDomain::setTagMap
virtual void setTagMap(const std::string &name, int tag)
sets a map from a clear tag name to a tag key
Definition: NullDomain.cpp:157
escript::NullDomain::setNewX
virtual void setNewX(const escript::Data &arg)
Assigns new location to the domain.
Definition: NullDomain.cpp:165
escript::NullDomain::setToNormal
virtual void setToNormal(escript::Data &out) const
Copies the surface normals at data points into out. The actual function space to be considered is def...
Definition: NullDomain.cpp:174
escript::NullDomain::setTags
virtual void setTags(int functionSpaceType, int newTag, const escript::Data &mask) const
assigns new tag newTag to all samples of functionspace with a positive value of mask for any its samp...
Definition: NullDomain.cpp:161
escript::NullDomain::isCellOriented
virtual bool isCellOriented(int functionSpaceCode) const
returns true if data on this domain and a function space of type functionSpaceCode has to considered ...
Definition: NullDomain.cpp:127
escript::NullDomain::referenceID
static DataTypes::dim_t referenceID
Definition: NullDomain.h:72
escript::NullDomain::getTag
virtual int getTag(const std::string &name) const
Return the tag key for tag name.
Definition: NullDomain.cpp:152
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:88
escript::NullDomain::showTagNames
virtual std::string showTagNames() const
Returns all tag names in a single string sperated by commas.
Definition: NullDomain.cpp:147
escript
Definition: AbstractContinuousDomain.cpp:23
escript::NullDomain::commonFunctionSpace
virtual 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: NullDomain.cpp:122
NullDomain.h
escript::NullDomain::getX
virtual escript::Data getX() const
Returns locations in the domain. The function space is chosen appropriately.
Definition: NullDomain.cpp:191
escript::NullDomain::interpolateAcross
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: NullDomain.cpp:80
MPI_Comm
int MPI_Comm
Definition: EsysMPI.h:42
escript::NullDomain::setToSize
virtual void setToSize(escript::Data &out) const
Copies the size of samples into out. The actual function space to be considered is defined by out....
Definition: NullDomain.cpp:187
Data.h
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:64
escript::NullDomain::operator==
virtual bool operator==(const AbstractDomain &other) const
Return true if given domains are equal.
Definition: NullDomain.cpp:94
escript::NullDomain::getApproximationOrder
virtual int getApproximationOrder(const int functionSpaceCode) const
returns the approximation order used for a function space functionSpaceCode
Definition: NullDomain.cpp:137
escript::NullDomain::interpolateOnDomain
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: NullDomain.cpp:62
escript::NullDomain::getMPI
virtual JMPI getMPI() const
returns a shared pointer to the MPI information wrapper for this domain
Definition: NullDomain.cpp:57
escript::NullDomain::NullDomainFS
static int NullDomainFS
Definition: NullDomain.h:71