escript  Revision_
Public Member Functions | Private Member Functions | Private Attributes | List of all members
escript::FunctionSpace Class Reference

#include <FunctionSpace.h>

Public Member Functions

 FunctionSpace ()
 
 FunctionSpace (const_Domain_ptr domain, int functionSpaceType)
 
 FunctionSpace (const FunctionSpace &other)
 
int getTypeCode () const
 Returns the function space type code. More...
 
const_Domain_ptr getDomain () const
 Returns the function space domain. More...
 
Domain_ptr getDomainPython () const
 Return the function space domain. Internal use only! This gets around some python difficulties by casting away the const. Do not use this in C++. More...
 
bool canTag () const
 Returns true if this function space support tags. More...
 
int getApproximationOrder () const
 Returns the approximation order used for this function space. More...
 
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. More...
 
void setTagsByString (const std::string &name, const escript::Data &mask) const
 
std::pair< int, DataTypes::dim_tgetDataShape () const
 Returns the shape of the data needed to represent the function space. More...
 
bool operator== (const FunctionSpace &other) const
 Comparison operator. Returns true if function spaces are equal. (i.e. same domain and same function space type) More...
 
bool operator!= (const FunctionSpace &other) const
 
std::string toString () const
 Returns a text description of the function space. More...
 
int getTagFromSampleNo (DataTypes::dim_t sampleNo) const
 Returns the tag associated with the given sample number. More...
 
int getTagFromDataPointNo (DataTypes::dim_t dataPointNo) const
 Returns the tag associated with the given data-point number. More...
 
DataTypes::dim_t getReferenceIDFromDataPointNo (DataTypes::dim_t dataPointNo) const
 Returns the reference number associated with the given data-point number. More...
 
DataTypes::dim_t getReferenceIDOfSample (DataTypes::dim_t sampleNo) const
 Returns the reference number associated with the given sample number. This function is not efficient. It is better to first call borrowSampleReferenceIDs and then when iterating over sampleNo to use sampleNo as an offset. More...
 
bool ownSample (DataTypes::dim_t sampleNo) const
 Does this process own the sample? For non-MPI builds will always return true. More...
 
const DataTypes::dim_tborrowSampleReferenceIDs () const
 Returns a borrowed reference to the list of sample reference IDs. More...
 
escript::Data getX () const
 Returns the spatial locations of the data points. More...
 
escript::Data getNormal () const
 Returns the surface normal field. More...
 
escript::Data getSize () const
 Returns the sample size (e.g. the diameter of elements, radius of particles). More...
 
DataTypes::dim_t getNumSamples () const
 Returns the number of samples. More...
 
int getNumDPPSample () const
 Returns the number of data points per sample. More...
 
int getNumDataPointsPerSample () const
 
int getDim () const
 Return the number of spatial dimensions of the underlying domain. More...
 
boost::python::list getListOfTags () const
 Returns a list of the tags used in this function space. More...
 
std::list< int > getListOfTagsSTL () const
 Returns an stl list of the tags used in this function space. More...
 
int getNumberOfTagsInUse () const
 Returns the number of tags in use. More...
 
const int * borrowListOfTagsInUse () const
 
bool probeInterpolation (const FunctionSpace &other) const
 

Private Member Functions

FunctionSpaceoperator= (const FunctionSpace &other)
 Assignment operator. This method is only defined (private) to prevent people from using it. More...
 

Private Attributes

const_Domain_ptr m_domain
 
int m_functionSpaceType
 

Constructor & Destructor Documentation

◆ FunctionSpace() [1/3]

escript::FunctionSpace::FunctionSpace ( )

◆ FunctionSpace() [2/3]

escript::FunctionSpace::FunctionSpace ( const_Domain_ptr  domain,
int  functionSpaceType 
)

References m_domain.

◆ FunctionSpace() [3/3]

escript::FunctionSpace::FunctionSpace ( const FunctionSpace other)

Member Function Documentation

◆ borrowListOfTagsInUse()

const int * escript::FunctionSpace::borrowListOfTagsInUse ( ) const

References m_domain, and m_functionSpaceType.

Referenced by getListOfTags(), and getListOfTagsSTL().

◆ borrowSampleReferenceIDs()

