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;
int MPI_Comm
Definition: EsysMPI.h:44
Typedefs and macros for reference counted storage.
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:33
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:31
Base class for all escript domains.
Definition: AbstractDomain.h:51
virtual void dump(const std::string &filename) const =0
dumps the domain to an external file filename.
virtual int getTag(const std::string &name) const =0
Return the tag key for tag name.
virtual bool probeInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const =0
True if interpolation is possible from source to target.
virtual escript::Data getSize() const =0
Returns the local size of samples. The function space is chosen appropriately.
virtual int getMPIRank() const =0
return the number MPI rank of this processor
virtual const int * borrowListOfTagsInUse(int functionSpaceCode) const =0
virtual int getTagFromSampleNo(int functionSpaceType, DataTypes::index_t sampleNo) const =0
Return the tag key for the given sample number.
virtual const DataTypes::dim_t * borrowSampleReferenceIDs(int functionSpaceType) const =0
Returns a borrowed pointer to the sample reference number id list.
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...
virtual bool operator==(const AbstractDomain &other) const =0
Return true if given domains are equal.
virtual void setTagMap(const std::string &name, int tag)=0
sets a map from a clear tag name to a tag key
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 bool isValidFunctionSpaceType(int functionSpaceType) const =0
Returns true if the given integer is a valid function space type for this domain.
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 std::string getDescription() const =0
Return a description 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
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 bool canTag(int functionspacecode) const =0
Checks if this domain allows tags for the specified functionSpaceCode.
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 int getApproximationOrder(const int functionSpaceCode) const =0
returns the approximation order used for a function space functionSpaceCode
int StatusType
Definition: AbstractDomain.h:53
virtual int getDim() const =0
Returns the spatial dimension of 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
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 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 void setNewX(const escript::Data &arg)=0
Assigns new location to the domain.
virtual bool onMasterProcessor() const =0
Return true if on MPI master, else false.
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const =0
Return a description for the given function space type code.
virtual escript::Data getX() const =0
Returns locations in the domain. The function space is chosen appropriately.
virtual bool operator!=(const AbstractDomain &other) const =0
Return true if given domains are not equal.
virtual bool isCellOriented(int functionSpaceCode) const =0
returns true if data on this domain and a function space of type functionSpaceCode has to considered ...
virtual bool probeInterpolationAcross(int functionSpaceType_source, const AbstractDomain &targetDomain, int functionSpaceType_target) const =0
virtual void MPIBarrier() const =0
If compiled for MPI then execute an MPI_Barrier, else do nothing.
virtual void write(const std::string &filename) const =0
Writes the domain to an external file filename.
virtual int getMPISize() const =0
return the number of processors used for this domain
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...
virtual MPI_Comm getMPIComm() const =0
get the communicator for this domain. Returns an integer on non-MPI builds Routine must be implemente...
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.
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...
virtual escript::Data getNormal() const =0
Return boundary normals. The function space is chosen appropriately.
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 ...
virtual bool supportsContactElements() const =0
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 JMPI getMPI() const =0
returns a shared pointer to the MPI information wrapper for this domain
Data represents a collection of datapoints.
Definition: Data.h:64
Definition: FunctionSpace.h:36
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
index_t dim_t
Definition: DataTypes.h:66
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
Definition: AbstractContinuousDomain.cpp:23
boost::shared_ptr< const AbstractDomain > const_Domain_ptr
Definition: AbstractDomain.h:44
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:41
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74