FEDEM Solver  R8.0
Source code of the dynamics solver
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
FFrVariableReference Class Reference

Class representing a variable reference in a result file hierarchy. More...

#include <FFrVariableReference.H>

Inheritance diagram for FFrVariableReference:
Inheritance graph
[legend]
Collaboration diagram for FFrVariableReference:
Collaboration graph
[legend]

Public Types

using FFrResultContainerRef = std::pair< FFrResultContainer *, size_t >
 Convenience type alias. More...
 

Public Member Functions

 FFrVariableReference (FFrVariable *var)
 The constructor initializes myVariable. More...
 
virtual const std::string & getDescription () const
 Returns the variable name. More...
 
virtual const std::string & getType () const
 Returns the variable type, e.g., SCALAR, VEC3, etc. More...
 
size_t getWordLength () const
 Returns the word length (in bits) of the variable. More...
 
size_t getNumWords () const
 Returns the total number of words in the variable. More...
 
virtual bool isVariableFloat () const
 Returns true if this variable contain float data. More...
 
virtual bool isVarRef () const
 Returns true since this entry is a Variable Reference. More...
 
virtual bool isEmpty () const
 Returns true if this variable has no result data. More...
 
FFaOperationBase * getReadOperation ()
 Creates an operation reading the data of the variable from file. More...
 
unsigned int getTimeStamp () const
 Returns the (most recent) time stamp of this variable. More...
 
double getDistanceFromResultPoint (const bool usePositionedKey=false) const
 Returns the smallest distance to current extraxtor position. More...
 
bool hasDataForCurrentKey (const bool usePositionedKey=false) const
 Checks if this entry has any data at current extractor position. More...
 
void getValidKeys (std::set< double > &validValues) const
 Extracts a list of time steps for which this entry has data. More...
 
virtual void printPosition (std::ostream &os) const
 Prints out the positioning data of this variable. More...
 
virtual void removeContainers (const std::set< FFrResultContainer * > &cont)
 Removes data associated with given containers for this entry. More...
 
virtual int traverse (FFrResultContainer *resultContainer, FFrEntryBase *owner, FFrEntryBase *&objToBeModified, int binPos)
 Traverses to build owner hierarchy and calculate binary sizes. More...
 
virtual bool merge (FFrEntryBase *obj)
 Merges another entry into *this. More...
 
virtual bool equal (const FFrEntryBase *obj) const
 Returns true if *this and *obj are considered equal. More...
 
virtual bool comp (const FFrEntryBase *obj) const
 Returns true if *this equals another specified entry. More...
 
virtual bool less (const FFrEntryBase *obj) const
 Returns true if *this is ordered before *obj. More...
 
template<class T >
bool readVariable (T &value)
 Reads a variable from the results container for current time step. More...
 
template<>
bool readVariable (double &value)
 Specialization for double variables - also accounting for float data. More...
 
template<>
bool readVariable (Vec3Vec &value)
 Specialization for array for FaVec3 objects - reading from a 1D array. More...
 
- Public Member Functions inherited from FFrEntryBase
virtual ~FFrEntryBase ()
 Empty destructor. More...
 
FFaResultDescription getEntryDescription () const
 Returns the full path of this result entry. More...
 
virtual bool hasDescription () const
 Returns whether the entry has a description or not. More...
 
virtual int getBaseID () const
 Returns the base ID of the object if this entry is an Object Group. More...
 
virtual bool hasBaseID () const
 Returns whether this entry has a base ID or not. More...
 
virtual int getUserID () const
 Returns the user ID for this entry. More...
 
virtual bool hasUserID () const
 Returns whether this entry has a user ID or not. More...
 
virtual const FFrEntries * getDataFields () const
 Returns a pointer to the data fields of this entry. More...
 
virtual bool hasDataFields () const
 Returns whether this entry has data fields or not. More...
 
template<class T >
int readPositionedTimestepData (const T *values, int nvals) const
 Reads variable reference data from the hierarhcy under this entry. More...
 