const DataTypes::dim_t * escript::FunctionSpace::borrowSampleReferenceIDs ( ) const

Returns a borrowed reference to the list of sample reference IDs.

References m_domain, and m_functionSpaceType.

Referenced by escript::DataExpanded::dump(), getReferenceIDFromDataPointNo(), weipa::DataVar::initFromEscript(), and escript::load().

◆ canTag()

bool escript::FunctionSpace::canTag ( ) const

Returns true if this function space support tags.

References m_domain, and m_functionSpaceType.

Referenced by escript::DataTagged::DataTagged().

◆ getApproximationOrder()

int escript::FunctionSpace::getApproximationOrder ( ) const

Returns the approximation order used for this function space.

References m_domain, and m_functionSpaceType.

Referenced by BOOST_PYTHON_MODULE().

◆ getDataShape()

std::pair< int, DataTypes::dim_t > escript::FunctionSpace::getDataShape ( ) const

Returns the shape of the data needed to represent the function space.

References m_domain, and m_functionSpaceType.

◆ getDim()

int escript::FunctionSpace::getDim ( ) const
inline

◆ getDomain()

const_Domain_ptr escript::FunctionSpace::getDomain ( ) const

Returns the function space domain.

References m_domain.

Referenced by escript::C_TensorBinaryOperation(), escript::canInterpolate(), escript::Data::getDomain(), getNormal(), getSize(), getX(), escript::Data::gradOn(), escript::Data::init_from_data_and_fs(), escript::TestDomain::interpolateOnDomain(), escript::NullDomain::interpolateOnDomain(), speckley::SpeckleyDomain::interpolateOnDomain(), ripley::RipleyDomain::interpolateOnDomain(), dudley::DudleyDomain::interpolateOnDomain(), finley::FinleyDomain::interpolateOnDomain(), ripley::RipleyDomain::newSystemMatrix(), dudley::DudleyDomain::newSystemMatrix(), finley::FinleyDomain::newSystemMatrix(), ripley::RipleyDomain::newTransportProblem(), dudley::DudleyDomain::newTransportProblem(), finley::FinleyDomain::newTransportProblem(), probeInterpolation(), escript::randomData(), speckley::readBinaryGrid(), ripley::readBinaryGrid(), speckley::readBinaryGridFromZipped(), ripley::readBinaryGridFromZipped(), speckley::readNcGrid(), ripley::readNcGrid(), dudley::DudleyDomain::setNewX(), finley::FinleyDomain::setNewX(), escript::Data::setTaggedValueByName(), speckley::SpeckleyDomain::setToGradient(), ripley::RipleyDomain::setToGradient(), dudley::DudleyDomain::setToGradient(), finley::FinleyDomain::setToGradient(), speckley::SpeckleyDomain::setToIntegrals(), ripley::RipleyDomain::setToIntegrals(), dudley::DudleyDomain::setToIntegrals(), finley::FinleyDomain::setToIntegrals(), dudley::DudleyDomain::setToNormal(), finley::FinleyDomain::setToNormal(), speckley::SpeckleyDomain::setToX(), ripley::RipleyDomain::setToX(), dudley::DudleyDomain::setToX(), finley::FinleyDomain::setToX(), escript::Tensor(), escript::Tensor3(), escript::Tensor3FromObj(), escript::Tensor4(), escript::Tensor4FromObj(), escript::TensorFromObj(), escript::Data::TensorSelfUpdateBinaryOperation(), escript::Vector(), and escript::VectorFromObj().

◆ getDomainPython()

Domain_ptr escript::FunctionSpace::getDomainPython ( ) const

Return the function space domain. Internal use only! This gets around some python difficulties by casting away the const. Do not use this in C++.

References m_domain.

Referenced by BOOST_PYTHON_MODULE(), and escript::Data::getDomainPython().

◆ getListOfTags()

boost::python::list escript::FunctionSpace::getListOfTags ( ) const

Returns a list of the tags used in this function space.

References borrowListOfTagsInUse(), and getNumberOfTagsInUse().

Referenced by BOOST_PYTHON_MODULE().

◆ getListOfTagsSTL()

std::list< int > escript::FunctionSpace::getListOfTagsSTL ( ) const

Returns an stl list of the tags used in this function space.

