AbstractDomain.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_ABSTRACTDOMAIN_H__
#define __ESCRIPT_ABSTRACTDOMAIN_H__
#include "system_dep.h"
#include "DataTypes.h"
#include "EsysMPI.h"
#include "Pointers.h"
#include <boost/python/tuple.hpp>
#include <vector>
#include <string>
namespace escript {
// class forward declarations
class Data;
class FunctionSpace;
class AbstractDomain;
typedef POINTER_WRAPPER_CLASS(AbstractDomain) Domain_ptr;
typedef POINTER_WRAPPER_CLASS(const AbstractDomain) const_Domain_ptr;
class ESCRIPT_DLL_API AbstractDomain: public REFCOUNT_BASE_CLASS(AbstractDomain)
{
public:
typedef int StatusType;
Domain_ptr getPtr();
const_Domain_ptr getPtr() const;
virtual ~AbstractDomain() {}
virtual JMPI getMPI() const = 0;
virtual int getMPISize() const = 0;
virtual int getMPIRank() const = 0;
virtual void MPIBarrier() const = 0;
virtual bool onMasterProcessor() const = 0;
virtual MPI_Comm getMPIComm() const = 0;
virtual bool isValidFunctionSpaceType(int functionSpaceType) const = 0;
virtual std::string getDescription() const = 0;
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const = 0;
virtual int getDim() const = 0;
virtual bool operator==(const AbstractDomain& other) const = 0;
virtual bool operator!=(const AbstractDomain& other) const = 0;
virtual void write(const std::string& filename) const = 0;
virtual void dump(const std::string& filename) const = 0;
virtual std::pair<int,DataTypes::dim_t> getDataShape(int functionSpaceCode) const = 0;
virtual int getTagFromSampleNo(int functionSpaceType, DataTypes::index_t sampleNo) const = 0;
virtual void setTagMap(const std::string& name, int tag) = 0;
virtual int getTag(const std::string& name) const = 0;
virtual bool isValidTagName(const std::string& name) const;
virtual std::string showTagNames() const = 0;
ESCRIPT_DLL_API
virtual const DataTypes::dim_t* borrowSampleReferenceIDs(int functionSpaceType) const = 0;
virtual void setNewX(const escript::Data& arg) = 0;
virtual void interpolateOnDomain(escript::Data& target, const escript::Data& source) const = 0;
virtual bool probeInterpolationOnDomain(int functionSpaceType_source,
int functionSpaceType_target) const = 0;
virtual signed char preferredInterpolationOnDomain(
int functionSpaceType_source,
int functionSpaceType_target) const = 0;
virtual bool
commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const = 0;
virtual void interpolateAcross(escript::Data& target, const escript::Data& source) const = 0;
virtual bool probeInterpolationAcross(int functionSpaceType_source,
const AbstractDomain& targetDomain,
int functionSpaceType_target) const = 0;
virtual escript::Data getX() const = 0;
virtual escript::Data getNormal() const = 0;
virtual escript::Data getSize() const = 0;
virtual void setToX(escript::Data& out) const = 0;
virtual void setToNormal(escript::Data& out) const = 0;
virtual void setToSize(escript::Data& out) const = 0;
virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const = 0;
virtual bool ownSample(int fs_code, DataTypes::index_t id) const = 0;
virtual void setTags(int functionSpaceType, int newTag, const escript::Data& mask) const = 0;
virtual bool isCellOriented(int functionSpaceCode) const = 0;
virtual StatusType getStatus() const;
void throwStandardException(const std::string& functionName) const;
virtual int getNumberOfTagsInUse(int functionSpaceCode) const = 0;
virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const = 0;
virtual bool canTag(int functionspacecode) const = 0;
virtual int getApproximationOrder(const int functionSpaceCode) const = 0;
virtual bool supportsContactElements() const = 0;
virtual bool supportsFilter(const boost::python::tuple& t) const;
virtual escript::Data randomFill(const DataTypes::ShapeType& shape,
const FunctionSpace& what, long seed,
const boost::python::tuple& filter) const = 0;
};
} // end of namespace
#endif // __ESCRIPT_ABSTRACTDOMAIN_H__
escript::FunctionSpace
Definition: FunctionSpace.h:34
POINTER_WRAPPER_CLASS
#define POINTER_WRAPPER_CLASS(x)
Definition: Pointers.h:32
speckley::probeInterpolationAcross
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition: CrossDomainCoupler.cpp:31
escript::Domain_ptr
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:36
escript
Definition: AbstractContinuousDomain.cpp:22
escript::AbstractDomain::~AbstractDomain
virtual ~AbstractDomain()
Destructor for AbstractDomain.
Definition: AbstractDomain.h:64
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
REFCOUNT_BASE_CLASS
#define REFCOUNT_BASE_CLASS(x)
Definition: Pointers.h:30
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:42
system_dep.h
Pointers.h
Typedefs and macros for reference counted storage.
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
escript::AbstractDomain::StatusType
int StatusType
Definition: AbstractDomain.h:48
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:63
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
EsysMPI.h
DataTypes.h
MPI_Comm
int MPI_Comm
Definition: EsysMPI.h:41
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:45
escript::const_Domain_ptr
boost::shared_ptr< const AbstractDomain > const_Domain_ptr
Definition: AbstractDomain.h:39
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:64