FFrEntryBase * getOwner () const
 Returns the owner of this entry in the hierarchy. More...
 
void setOwner (FFrEntryBase *owner)
 Defines the owner of this entry in the hierarchy. More...
 
virtual void setGlobal ()
 Defines this as a global scope entry. More...
 
bool isGlobal () const
 Check if this entry is in global scope or not. More...
 
virtual bool isOG () const
 Returns whether this entry is an Object Group or not. More...
 
virtual bool isSOG () const
 Returns whether this entry is a Super Object Group or not. More...
 
virtual bool isIG () const
 Returns whether this entry is an Item Group or not. More...
 
template<class T >
bool readVar (T &value)
 Reads a variable from the results container for current time step. More...
 

Public Attributes

std::vector< FFrResultContainerRef > containers
 List of result file containers in which this variable exists. More...
 
FFrVariable * myVariable
 Points to the actual variable with data. More...
 
FFrVariableReference * next
 Used in memory management. More...
 

Protected Member Functions

virtual int readPosData (const double *vals, int nvals, int arrayPos) const
 Reads double data from the hierarhcy under this entry. More...
 
virtual int readPosData (const float *vals, int nvals, int arrayPos) const
 Reads float data from the hierarhcy under this entry. More...
 
virtual int readPosData (const int *vals, int nvals, int arrayPos) const
 Reads integer data from the hierarhcy under this entry. More...
 
- Protected Member Functions inherited from FFrEntryBase
 FFrEntryBase ()
 Default constructor. More...
 
 FFrEntryBase (const FFrEntryBase &obj)
 Copy constructor. More...
 
FFrEntryBase & operator= (const FFrEntryBase &)=delete
 Disable default assignment operator. More...
 

Private Member Functions

int getNearestContainer () const
 Returns the index of the nearest container for the current setting. More...
 

Private Attributes

union {
   FFrVariable *   myVariable
 Points to the actual variable with data. More...
 
   FFrVariableReference *   next
 Used in memory management. More...
 
}; 
 Shared data memory segment for myVariable and next. More...
 

Detailed Description

Class representing a variable reference in a result file hierarchy.

This class does not represent the variable itself, but a reference to one through a pointer. There may be many references pointing to the same physical variable, which are represented by the FFrVariable class.

Member Typedef Documentation

◆ FFrResultContainerRef

Convenience type alias.

Constructor & Destructor Documentation

◆ FFrVariableReference()

FFrVariableReference::FFrVariableReference ( FFrVariable *  var)
inlineexplicit

The constructor initializes myVariable.

Member Function Documentation

◆ comp()

virtual bool FFrVariableReference::comp ( const FFrEntryBase *  ) const
inlinevirtual

Returns true if *this equals another specified entry.

Reimplemented from FFrEntryBase.

◆ equal()

bool FFrVariableReference::equal ( const FFrEntryBase *  obj) const
virtual

Returns true if *this and *obj are considered equal.

Implements FFrEntryBase.

◆ getDescription()

const std::string & FFrVariableReference::getDescription ( ) const
virtual

Returns the variable name.

Implements FFrEntryBase.

◆ getDistanceFromResultPoint()

double FFrVariableReference::getDistanceFromResultPoint ( const bool  usePositionedKey = false) const

Returns the smallest distance to current extraxtor position.

If usePositionedKey is true, the current physical position of the owning extractor object is used, otherwise the requested position is used.

◆ getNearestContainer()

int FFrVariableReference::getNearestContainer ( ) const
private

Returns the index of the nearest container for the current setting.

Returns -1 if no containers are found.

◆ getNumWords()

size_t FFrVariableReference::getNumWords ( ) const

Returns the total number of words in the variable.

◆ getReadOperation()

FFaOperationBase * FFrVariableReference::getReadOperation ( )

Creates an operation reading the data of the variable from file.

Note
This method is defined in FFaReadOpImpl.C

◆ getTimeStamp()

unsigned int FFrVariableReference::getTimeStamp ( ) const