References borrowListOfTagsInUse(), and getNumberOfTagsInUse().

Referenced by escript::Data::reduction().

◆ getNormal()

escript::Data escript::FunctionSpace::getNormal ( ) const

◆ getNumberOfTagsInUse()

int escript::FunctionSpace::getNumberOfTagsInUse ( ) const

Returns the number of tags in use.

References m_domain, and m_functionSpaceType.

Referenced by getListOfTags(), and getListOfTagsSTL().

◆ getNumDataPointsPerSample()

int escript::FunctionSpace::getNumDataPointsPerSample ( ) const
inline

◆ getNumDPPSample()

int escript::FunctionSpace::getNumDPPSample ( ) const
inline

Returns the number of data points per sample.

Referenced by escript::DataExpanded::DataExpanded(), getReferenceIDFromDataPointNo(), and getTagFromDataPointNo().

◆ getNumSamples()

DataTypes::dim_t escript::FunctionSpace::getNumSamples ( ) const
inline

◆ getReferenceIDFromDataPointNo()

DataTypes::dim_t escript::FunctionSpace::getReferenceIDFromDataPointNo ( DataTypes::dim_t  dataPointNo) const

Returns the reference number associated with the given data-point number.

References borrowSampleReferenceIDs(), getNumDPPSample(), and getNumSamples().

Referenced by BOOST_PYTHON_MODULE().

◆ getReferenceIDOfSample()

DataTypes::dim_t escript::FunctionSpace::getReferenceIDOfSample ( DataTypes::dim_t  sampleNo) const
inline

Returns the reference number associated with the given sample number. This function is not efficient. It is better to first call borrowSampleReferenceIDs and then when iterating over sampleNo to use sampleNo as an offset.

Referenced by escript::DataExpanded::reorderByReferenceIDs(), and escript::DataExpanded::toString().

◆ getSize()

escript::Data escript::FunctionSpace::getSize ( ) const

◆ getTagFromDataPointNo()

int escript::FunctionSpace::getTagFromDataPointNo ( DataTypes::dim_t  dataPointNo) const

Returns the tag associated with the given data-point number.

References getNumDPPSample(), getNumSamples(), and getTagFromSampleNo().

Referenced by BOOST_PYTHON_MODULE(), and escript::Data::getTagNumber().

◆ getTagFromSampleNo()

int escript::FunctionSpace::getTagFromSampleNo ( DataTypes::dim_t  sampleNo) const

◆ getTypeCode()

int escript::FunctionSpace::getTypeCode ( ) const

Returns the function space type code.

Note
The meaning of the code depends on the domain object the FunctionSpace is built on.

References m_functionSpaceType.

