Go to the documentation of this file.
19 #ifndef __ESCRIPT_FUNCTIONSPACE_H__
20 #define __ESCRIPT_FUNCTIONSPACE_H__
26 #include <boost/python/list.hpp>
42 FunctionSpace(
const FunctionSpace& other);
49 int getTypeCode()
const;
71 int getApproximationOrder()
const;
77 void setTags(
const int newTag,
const escript::Data& mask)
const;
79 void setTagsByString(
const std::string& name,
const escript::Data& mask)
const;
85 std::pair<int,DataTypes::dim_t> getDataShape()
const;
98 std::string toString()
const;
124 return borrowSampleReferenceIDs()[sampleNo];
133 return m_domain->ownSample(m_functionSpaceType, sampleNo);
146 #ifdef ESYS_HAVE_BOOST_NUMPY
150 boost::python::numpy::ndarray getNumpyX()
const;
174 int getNumDPPSample()
const {
return getNumDataPointsPerSample(); }
177 int getNumDataPointsPerSample()
const {
return getDataShape().first; }
183 int getDim()
const {
return getDomain()->getDim(); }
188 boost::python::list getListOfTags()
const;
193 std::list<int> getListOfTagsSTL()
const;
198 int getNumberOfTagsInUse()
const;
200 const int* borrowListOfTagsInUse()
const;
209 return domain->probeInterpolationOnDomain(
212 return domain->probeInterpolationAcross(
222 FunctionSpace& operator=(
const FunctionSpace& other);
226 int m_functionSpaceType;
233 #endif // __ESCRIPT_FUNCTIONSPACE_H__
DataTypes::dim_t getReferenceIDFromDataPointNo(DataTypes::dim_t dataPointNo) const
Returns the reference number associated with the given data-point number.
Definition: FunctionSpace.cpp:179
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
int getNumDataPointsPerSample() const
Return the number of data points per sample.
Definition: Data.h:544
int getTagFromSampleNo(DataTypes::dim_t sampleNo) const
Returns the tag associated with the given sample number.
Definition: FunctionSpace.cpp:144
escript::Data getSize() const
Returns the sample size (e.g. the diameter of elements, radius of particles).
Definition: FunctionSpace.cpp:295
Domain_ptr getDomainPython() const
Return the function space domain. Internal use only! This gets around some python difficulties by cas...
Definition: FunctionSpace.cpp:109
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:79
int m_functionSpaceType
Definition: FunctionSpace.h:240
NullDomain provides a null value for domain. Needed for the construction of a default FunctionSpace.
Definition: NullDomain.h:54
std::pair< int, DataTypes::dim_t > getDataShape() const
Returns the shape of the data needed to represent the function space.
Definition: FunctionSpace.cpp:89
DataTypes::dim_t getNumSamples() const
Returns the number of samples.
Definition: FunctionSpace.h:182
const DataTypes::ShapeType & getDataPointShape() const
Return a reference to the data point shape.
Definition: Data.h:705
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:55
FunctionSpace & operator=(const FunctionSpace &other)
Assignment operator. This method is only defined (private) to prevent people from using it.
Definition: FunctionSpace.cpp:207
Definition: FunctionSpace.h:49
std::list< int > getListOfTagsSTL() const
Returns an stl list of the tags used in this function space.
Definition: FunctionSpace.cpp:335
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
bool canTag() const
Returns true if this function space support tags.
Definition: FunctionSpace.cpp:353
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:103
bool initialize(const std::string &simFile, const std::string &comment)
Definition: VisItControl.cpp:206
int getNumSamples() const
Return the number of samples.
Definition: Data.h:533
escript::Data getNormal() const
Returns the surface normal field.
Definition: FunctionSpace.cpp:286
Data represents a collection of datapoints.
Definition: Data.h:64
Definition: DataException.h:41
const_Domain_ptr m_domain
Definition: FunctionSpace.h:238
escript::Data getX() const
Returns the spatial locations of the data points.
Definition: FunctionSpace.cpp:229
index_t dim_t
Definition: DataTypes.h:93
void setTags(const int newTag, const escript::Data &mask) const
Assigns new tag newTag to all samples with a positive value of mask for any of its sample points.
Definition: FunctionSpace.cpp:304
DataTypes::real_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
Return the sample data for the given sample no. Please do not use this unless you NEED to access samp...
Definition: Data.h:1954
int getNumDPPSample() const
Returns the number of data points per sample.
Definition: FunctionSpace.h:188
int getApproximationOrder() const
Returns the approximation order used for this function space.
Definition: FunctionSpace.cpp:359
boost::python::list getListOfTags() const
Returns a list of the tags used in this function space.
Definition: FunctionSpace.cpp:343
Definition: FunctionSpaceException.h:42
const int * borrowListOfTagsInUse() const
Definition: FunctionSpace.cpp:330
bool canInterpolate(FunctionSpace src, FunctionSpace dest)
Definition: FunctionSpace.cpp:34
Definition: AbstractContinuousDomain.cpp:23
void setTagsByString(const std::string &name, const escript::Data &mask) const
Definition: FunctionSpace.cpp:314
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:95
std::string toString() const
Returns a text description of the function space.
Definition: FunctionSpace.cpp:118
Data Vector(double value, const FunctionSpace &what, bool expanded)
Return a Data object containing vector data-points. ie: rank 1 data-points.
Definition: DataFactory.cpp:139
long getShapeProduct() const
Returns the product of the data point shapes.
Definition: Data.cpp:745
const DataTypes::dim_t * borrowSampleReferenceIDs() const
Returns a borrowed reference to the list of sample reference IDs.
Definition: FunctionSpace.cpp:199
bool operator!=(const FunctionSpace &other) const
Definition: FunctionSpace.cpp:223
Data Scalar(double value, const FunctionSpace &what, bool expanded)
A collection of factory functions for creating Data objects which contain data points of various shap...
Definition: DataFactory.cpp:63
boost::shared_ptr< const AbstractDomain > const_Domain_ptr
Definition: AbstractDomain.h:58
FunctionSpace()
Definition: FunctionSpace.cpp:47
void setProtection()
switches on update protection
Definition: Data.cpp:1166
bool operator==(const FunctionSpace &other) const
Comparison operator. Returns true if function spaces are equal. (i.e. same domain and same function s...
Definition: FunctionSpace.cpp:217
int getNumberOfTagsInUse() const
Returns the number of tags in use.
Definition: FunctionSpace.cpp:325
int getTagFromDataPointNo(DataTypes::dim_t dataPointNo) const
Returns the tag associated with the given data-point number.
Definition: FunctionSpace.cpp:150