Returns the (most recent) time stamp of this variable.

◆ getType()

const std::string & FFrVariableReference::getType ( ) const
virtual

Returns the variable type, e.g., SCALAR, VEC3, etc.

Implements FFrEntryBase.

◆ getValidKeys()

void FFrVariableReference::getValidKeys ( std::set< double > &  validValues) const

Extracts a list of time steps for which this entry has data.

◆ getWordLength()

size_t FFrVariableReference::getWordLength ( ) const

Returns the word length (in bits) of the variable.

◆ hasDataForCurrentKey()

bool FFrVariableReference::hasDataForCurrentKey ( const bool  usePositionedKey = false) const

Checks if this entry has any data at current extractor position.

If usePositionedKey is true, the current physical position of the owning extractor object is used, otherwise the requested position is used.

◆ isEmpty()

virtual bool FFrVariableReference::isEmpty ( ) const
inlinevirtual

Returns true if this variable has no result data.

Implements FFrEntryBase.

◆ isVariableFloat()

bool FFrVariableReference::isVariableFloat ( ) const
virtual

Returns true if this variable contain float data.

Implements FFrEntryBase.

◆ isVarRef()

virtual bool FFrVariableReference::isVarRef ( ) const
inlinevirtual

Returns true since this entry is a Variable Reference.

Reimplemented from FFrEntryBase.

◆ less()

bool FFrVariableReference::less ( const FFrEntryBase *  obj) const
virtual

Returns true if *this is ordered before *obj.

Implements FFrEntryBase.

◆ merge()

bool FFrVariableReference::merge ( FFrEntryBase *  objToMergeFrom)
virtual

Merges another entry into *this.

Implements FFrEntryBase.

◆ printPosition()

void FFrVariableReference::printPosition ( std::ostream &  os) const
virtual

Prints out the positioning data of this variable.

Implements FFrEntryBase.

◆ readPosData() [1/3]

int FFrVariableReference::readPosData ( const double *  vals,
int  nvals,
int  pos 
) const
protectedvirtual

Reads double data from the hierarhcy under this entry.

Implements FFrEntryBase.

◆ readPosData() [2/3]

int FFrVariableReference::readPosData ( const float *  vals,
int  nvals,
int  pos 
) const
protectedvirtual

Reads float data from the hierarhcy under this entry.

Implements FFrEntryBase.

◆ readPosData() [3/3]

int FFrVariableReference::readPosData ( const int *  vals,
int  nvals,
int  pos 
) const
protectedvirtual

Reads integer data from the hierarhcy under this entry.

Implements FFrEntryBase.

◆ readVariable() [1/3]

template<>
bool FFrVariableReference::readVariable ( double &  value)

Specialization for double variables - also accounting for float data.

◆ readVariable() [2/3]

template<class T >
template bool FFrVariableReference::readVariable< FaMat34 > ( T &  value)

Reads a variable from the results container for current time step.

◆ readVariable() [3/3]

template<>
bool FFrVariableReference::readVariable ( Vec3Vec &  value)

Specialization for array for FaVec3 objects - reading from a 1D array.

◆ removeContainers()

void FFrVariableReference::removeContainers ( const std::set< FFrResultContainer * > &  cont)
virtual

Removes data associated with given containers for this entry.

Implements FFrEntryBase.

◆ traverse()

int FFrVariableReference::traverse ( FFrResultContainer *  ,
FFrEntryBase *  ,
FFrEntryBase *&  ,
int  binPos 
)
virtual

Traverses to build owner hierarchy and calculate binary sizes.

Reimplemented from FFrEntryBase.

Member Data Documentation

◆ 

union { ... }

Shared data memory segment for myVariable and next.

◆ containers

std::vector<FFrResultContainerRef> FFrVariableReference::containers

List of result file containers in which this variable exists.

◆ myVariable

FFrVariable* FFrVariableReference::myVariable

Points to the actual variable with data.

◆ next

FFrVariableReference* FFrVariableReference::next

Used in memory management.


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