Go to the documentation of this file.
19 #ifndef __ESCRIPT_ABSTRACTDOMAIN_H__
20 #define __ESCRIPT_ABSTRACTDOMAIN_H__
27 #include <boost/python/tuple.hpp>
28 #ifdef ESYS_HAVE_BOOST_NUMPY
29 #include <boost/python/numpy.hpp>
154 virtual void write(
const std::string& filename)
const = 0;
162 virtual void dump(
const std::string& filename)
const = 0;
175 virtual std::pair<int,DataTypes::dim_t>
getDataShape(
int functionSpaceCode)
const = 0;
191 virtual void setTagMap(
const std::string& name,
int tag) = 0;
198 virtual int getTag(
const std::string& name)
const = 0;
205 virtual bool isValidTagName(
const std::string& name)
const;
242 int functionSpaceType_target)
const = 0;
254 int functionSpaceType_source,
255 int functionSpaceType_target)
const = 0;
277 int functionSpaceType_target)
const = 0;
285 #ifdef ESYS_HAVE_BOOST_NUMPY
290 virtual boost::python::numpy::ndarray getNumpyX()
const = 0;
381 void throwStandardException(
const std::string& functionName)
const;
395 virtual bool canTag(
int functionspacecode)
const = 0;
407 virtual bool supportsFilter(
const boost::python::tuple& t)
const;
414 const boost::python::tuple& filter)
const = 0;
419 #endif // __ESCRIPT_ABSTRACTDOMAIN_H__
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
virtual void setToNormal(escript::Data &out) const =0
Copies the surface normals at data points into out. The actual function space to be considered is def...
virtual signed char preferredInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const =0
Preferred direction of interpolation. If you really need to test for a particular direction,...
virtual void setToGradient(escript::Data &grad, const escript::Data &arg) const =0
Copies the gradient of arg into grad. The actual function space to be considered for the gradient is ...
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:33
virtual int getTag(const std::string &name) const =0
Return the tag key for tag name.
Definition: DomainException.h:28
virtual bool isValidTagName(const std::string &name) const
Returns True if name is a defined tag name.
Definition: AbstractDomain.cpp:53
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:43
Domain_ptr getPtr()
Returns smart pointer which is managing this object. If one does not exist yet it creates one.
Definition: AbstractDomain.cpp:25
virtual int getTagFromSampleNo(int functionSpaceType, DataTypes::index_t sampleNo) const =0
Return the tag key for the given sample number.
virtual int getApproximationOrder(const int functionSpaceCode) const =0
returns the approximation order used for a function space functionSpaceCode
virtual bool isCellOriented(int functionSpaceCode) const =0
returns true if data on this domain and a function space of type functionSpaceCode has to considered ...
int StatusType
Definition: AbstractDomain.h:53
virtual escript::Data getX() const =0
Returns locations in the domain. The function space is chosen appropriately.
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:41
virtual JMPI getMPI() const =0
returns a shared pointer to the MPI information wrapper for this domain
virtual int getNumberOfTagsInUse(int functionSpaceCode) const =0
returns the number of tags in use and a pointer to an array with the number of tags in use
Definition: FunctionSpace.h:36
virtual bool probeInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const =0
True if interpolation is possible from source to target.
virtual bool canTag(int functionspacecode) const =0
Checks if this domain allows tags for the specified functionSpaceCode.
virtual std::string getDescription() const =0
Return a description for this domain.
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:31
virtual bool commonFunctionSpace(const std::vector< int > &fs, int &resultcode) const =0
given a vector of FunctionSpace type codes, pass back a code which then can all be interpolated to.
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const =0
Return a description for the given function space type code.
virtual StatusType getStatus() const
Returns a status indicator of the domain. The status identifier should be unique over the live time i...
Definition: AbstractDomain.cpp:48
virtual void interpolateOnDomain(escript::Data &target, const escript::Data &source) const =0
Interpolates data given on source onto target where source and target have to be given on the same do...
Typedefs and macros for reference counted storage.
virtual bool onMasterProcessor() const =0
Return true if on MPI master, else false.
Data represents a collection of datapoints.
Definition: Data.h:64
virtual const DataTypes::dim_t * borrowSampleReferenceIDs(int functionSpaceType) const =0
Returns a borrowed pointer to the sample reference number id list.
index_t dim_t
Definition: DataTypes.h:65
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:43
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:72
virtual bool operator!=(const AbstractDomain &other) const =0
Return true if given domains are not equal.
virtual void dump(const std::string &filename) const =0
dumps the domain to an external file filename.
virtual void setTagMap(const std::string &name, int tag)=0
sets a map from a clear tag name to a tag key
virtual bool isValidFunctionSpaceType(int functionSpaceType) const =0
Returns true if the given integer is a valid function space type for this domain.
virtual bool ownSample(int fs_code, DataTypes::index_t id) const =0
True if this rank owns the sample(id) Must be implemented by the Domain adapter.
virtual bool supportsContactElements() const =0
virtual escript::Data getNormal() const =0
Return boundary normals. The function space is chosen appropriately.
virtual int getDim() const =0
Returns the spatial dimension of the domain.
virtual escript::Data randomFill(const DataTypes::ShapeType &shape, const FunctionSpace &what, long seed, const boost::python::tuple &filter) const =0
Fills the data object with filtered random values.
virtual escript::Data getSize() const =0
Returns the local size of samples. The function space is chosen appropriately.
virtual MPI_Comm getMPIComm() const =0
get the communicator for this domain. Returns an integer on non-MPI builds Routine must be implemente...
virtual void interpolateAcross(escript::Data &target, const escript::Data &source) const =0
Interpolates data given on source onto target where source and target are given on different domains.
virtual void setToX(escript::Data &out) const =0
Copies the location of data points on the domain into out. The actual function space to be considered...
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:60
virtual std::pair< int, DataTypes::dim_t > getDataShape(int functionSpaceCode) const =0
Returns the number of data points per sample, and the number of samples as a pair.
Definition: AbstractContinuousDomain.cpp:23
virtual const int * borrowListOfTagsInUse(int functionSpaceCode) const =0
virtual void MPIBarrier() const =0
If compiled for MPI then execute an MPI_Barrier, else do nothing.
virtual int getMPISize() const =0
return the number of processors used for this domain
virtual bool supportsFilter(const boost::python::tuple &t) const
true if this domain can handle to specified tuple of filter options.
Definition: AbstractDomain.cpp:58
int MPI_Comm
Definition: EsysMPI.h:42
virtual bool probeInterpolationAcross(int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const =0
Base class for all escript domains.
Definition: AbstractDomain.h:51
virtual bool operator==(const AbstractDomain &other) const =0
Return true if given domains are equal.
virtual void setNewX(const escript::Data &arg)=0
Assigns new location to the domain.
virtual std::string showTagNames() const =0
Returns all tag names in a single string sperated by commas.
virtual ~AbstractDomain()
Destructor for AbstractDomain.
Definition: AbstractDomain.h:69
boost::shared_ptr< const AbstractDomain > const_Domain_ptr
Definition: AbstractDomain.h:44
virtual void setToSize(escript::Data &out) const =0
Copies the size of samples into out. The actual function space to be considered is defined by out....
virtual void write(const std::string &filename) const =0
Writes the domain to an external file filename.
virtual int getMPIRank() const =0
return the number MPI rank of this processor
virtual void setTags(int functionSpaceType, int newTag, const escript::Data &mask) const =0
assigns new tag newTag to all samples of functionspace with a positive value of mask for any its samp...