Referenced by dudley::Assemble_CopyNodalData(), finley::Assemble_CopyNodalData(), finley::Assemble_getNormal(), finley::Assemble_getSize(), dudley::Assemble_gradient(), finley::Assemble_gradient(), dudley::Assemble_interpolate(), finley::Assemble_interpolate(), dudley::Assemble_LumpedSystem(), finley::Assemble_LumpedSystem(), dudley::Assemble_NodeCoordinates(), finley::Assemble_NodeCoordinates(), dudley::Assemble_PDE(), finley::Assemble_PDE(), speckley::Brick::assembleGradient(), ripley::Brick::assembleGradient(), ripley::Rectangle::assembleGradient(), speckley::Rectangle::assembleGradient(), ripley::WaveAssembler2D::assemblePDESystem(), ripley::WaveAssembler3D::assemblePDESystem(), escript::C_TensorBinaryOperation(), escript::canInterpolate(), escript::DataConstant::dump(), escript::DataExpanded::dump(), escript::DataTagged::dump(), escript::Data::get_MPIComm(), escript::MPIDataReducer::getCompatibilityInfo(), finley::util::hasReducedIntegrationOrder(), dudley::hasReducedIntegrationOrder(), weipa::DataVar::initFromEscript(), ripley::MultiBrick::interpolateAcross(), ripley::MultiRectangle::interpolateAcross(), speckley::Brick::interpolateElementsOnNodes(), speckley::Rectangle::interpolateElementsOnNodes(), speckley::SpeckleyDomain::interpolateOnDomain(), ripley::RipleyDomain::interpolateOnDomain(), dudley::DudleyDomain::interpolateOnDomain(), finley::FinleyDomain::interpolateOnDomain(), ripley::RipleyDomain::newSystemMatrix(), dudley::DudleyDomain::newSystemMatrix(), finley::FinleyDomain::newSystemMatrix(), ripley::RipleyDomain::newTransportProblem(), dudley::DudleyDomain::newTransportProblem(), finley::FinleyDomain::newTransportProblem(), probeInterpolation(), ripley::Brick::readBinaryGridImpl(), ripley::Rectangle::readBinaryGridImpl(), speckley::Brick::readBinaryGridImpl(), speckley::Rectangle::readBinaryGridImpl(), ripley::Brick::readNcGrid(), ripley::Rectangle::readNcGrid(), speckley::Rectangle::readNcGrid(), speckley::Brick::readNcGrid(), escript::saveDataCSV(), speckley::SpeckleyDomain::setToGradient(), ripley::RipleyDomain::setToGradient(), dudley::DudleyDomain::setToGradient(), finley::FinleyDomain::setToGradient(), speckley::SpeckleyDomain::setToIntegrals(), ripley::RipleyDomain::setToIntegrals(), dudley::DudleyDomain::setToIntegrals(), finley::FinleyDomain::setToIntegrals(), ripley::Brick::setToNormal(), ripley::Rectangle::setToNormal(), ripley::MultiBrick::setToNormal(), dudley::DudleyDomain::setToNormal(), finley::FinleyDomain::setToNormal(), ripley::Brick::setToSize(), speckley::Brick::setToSize(), ripley::Rectangle::setToSize(), speckley::Rectangle::setToSize(), ripley::MultiBrick::setToSize(), dudley::DudleyDomain::setToSize(), finley::FinleyDomain::setToSize(), speckley::SpeckleyDomain::setToX(), ripley::RipleyDomain::setToX(), dudley::DudleyDomain::setToX(), finley::FinleyDomain::setToX(), escript::Data::TensorSelfUpdateBinaryOperation(), speckley::RipleyCoupler::validInterpolation(), speckley::WaveAssembler2D::WaveAssembler2D(), ripley::WaveAssembler2D::WaveAssembler2D(), ripley::WaveAssembler3D::WaveAssembler3D(), speckley::WaveAssembler3D::WaveAssembler3D(), ripley::Brick::writeBinaryGridImpl(), ripley::Rectangle::writeBinaryGridImpl(), speckley::Brick::writeBinaryGridImpl(), and speckley::Rectangle::writeBinaryGridImpl().

◆ getX()

escript::Data escript::FunctionSpace::getX ( ) const

◆ operator!=()

bool escript::FunctionSpace::operator!= ( const FunctionSpace other) const

References operator==().

◆ operator=()

FunctionSpace & escript::FunctionSpace::operator= ( const FunctionSpace other)
private

Assignment operator. This method is only defined (private) to prevent people from using it.

◆ operator==()

bool escript::FunctionSpace::operator== ( const FunctionSpace other) const

Comparison operator. Returns true if function spaces are equal. (i.e. same domain and same function space type)

References m_domain, and m_functionSpaceType.

Referenced by operator!=().

◆ ownSample()

bool escript::FunctionSpace::ownSample ( DataTypes::dim_t  sampleNo) const
inline

Does this process own the sample? For non-MPI builds will always return true.

Referenced by escript::saveDataCSV().

◆ probeInterpolation()

bool escript::FunctionSpace::probeInterpolation ( const FunctionSpace other) const
inline

◆ setTags()

void escript::FunctionSpace::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.

References escript::Data::getFunctionSpace(), m_domain, and m_functionSpaceType.

Referenced by BOOST_PYTHON_MODULE().

◆ setTagsByString()

void escript::FunctionSpace::setTagsByString ( const std::string &  name,
const escript::Data mask 
) const

◆ toString()

std::string escript::FunctionSpace::toString ( ) const

Member Data Documentation

◆ m_domain

const_Domain_ptr escript::FunctionSpace::m_domain
private

◆ m_functionSpaceType

int escript::FunctionSpace::m_functionSpaceType
private

The documentation for this class was generated from the following files: