escript  Revision_
Public Member Functions | Protected Member Functions | Private Types | List of all members
escript::DataEmpty Class Reference

Implements the DataAbstract interface for an empty Data object. More...

#include <DataEmpty.h>

Inheritance diagram for escript::DataEmpty:
escript::DataReady escript::DataAbstract

Public Member Functions

 DataEmpty ()
 Default constructor for DataEmpty. More...
 
virtual ~DataEmpty ()
 Destructor for DataEmpty. More...
 
virtual std::string toString () const
 Return a textual representation of the Data object. More...
 
virtual DataAbstractdeepCopy () const
 Return a deep copy of the current object. More...
 
virtual DataTypes::RealVectorType::size_type getPointOffset (int sampleNo, int dataPointNo) const
 Return the offset for the given sample. NB: This will throw an exception as obviously an empty Data object contains no samples. An implementation is required by parent DataAbstract class. More...
 
virtual DataTypes::RealVectorType::size_type getPointOffset (int sampleNo, int dataPointNo)
 
virtual DataTypes::RealVectorType::size_type getLength () const
 Return the number of doubles stored for the Data object. As this is an empty Data object, this method will always return 0. More...
 
virtual DataAbstractgetSlice (const DataTypes::RegionType &region) const
 Factory method that returns a newly created DataEmpty sliced from the current Data object according to the specified region. NB: This will throw an exception as obviously an empty Data object contains no data to slice from. An implementation is required by parent DataAbstract class. More...
 
virtual void setSlice (const DataAbstract *value, const DataTypes::RegionType &region)
 Set the current Data object according to the specified slice from the given input value. NB: This will throw an exception as obviously an empty Data object contains no data to slice to. An implementation is required by parent DataAbstract class. More...
 
int matrixInverse (DataAbstract *out) const
 invert square matricies More...
 
void dump (const std::string fileName) const
 dumps the object into a netCDF file More...
 
bool hasNaN () const
 return true if data contains NaN. More...
 
void replaceNaN (DataTypes::real_t value)
 replaces all NaN values with value More...
 
void replaceNaN (DataTypes::cplx_t value)
 replaces all NaN values with value More...
 
- Public Member Functions inherited from escript::DataReady
 DataReady (const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false)
 
 ~DataReady ()
 
DataTypes::real_tgetSampleDataRW (DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
 Return the sample data for the given sample number. More...
 
DataTypes::cplx_tgetSampleDataRW (DataTypes::RealVectorType::size_type sampleNo, DataTypes::cplx_t dummy)
 
const DataTypes::real_tgetSampleDataRO (DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
 
const DataTypes::cplx_tgetSampleDataRO (DataTypes::RealVectorType::size_type sampleNo, DataTypes::cplx_t dummy) const
 
DataTypes::RealVectorType::const_reference getDataAtOffsetRO (DataTypes::RealVectorType::size_type i) const
 get a reference to the beginning of a data point More...
 
DataTypes::RealVectorType::reference getDataAtOffsetRW (DataTypes::RealVectorType::size_type i)
 
DataTypes::CplxVectorType::const_reference getDataAtOffsetROC (DataTypes::CplxVectorType::size_type i) const
 
DataTypes::CplxVectorType::reference getDataAtOffsetRWC (DataTypes::CplxVectorType::size_type i)
 
DataReady_ptr resolve ()
 Return a data object with all points resolved. More...
 
- Public Member Functions inherited from escript::DataAbstract
DataAbstract_ptr getPtr ()
 Return shared pointer managing this object. More...
 
const_DataAbstract_ptr getPtr () const
 
 DataAbstract (const FunctionSpace &what, const ShapeType &shape, bool isDataEmpty=false, bool isCplx=false)
 Constructor for DataAbstract. More...
 
virtual ~DataAbstract ()
 Destructor for DataAbstract. More...
 
int getNumDPPSample () const
 Return the number of data points per sample. More...
 
int getNumSamples () const
 Return the number of samples. More...
 
bool hasNoSamples () const
 
const DataTypes::ShapeTypegetShape () const
 Return the shape information for the point data. More...
 
unsigned int getRank () const
 Return the rank information for the point data. More...
 
virtual DataTypes::real_tgetSampleDataByTag (int tag, DataTypes::real_t dummy=0)
 Return the real sample data for the given tag key. NB: If the data isn't tagged an exception will be thrown. More...
 
virtual DataTypes::cplx_tgetSampleDataByTag (int tag, DataTypes::cplx_t dummy)
 Return the complex sample data for the given tag key. NB: If the data isn't tagged an exception will be thrown. More...
 
virtual size_t getTagCount () const
 Return number of tagged values stored in the data object. More...
 
void operandCheck (const DataAbstract &right) const
 Check this and the given RHS operands are compatible. Throws an exception if they aren't. More...
 
bool validSamplePointNo (int samplePointNo) const
 Return true if a valid sample point number. More...
 
bool validSampleNo (int sampleNo) const
 Return true if a valid sample number. More...
 
const FunctionSpacegetFunctionSpace () const
 Return the function space associated with this Data object. More...
 
virtual void setTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
 setTaggedValue More...
 
virtual void setTaggedValue (int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::CplxVectorType &value, int dataOffset=0)
 
virtual void copyToDataPoint (const int sampleNo, const int dataPointNo, const DataTypes::real_t value)
 Copy a double value to the data point dataPointNo of sample sampleNo in this object. More...
 
virtual void copyToDataPoint (const int sampleNo, const int dataPointNo, const DataTypes::cplx_t value)
 
virtual void copyToDataPoint (const int sampleNo, const int dataPointNo, const WrappedArray &value)
 Copy the array object to the data point dataPointNo of sample sampleNo in this object. More...
 
virtual int getTagNumber (int dpno)
 Return the tag number associated with the given data-point number. More...
 
virtual void symmetric (DataAbstract *ev)
 Computes a symmetric matrix (A + AT) / 2. More...
 
virtual void antisymmetric (DataAbstract *ev)
 Computes a antisymmetric matrix (A - AT) / 2. More...
 
virtual void hermitian (DataAbstract *ev)
 Computes a symmetric matrix (A + A*) / 2. More...
 
virtual void antihermitian (DataAbstract *ev)
 Computes a antisymmetric matrix (A - A*) / 2. More...
 
virtual void trace (DataAbstract *ev, int axis_offset)
 Computes the trace of a matrix. More...
 
virtual void transpose (DataAbstract *ev, int axis_offset)
 Transpose each data point of this Data object around the given axis. More...
 
virtual void swapaxes (DataAbstract *ev, int axis0, int axis1)
 swaps components axis0 and axis1 More...
 
virtual void eigenvalues (DataAbstract *ev)
 solves the eigenvalue problem this*V=ev*V for the eigenvalues ev More...
 
virtual void setToZero ()
 sets values to zero More...
 
virtual void eigenvalues_and_eigenvectors (DataAbstract *ev, DataAbstract *V, const double tol=1.e-13)
 solves the eigenvalue problem this*V=ev*V for the eigenvalues ev and eigenvectors V More...
 
virtual void reorderByReferenceIDs (DataTypes::dim_t *reference_ids)
 reorders data sample ordered by reference_ids to the ordering of the functions space More...
 
unsigned int getNoValues () const
 Return the number of values in the shape for this object. More...
 
bool isLazy () const
 
virtual bool isConstant () const
 
virtual bool isExpanded () const
 
virtual bool actsExpanded () const
 Return true if this Data is expanded or resolves to expanded. That is, if it has a separate value for each datapoint in the sample. More...
 
virtual bool isTagged () const
 
bool isEmpty () const
 
bool isComplex () const
 true if the components of datapoints are complex More...
 
virtual void complicate ()
 

Protected Member Functions

virtual DataTypes::RealVectorTypegetVectorRW ()
 Provide access to underlying storage. Internal use only! More...
 
virtual const DataTypes::RealVectorTypegetVectorRO () const
 
virtual DataTypes::CplxVectorTypegetVectorRWC ()
 
virtual const DataTypes::CplxVectorTypegetVectorROC () const
 
virtual DataTypes::RealVectorTypegetTypedVectorRW (DataTypes::real_t dummy)
 These versions use the type system rather than method name to determine return type. More...
 
virtual const DataTypes::RealVectorTypegetTypedVectorRO (DataTypes::real_t dummy) const
 
virtual DataTypes::CplxVectorTypegetTypedVectorRW (DataTypes::cplx_t dummy)
 
virtual const DataTypes::CplxVectorTypegetTypedVectorRO (DataTypes::cplx_t dummy) const
 

Private Types

typedef DataReady parent
 

Additional Inherited Members

- Public Types inherited from escript::DataAbstract
typedef DataTypes::ShapeType ShapeType
 
- Protected Attributes inherited from escript::DataAbstract
int m_noSamples
 
int m_noDataPointsPerSample
 
bool m_iscompl
 

Detailed Description

Implements the DataAbstract interface for an empty Data object.

Description: Implements the DataAbstract interface for an empty Data object.

Member Typedef Documentation

◆ parent

Constructor & Destructor Documentation

◆ DataEmpty()

escript::DataEmpty::DataEmpty ( )

Default constructor for DataEmpty.

Description: Default constructor for DataEmpty.

Referenced by deepCopy().

◆ ~DataEmpty()

escript::DataEmpty::~DataEmpty ( )
virtual

Destructor for DataEmpty.

Member Function Documentation

◆ deepCopy()

DataAbstract * escript::DataEmpty::deepCopy ( ) const
virtual

Return a deep copy of the current object.

Implements escript::DataAbstract.

References DataEmpty().

◆ dump()

void escript::DataEmpty::dump ( const std::string  fileName) const
virtual

dumps the object into a netCDF file

Reimplemented from escript::DataAbstract.

◆ getLength()

DataTypes::RealVectorType::size_type escript::DataEmpty::getLength ( ) const
virtual

Return the number of doubles stored for the Data object. As this is an empty Data object, this method will always return 0.

Implements escript::DataAbstract.

◆ getPointOffset() [1/2]

DataTypes::RealVectorType::size_type escript::DataEmpty::getPointOffset ( int  sampleNo,
int  dataPointNo 
) const
virtual

Return the offset for the given sample. NB: This will throw an exception as obviously an empty Data object contains no samples. An implementation is required by parent DataAbstract class.

Parameters
sampleNo- Input - Sample number.
dataPointNo- Input - data-point number.

Implements escript::DataAbstract.

◆ getPointOffset() [2/2]

DataTypes::RealVectorType::size_type escript::DataEmpty::getPointOffset ( int  sampleNo,
int  dataPointNo 
)
virtual

◆ getSlice()

DataAbstract * escript::DataEmpty::getSlice ( const DataTypes::RegionType region) const
virtual

Factory method that returns a newly created DataEmpty sliced from the current Data object according to the specified region. NB: This will throw an exception as obviously an empty Data object contains no data to slice from. An implementation is required by parent DataAbstract class.

Implements escript::DataAbstract.

◆ getTypedVectorRO() [1/2]

const DataTypes::RealVectorType & escript::DataEmpty::getTypedVectorRO ( DataTypes::real_t  dummy) const
protectedvirtual

Implements escript::DataReady.

Referenced by replaceNaN().

◆ getTypedVectorRO() [2/2]

const DataTypes::CplxVectorType & escript::DataEmpty::getTypedVectorRO ( DataTypes::cplx_t  dummy) const
protectedvirtual

Implements escript::DataReady.

◆ getTypedVectorRW() [1/2]

DataTypes::RealVectorType & escript::DataEmpty::getTypedVectorRW ( DataTypes::real_t  dummy)
protectedvirtual

These versions use the type system rather than method name to determine return type.

Implements escript::DataReady.

Referenced by replaceNaN().

◆ getTypedVectorRW() [2/2]

DataTypes::CplxVectorType & escript::DataEmpty::getTypedVectorRW ( DataTypes::cplx_t  dummy)
protectedvirtual

Implements escript::DataReady.

◆ getVectorRO()

const DataTypes::RealVectorType & escript::DataEmpty::getVectorRO ( ) const
protectedvirtual

Implements escript::DataReady.

Referenced by replaceNaN().

◆ getVectorROC()

const DataTypes::CplxVectorType & escript::DataEmpty::getVectorROC ( ) const
protectedvirtual

Implements escript::DataReady.

Referenced by replaceNaN().

◆ getVectorRW()

DataTypes::RealVectorType & escript::DataEmpty::getVectorRW ( )
protectedvirtual

Provide access to underlying storage. Internal use only!

Implements escript::DataReady.

Referenced by replaceNaN().

◆ getVectorRWC()

DataTypes::CplxVectorType & escript::DataEmpty::getVectorRWC ( )
protectedvirtual

Implements escript::DataReady.

Referenced by replaceNaN().

◆ hasNaN()

bool escript::DataEmpty::hasNaN ( ) const
inlinevirtual

return true if data contains NaN.

Warning
This is dependent on the ability to reliably detect NaNs on your compiler. See the nancheck function in LocalOps for details.

Implements escript::DataReady.

References ESCRIPT_DLL_API.

◆ matrixInverse()

int escript::DataEmpty::matrixInverse ( DataAbstract out) const
virtual

invert square matricies

Parameters
out- Where to store the results
Returns
errorcode (0 indicates success)

Reimplemented from escript::DataAbstract.

◆ replaceNaN() [1/2]

void escript::DataEmpty::replaceNaN ( DataTypes::real_t  value)
inlinevirtual

replaces all NaN values with value

Implements escript::DataReady.

References ESCRIPT_DLL_API.

◆ replaceNaN() [2/2]

void escript::DataEmpty::replaceNaN ( DataTypes::cplx_t  value)
inlinevirtual

◆ setSlice()

void escript::DataEmpty::setSlice ( const DataAbstract value,
const DataTypes::RegionType region 
)
virtual

Set the current Data object according to the specified slice from the given input value. NB: This will throw an exception as obviously an empty Data object contains no data to slice to. An implementation is required by parent DataAbstract class.

Parameters
valueInput - Data to copy from
regionInput - Region to copy.

Implements escript::DataReady.

◆ toString()

std::string escript::DataEmpty::toString ( ) const
virtual

Return a textual representation of the Data object.

Implements escript::DataAbstract.


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