IFEM  90A354
Protected Member Functions | Protected Attributes | Private Attributes | List of all members
FieldFuncHDF5 Class Referenceabstract

Base class for spatial functions, defined from a HDF5-file. More...

#include <FieldFunctions.h>

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

Protected Member Functions

 FieldFuncHDF5 ()
 Default constructor.
 
 FieldFuncHDF5 (const std::string &fileName)
 The constructor opens the provided HDF5-file. More...
 
 FieldFuncHDF5 (const FieldFuncHDF5 &)=delete
 No copying of this class.
 
virtual ~FieldFuncHDF5 ()
 The destructor closes the HDF5-file.
 
bool load (const std::vector< std::string > &fieldNames, const std::string &basisName, int level, bool isScalar=false)
 Loads field values for the specified time level. More...
 
int findClosestLevel (double time) const
 Finds the level whose time is closest to the specified time.
 
virtual void addPatchField (ASMbase *pch, const std::vector< Real > &coefs, int nf, int basis)=0
 Adds a patch-wise field with the given coefficient values. More...
 
virtual void clearField ()=0
 Clears the field container.
 
- Protected Member Functions inherited from FieldFuncBase
 FieldFuncBase ()
 Default constructor.
 
 FieldFuncBase (const FieldFuncBase &)=delete
 No copying of this class.
 
virtual ~FieldFuncBase ()
 The destructor deletes the patches.
 
bool setPatch (size_t pIdx)
 Sets the active patch.
 

Protected Attributes

bool hasMultipleLevels
 True if we have multiple time levels.
 
int lastLevel
 The last time level read from.
 
- Protected Attributes inherited from FieldFuncBase
std::vector< ASMbase * > patch
 The patches on which the field is defined.
 
size_t pidx
 Current patch index.
 
size_t npch
 Number of patches in the field.
 

Private Attributes

HDF5Readerhdf5
 The HDF5-file containing the field data.
 
ProcessAdmpAdm
 Process administrator for the HDF5-file reader.
 
double lastTime
 The time of lastLevel.
 

Additional Inherited Members

- Static Public Attributes inherited from FieldFuncBase
static constexpr int FIXED_LEVEL = 1 << 24
 Bit flag in level for using fixed.
 

Detailed Description

Base class for spatial functions, defined from a HDF5-file.

Constructor & Destructor Documentation

◆ FieldFuncHDF5()

FieldFuncHDF5::FieldFuncHDF5 ( const std::string &  fileName)
explicitprotected

The constructor opens the provided HDF5-file.

Parameters
[in]fileNameName of the HDF5-file

References hasMultipleLevels, hdf5, lastLevel, lastTime, and pAdm.

Member Function Documentation

◆ addPatchField()

virtual void FieldFuncHDF5::addPatchField ( ASMbase pch,
const std::vector< Real > &  coefs,
int  nf,
int  basis 
)
protectedpure virtual

Adds a patch-wise field with the given coefficient values.

Parameters
[in]pchThe patch to define the field over
[in]coefsField values
[in]nfNumber of field components
[in]basisBasis to use

Implemented in FieldFuncScalarBase, and FieldsFuncBase.

Referenced by load().

◆ load()

bool FieldFuncHDF5::load ( const std::vector< std::string > &  fieldNames,
const std::string &  basisName,
int  level,
bool  isScalar = false 
)
protected

Loads field values for the specified time level.

Parameters
[in]fieldNamesName of the field components in the HDF5-file
[in]basisNameName of the basis which the field values refer to
[in]levelTime level to read for
[in]isScalarIf true, assume this is a scalar field

References addPatchField(), clearField(), ASM3D::create(), ASM2D::create(), FieldFuncBase::FIXED_LEVEL, HDF5Reader::getFieldSize(), hasMultipleLevels, hdf5, lastLevel, FieldFuncBase::patch, HDF5Reader::readString(), and HDF5Reader::readVector().

Referenced by FieldFunction::evaluate(), FieldFuncScalarBase::FieldFuncScalarBase(), FieldsFuncBase::getGradient(), FieldsFuncBase::getHessian(), FieldsFuncBase::getValues(), FieldFunction::gradient(), and FieldFunction::hessian().


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