Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
bitpit::POD Class Reference

The POD (Proper Orthogonal Decomposition) class provides an interface for defining POD object. More...

Inheritance diagram for bitpit::POD:
Inheritance graph
[legend]
Collaboration diagram for bitpit::POD:
Collaboration graph
[legend]

Public Types

enum class  ErrorMode { COMBINED , SINGLE , NONE }
 Mode of Error evaluation of a reconstructed fields by the POD basis. More...
 
enum class  MemoryMode { MEMORY_NORMAL , MEMORY_LIGHT }
 Memory Mode of the POD object. It defines the use of the memory resources. More...
 
enum class  MeshType { UNDEFINED , VOLOCTREE }
 Type of the Mesh used to compute the POD basis. More...
 
enum class  ReconstructionMode { PROJECTION , MINIMIZATION }
 Mode of Reconstruction of fields by using the POD basis. More...
 
enum class  RunMode { RESTORE , COMPUTE }
 Run Mode of the POD object. It defines if the POD basis has to be computed or restored. More...
 
enum class  WriteMode { DUMP , DEBUG , NONE }
 Output Write Mode of the POD object. It defines the amount of information written by the POD object. More...
 

Public Member Functions

 POD (MPI_Comm comm=MPI_COMM_WORLD)
 
 POD (POD &&other)=default
 
 ~POD ()
 
void adaptionAlter (const std::vector< adaption::Info > &info)
 
void adaptionCleanUp (const std::vector< adaption::Info > &info)
 
void adaptionPrepare (const std::vector< adaption::Info > &info)
 
void addReconstructionSnapshot (const pod::SnapshotFile &file)
 
void addReconstructionSnapshot (const std::string &directory, const std::string &name)
 
void addSnapshot (const pod::SnapshotFile &file)
 
void addSnapshot (const std::string &directory, const std::string &name)
 
void clear ()
 
void computeMapper (const VolumeKernel *mesh)
 
void dump ()
 
void dumpDecomposition ()
 
void dumpField (const std::string &name, const pod::PODField &field) const
 
void evalCorrelation ()
 
void evalDecomposition ()
 
void evalEigen ()
 
void evalErrorBoundingBox ()
 
void evalMeanMesh ()
 
void evalModes ()
 
void evalReconstruction ()
 
std::vector< double > fieldsl2norm (pod::PODField &snap)
 
std::vector< double > fieldsMax (pod::PODField &snap)
 
void fillListActiveIDs (const PiercedStorage< bool > &bfield)
 
const std::string & getDirectory ()
 
double getEnergyLevel ()
 
ErrorMode getErrorMode ()
 
double getErrorThreshold ()
 
std::vector< std::string > getFieldsNames ()
 
std::unique_ptr< PODKernel > & getKernel ()
 
const std::unordered_set< long int > & getListActiveIDs ()
 
std::size_t getListIDInternalCount ()
 
const pod::PODModegetMean ()
 
MemoryMode getMemoryMode ()
 
const VolumeKernelgetMesh ()
 
MeshType getMeshType ()
 
std::size_t getModeCount ()
 
const std::vector< pod::PODMode > & getModes ()
 
const std::string & getName ()
 
std::vector< std::vector< double > > getReconstructionCoeffs ()
 
ReconstructionMode getReconstructionMode ()
 
RunMode getRunMode ()
 
std::vector< std::string > getScalarNames ()
 
std::size_t getSnapshotCount ()
 
std::vector< std::array< std::string, 3 > > getVectorNames ()
 
WriteMode getWriteMode ()
 
void leave1out ()
 
std::vector< std::vector< double > > projectField (pod::PODField &field)
 
void readSnapshot (const pod::SnapshotFile &snap, pod::PODField &fieldr)
 
void reconstructFields (const std::vector< std::vector< double > > &coeffMatrix, pod::PODField &recon)
 
void reconstructFields (PiercedStorage< double > &fields, VolumeKernel *mesh, std::map< std::string, std::size_t > targetFields, const std::unordered_set< long > *targetCells)
 
void reconstructFields (pod::PODField &field, pod::PODField &recon)
 
void removeLeave1outSnapshot (const pod::SnapshotFile &file)
 
void removeLeave1outSnapshot (const std::string &directory, const std::string &name)
 
void restore ()
 
void restoreDecomposition ()
 
void run ()
 
void setDirectory (const std::string &directory)
 
void setEnergyLevel (double energy)
 
void setErrorMode (ErrorMode mode)
 
void setErrorThreshold (double threshold)
 
void setExpert (bool mode=true)
 
void setMemoryMode (MemoryMode mode)
 
void setMesh (const pod::SnapshotFile &file)
 
void setMesh (const std::string &directory, const std::string &name)
 
void setMesh (std::unique_ptr< VolumeKernel > &&mesh)
 
void setMeshType (MeshType type)
 
void setModeCount (std::size_t nmodes)
 
void setName (const std::string &name)
 
void setReconstructionMode (ReconstructionMode mode)
 
void setRunMode (RunMode mode)
 
void setSensorMask (const PiercedStorage< bool > &mask, VolumeKernel *mesh=nullptr)
 
void setSnapshots (const std::vector< pod::SnapshotFile > &database)
 
void setStaticMesh (bool flag)
 
void setTargetErrorFields (std::vector< std::string > &namesf, std::vector< std::array< std::string, 3 > > &namevf)
 
void setUseMean (bool flag)
 
void setWriteMode (WriteMode mode)
 
void unsetLeave1outSnapshots ()
 
void write (const pod::PODField &snap, std::string file_name) const
 
void write (int mode_index, std::string file_name)
 
- Public Member Functions inherited from bitpit::VTKBaseStreamer
virtual void absorbData (std::fstream &, const std::string &, VTKFormat, uint64_t, uint8_t, VTKDataType)
 
virtual void flushData (std::fstream &, const std::string &, VTKFormat)
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T &value) const
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T *values, int nValues) const
 

Detailed Description

The POD (Proper Orthogonal Decomposition) class provides an interface for defining POD object.

POD is the base class for defining POD object.
This class provides the interface methods, as the base get/set methods.
To execute a pod work-flow of a POD object call the method run().

Note: in this version the only allowed mesh type is VolOctree. All the database fields and the reconstructed ones have to be defined on the same domain.

Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 41 of file pod.hpp.

Member Enumeration Documentation

◆ ErrorMode

enum class bitpit::POD::ErrorMode
strong

Mode of Error evaluation of a reconstructed fields by the POD basis.

Enumerator
COMBINED 

Maximum of reconstruction errors.

SINGLE 

Reconstruction errors one at a time.

NONE 

No error evaluation.

Definition at line 86 of file pod.hpp.

◆ MemoryMode

enum class bitpit::POD::MemoryMode
strong

Memory Mode of the POD object. It defines the use of the memory resources.

Enumerator
MEMORY_NORMAL 

Normal use of the memory. The POD modes are stored in memory till the POD object is destroyed.

MEMORY_LIGHT 

Light use of memory. The POD modes are not stored but they are read from file when needed.

Definition at line 49 of file pod.hpp.

◆ MeshType

enum class bitpit::POD::MeshType
strong

Type of the Mesh used to compute the POD basis.

Enumerator
UNDEFINED 

Undefined mesh type. Note: not allowed to run POD computing.

VOLOCTREE 

VolOctree mesh type.

Definition at line 96 of file pod.hpp.

◆ ReconstructionMode

Mode of Reconstruction of fields by using the POD basis.

Enumerator
PROJECTION 

Orthogonal projection of a field over the POD basis. Note: if the POD modes are not orthogonal on the active domain this is an approximation.

MINIMIZATION 

Non-orthogonal projection of a field over the POD basis.Note: if the POD modes are orthogonal on the active domain the result obtained by using PROJECTION is the same.

Definition at line 77 of file pod.hpp.

◆ RunMode

enum class bitpit::POD::RunMode
strong

Run Mode of the POD object. It defines if the POD basis has to be computed or restored.

Enumerator
RESTORE 

Restore the POD basis from dumped file.

COMPUTE 

Compute the POD basis.

Definition at line 58 of file pod.hpp.

◆ WriteMode

enum class bitpit::POD::WriteMode
strong

Output Write Mode of the POD object. It defines the amount of information written by the POD object.

Enumerator
DUMP 

Write (dump) only the files needed to restore the POD instance.

DEBUG 

Write files to debug the run (POD dumping files, POD basis in .vtu format, database fields in .vtu format, reconstrucetd fields in .vtu format...) .

NONE 

Write none.

Definition at line 67 of file pod.hpp.

Constructor & Destructor Documentation

◆ POD() [1/2]

bitpit::POD::POD ( MPI_Comm comm = MPI_COMM_WORLD)

Creates a new POD object.

Parameters
[in]commThe MPI communicator used by the pod object. MPI_COMM_WORLD is the default value.

Definition at line 67 of file pod.cpp.

◆ ~POD()

bitpit::POD::~POD ( )

Destructor of POD

Definition at line 117 of file pod.cpp.

◆ POD() [2/2]

bitpit::POD::POD ( POD && other)
default

Default copy constructor.

Parameters
[in]otherInput POD object

Member Function Documentation

◆ adaptionAlter()

void bitpit::POD::adaptionAlter ( const std::vector< adaption::Info > & info)

Update the mapping pre-computed of an input mesh to the POD mesh by the info given after an adaptation of the input mesh. Can be called only if expert mode is active.

Parameters
[in]infoInfo vector result of adaptation of the input mesh

Definition at line 2952 of file pod.cpp.

◆ adaptionCleanUp()

void bitpit::POD::adaptionCleanUp ( const std::vector< adaption::Info > & info)

Clean up the pre-computed internal structures of mapping.

Parameters
[in]infoInfo vector result of adaptation prepare of the input mesh

Definition at line 2993 of file pod.cpp.

◆ adaptionPrepare()

void bitpit::POD::adaptionPrepare ( const std::vector< adaption::Info > & info)

Prepare the pre-computed mapping of an input mesh to the POD mesh by the info given before an adaptation of the input mesh (internal method).

Parameters
[in]infoInfo vector result of adaptation prepare of the input mesh

Definition at line 2974 of file pod.cpp.

◆ addReconstructionSnapshot() [1/2]

void bitpit::POD::addReconstructionSnapshot ( const pod::SnapshotFile & file)

Add a snapshot to the reconstruction database.

Parameters
[in]fileis the file name (complete path) of the snapshot.

Definition at line 293 of file pod.cpp.

◆ addReconstructionSnapshot() [2/2]

void bitpit::POD::addReconstructionSnapshot ( const std::string & directory,
const std::string & name )

Add a snapshot to the reconstruction database.

Parameters
[in]directoryis the directory that contains the snapshot.
[in]nameis the name of the snapshot.
Examples
POD_application_example_00001.cpp, and POD_example_00001.cpp.

Definition at line 282 of file pod.cpp.

◆ addSnapshot() [1/2]

void bitpit::POD::addSnapshot ( const pod::SnapshotFile & file)

Add a snapshot to the POD database.

Parameters
[in]fileis the file name (complete path) of the snapshot.

Definition at line 219 of file pod.cpp.

◆ addSnapshot() [2/2]

void bitpit::POD::addSnapshot ( const std::string & directory,
const std::string & name )

Add a snapshot to the POD database.

Parameters
[in]directoryis the directory that contains the snapshot.
[in]nameis the name of the snapshot.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 208 of file pod.cpp.

◆ clear()

void bitpit::POD::clear ( )

Cleaning POD

Definition at line 125 of file pod.cpp.

◆ computeMapper()

void bitpit::POD::computeMapper ( const VolumeKernel * mesh)

Compute the mapping of an input mesh to the POD mesh. Can be called only if expert mode is active.

Parameters
[in]meshPointer to input mesh

Definition at line 2939 of file pod.cpp.

◆ dump()

void bitpit::POD::dump ( )

Write the POD results by dumping.

Definition at line 855 of file pod.cpp.

◆ dumpDecomposition()

void bitpit::POD::dumpDecomposition ( )

Dump decomposition..

Definition at line 904 of file pod.cpp.

◆ dumpField()

void bitpit::POD::dumpField ( const std::string & name,
const pod::PODField & field ) const

Write snapshots by dumping.

Parameters
[in]nameFilename.
[in]fieldSnapshot field.

Definition at line 2433 of file pod.cpp.

◆ evalCorrelation()

void bitpit::POD::evalCorrelation ( )

Evaluation of correlation matrix.

Definition at line 1345 of file pod.cpp.

◆ evalDecomposition()

void bitpit::POD::evalDecomposition ( )

Evaluate POD decomposition over a set of given snapshots.

Examples
POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 873 of file pod.cpp.

◆ evalEigen()

void bitpit::POD::evalEigen ( )

Evaluation of eigenvalues and eigenvectors of the correlation matrix.

Definition at line 1973 of file pod.cpp.

◆ evalErrorBoundingBox()

void bitpit::POD::evalErrorBoundingBox ( )

Evaluation of error bounding box according to a certain threshold.

Examples
POD_application_example_00001.cpp, and POD_example_00003.cpp.

Definition at line 1503 of file pod.cpp.

◆ evalMeanMesh()

void bitpit::POD::evalMeanMesh ( )

Evaluation of the mean field and the POD mesh, as the more refined envelope of the fluid domain between all the meshes related to the database snapshots. Currently implemented for static mesh only.

Definition at line 1200 of file pod.cpp.

◆ evalModes()

void bitpit::POD::evalModes ( )

Evaluation of POD modes.

Definition at line 2084 of file pod.cpp.

◆ evalReconstruction()

void bitpit::POD::evalReconstruction ( )

Evaluation of snapshots reconstruction. Use the reconstruction database to read the snapshots to be reconstructed.

Definition at line 1449 of file pod.cpp.

◆ fieldsl2norm()

std::vector< double > bitpit::POD::fieldsl2norm ( pod::PODField & snap)

Evaluate the l2-norm of a POD field.

Parameters
[in]snapField as POD object.
Returns
The vector of the l2-norms.
Examples
POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 2577 of file pod.cpp.

◆ fieldsMax()

std::vector< double > bitpit::POD::fieldsMax ( pod::PODField & snap)

Evaluate the maximum value of a POD field.

Parameters
[in]snapField as POD object.
Returns
The vector of the maxima.
Examples
POD_example_00005.cpp.

Definition at line 2618 of file pod.cpp.

◆ fillListActiveIDs()

void bitpit::POD::fillListActiveIDs ( const PiercedStorage< bool > & mask)

Fill list of active ID. Use boolean field passed as constant reference. Fill with internal and ghosts cells.

Parameters
[in]maskis the Reference to the boolean field used as filter/mask to chose the active cells.

Definition at line 1316 of file pod.cpp.

◆ getDirectory()

const std::string & bitpit::POD::getDirectory ( )

Get the directory to write/read POD results.

Returns
The name of the input/output object.

Definition at line 197 of file pod.cpp.

◆ getEnergyLevel()

double bitpit::POD::getEnergyLevel ( )

Get the percentage energy level of retained POD modes.

Returns
The energy level.
Examples
POD_application_example_00001.cpp.

Definition at line 336 of file pod.cpp.

◆ getErrorMode()

POD::ErrorMode bitpit::POD::getErrorMode ( )

Get the error mode of the POD object.

Returns
The error mode.
Examples
POD_application_example_00001.cpp.

Definition at line 648 of file pod.cpp.

◆ getErrorThreshold()

double bitpit::POD::getErrorThreshold ( )

Get the error threshold used in the subregion evaluation.

Returns
The threshold value.
Examples
POD_application_example_00001.cpp.

Definition at line 356 of file pod.cpp.

◆ getFieldsNames()

std::vector< std::string > bitpit::POD::getFieldsNames ( )

Get the names of the fields involved in the POD in one list (scalar fields and components of vector fields).

Returns
The names of fields.

Definition at line 749 of file pod.cpp.

◆ getKernel()

std::unique_ptr< PODKernel > & bitpit::POD::getKernel ( )

Get the reference to the POD kernel.

Definition at line 824 of file pod.cpp.

◆ getListActiveIDs()

const std::unordered_set< long > & bitpit::POD::getListActiveIDs ( )

Get the IDs of active cells.

Examples
POD_example_00005.cpp.

Definition at line 808 of file pod.cpp.

◆ getListIDInternalCount()

std::size_t bitpit::POD::getListIDInternalCount ( )

Get the number of internal cells in the list of IDs of active cells.

Definition at line 816 of file pod.cpp.

◆ getMean()

const pod::PODMode & bitpit::POD::getMean ( )

Get a reference to the POD mean field.

Returns
The const reference to the POD mean field.

Definition at line 780 of file pod.cpp.

◆ getMemoryMode()

POD::MemoryMode bitpit::POD::getMemoryMode ( )

Get the memory mode of the POD object.

Examples
POD_application_example_00001.cpp.

Definition at line 530 of file pod.cpp.

◆ getMesh()

const VolumeKernel * bitpit::POD::getMesh ( )

Get a pointer to the POD mesh.

Returns
The const pointer to the POD mesh.

Definition at line 767 of file pod.cpp.

◆ getMeshType()

POD::MeshType bitpit::POD::getMeshType ( )

Get the type of the POD mesh.

Returns
Type of the POD mesh.

Definition at line 470 of file pod.cpp.

◆ getModeCount()

std::size_t bitpit::POD::getModeCount ( )

Get the number of POD modes.

Returns
The number of POD modes.
Examples
POD_application_example_00001.cpp, POD_example_00002.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 315 of file pod.cpp.

◆ getModes()

const std::vector< pod::PODMode > & bitpit::POD::getModes ( )

Get a reference to the POD modes.

Returns
The const reference to the POD modes.
Examples
POD_example_00005.cpp.

Definition at line 790 of file pod.cpp.

◆ getName()

const std::string & bitpit::POD::getName ( )

Get the name of the pod object.

Returns
The name of the POD object.
Examples
POD_application_example_00001.cpp.

Definition at line 170 of file pod.cpp.

◆ getReconstructionCoeffs()

std::vector< std::vector< double > > bitpit::POD::getReconstructionCoeffs ( )

Get the POD coefficients of the last reconstructed field.

Returns
The POD modal coefficients of the last reconstructed field.
Examples
POD_example_00002.cpp.

Definition at line 800 of file pod.cpp.

◆ getReconstructionMode()

POD::ReconstructionMode bitpit::POD::getReconstructionMode ( )

Get the reconstruction mode of the POD object.

Returns
The reconstruction mode.
Examples
POD_application_example_00001.cpp.

Definition at line 623 of file pod.cpp.

◆ getRunMode()

POD::RunMode bitpit::POD::getRunMode ( )

Get the execution mode of the POD object.

Examples
POD_application_example_00001.cpp.

Definition at line 566 of file pod.cpp.

◆ getScalarNames()

std::vector< std::string > bitpit::POD::getScalarNames ( )

Get the names of the scalar fields involved in the POD.

Returns
The names of scalar fields.
Examples
POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 728 of file pod.cpp.

◆ getSnapshotCount()

std::size_t bitpit::POD::getSnapshotCount ( )

Get the number of snapshots in the database.

Returns
The number of snapshots.

Definition at line 718 of file pod.cpp.

◆ getVectorNames()

std::vector< std::array< std::string, 3 > > bitpit::POD::getVectorNames ( )

Get the names of the vector fields (three components) involved in the POD.

Returns
The names of vector fields.
Examples
POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 738 of file pod.cpp.

◆ getWriteMode()

POD::WriteMode bitpit::POD::getWriteMode ( )

Get the write mode of the POD object.

Examples
POD_application_example_00001.cpp.

Definition at line 587 of file pod.cpp.

◆ leave1out()

void bitpit::POD::leave1out ( )

Execution of leave-one-out procedure.

Examples
POD_application_example_00001.cpp, and POD_example_00003.cpp.

Definition at line 1121 of file pod.cpp.

◆ projectField()

std::vector< std::vector< double > > bitpit::POD::projectField ( pod::PODField & field)

Perform L2 projection of a filed over the POD space generated by the POD modes.

Parameters
[in/out]POD Field object.
[out]matrixof size N_fields x N_modes with the coefficients of the L2 projection.
Examples
POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 1764 of file pod.cpp.

◆ readSnapshot()

void bitpit::POD::readSnapshot ( const pod::SnapshotFile & snap,
pod::PODField & fieldr )

Read a snapshot from file defined on a given mesh.

Parameters
[in]snapSnapshot filename
[out]fieldrResulting POD field
Examples
POD_example_00005.cpp.

Definition at line 2150 of file pod.cpp.

◆ reconstructFields() [1/3]

void bitpit::POD::reconstructFields ( const std::vector< std::vector< double > > & reconstructionCoeffs,
pod::PODField & reconi )

Field reconstruction.

Parameters
[in]fieldOriginal field (Note: it has to be defined on POD mesh).
[out]reconiReconstructed field.

Definition at line 1652 of file pod.cpp.

◆ reconstructFields() [2/3]

void bitpit::POD::reconstructFields ( PiercedStorage< double > & fields,
VolumeKernel * mesh,
std::map< std::string, std::size_t > targetFields,
const std::unordered_set< long > * targetCells )

Field reconstruction.

Parameters
[in,out]fieldsOriginal field used in the reconstruction. Only the values of targetCells are updated.
[in]meshPointer to snapshot field
[in]targetFieldsMap of names/ids of fields in PiercedStorage to reconstruct
[in]targetCellsPointer to list of cell to be updated with the reconstructed values (optional, default whole field).

Definition at line 1667 of file pod.cpp.

◆ reconstructFields() [3/3]

void bitpit::POD::reconstructFields ( pod::PODField & field,
pod::PODField & reconi )

Field reconstruction.

Parameters
[in]fieldOriginal field (Note: it has to be defined on POD mesh).
[out]reconiReconstructed field.
Examples
POD_example_00002.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 1631 of file pod.cpp.

◆ removeLeave1outSnapshot() [1/2]

void bitpit::POD::removeLeave1outSnapshot ( const pod::SnapshotFile & file)

Remove a snapshot from the leave-1-out error computation.

Parameters
[in]fileis the file name (complete path) of the snapshot.

Definition at line 254 of file pod.cpp.

◆ removeLeave1outSnapshot() [2/2]

void bitpit::POD::removeLeave1outSnapshot ( const std::string & directory,
const std::string & name )

Remove a snapshot from the leave-1-out error computation.

Parameters
[in]directoryis the directory that contains the snapshot.
[in]nameis the name of the snapshot.
Examples
POD_application_example_00001.cpp, and POD_example_00003.cpp.

Definition at line 243 of file pod.cpp.

◆ restore()

void bitpit::POD::restore ( )

Restore the POD results.

Examples
POD_example_00002.cpp, and POD_example_00005.cpp.

Definition at line 864 of file pod.cpp.

◆ restoreDecomposition()

void bitpit::POD::restoreDecomposition ( )

Restore the decomposition.

Definition at line 1051 of file pod.cpp.

◆ run()

void bitpit::POD::run ( )

Execution of POD procedure. Currently it computes the complete POD for static mesh: mean field of the snapshots, correlation matrix, POD modes and reconstruction of database fields with the retained modes. Some reconstruction errors are evaluated (not yet).

Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, and POD_example_00002.cpp.

Definition at line 836 of file pod.cpp.

◆ setDirectory()

void bitpit::POD::setDirectory ( const std::string & directory)

Set the input/output directory.

Parameters
[in]directoryis the name of the directory.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 180 of file pod.cpp.

◆ setEnergyLevel()

void bitpit::POD::setEnergyLevel ( double energy)

Set the energy percentage level (e%) used to retain a limited number of POD modes during POD evaluation. m_nModes such that sum(lambda[1:m_nModes])/etot >= e% and sum(lambda[1:m_nModes-1])/etot < e%.

Parameters
[in]energyis the target energy percentage level.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 326 of file pod.cpp.

◆ setErrorMode()

void bitpit::POD::setErrorMode ( POD::ErrorMode mode)

Set the error evaluation mode of the POD object.

Parameters
[in]modeis the error mode. If set to COMBINED evaluates the maximum reconstruction errors, if set to SINGLE evaluates the reconstruction errors one at a time, if set to NONE does nothing.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 635 of file pod.cpp.

◆ setErrorThreshold()

void bitpit::POD::setErrorThreshold ( double threshold)

Set the minimum error threshold used to identify a subregion of the original computational domain.

Parameters
[in]thresholdis the threshold value for the minimum error.
Examples
POD_application_example_00001.cpp, and POD_example_00003.cpp.

Definition at line 346 of file pod.cpp.

◆ setExpert()

void bitpit::POD::setExpert ( bool mode = true)

Set expert mode for the POD object.

Parameters
[in]modeExpert mode active flag. If expert mode is active same features have to be manually controlled:
  • a pre-computed mapping between a mesh field and the POD mesh is not automatically re-computed when reconstructed (use computeMapper method)

Definition at line 660 of file pod.cpp.

◆ setMemoryMode()

void bitpit::POD::setMemoryMode ( POD::MemoryMode mode)

Set the memory mode of the POD object.

Parameters
[in]modeMemory mode. If set to MEMORY_LIGHT the POD modes if present are erased and then they are read from file if needed. If set to MEMORY_NORMAL, the POD modes are kept in memory when computed or read for the first time.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 505 of file pod.cpp.

◆ setMesh() [1/3]

void bitpit::POD::setMesh ( const pod::SnapshotFile & file)

Set the POD mesh by reading it from file, where the fields and modes are defined. The POD mesh is not computed during POD run. The file has to be a snapshot file format (data file + mesh file).

Parameters
[in]fileis the file name of the snapshot (complete path directory+name).

Definition at line 456 of file pod.cpp.

◆ setMesh() [2/3]

void bitpit::POD::setMesh ( const std::string & directory,
const std::string & name )

Set the POD mesh by reading it from file, where the fields and modes are defined. The POD mesh is not computed during POD run. The file has to be a snapshot file format (data file + mesh file).

Parameters
[in]directoryis the directory that contains the snapshot.
[in]nameis the name of the snapshot.
Examples
POD_application_example_00001.cpp.

Definition at line 443 of file pod.cpp.

◆ setMesh() [3/3]

void bitpit::POD::setMesh ( std::unique_ptr< VolumeKernel > && mesh)

Set the POD mesh, where the fields and modes are defined. The POD mesh is not computed during POD run.

Parameters
[in]meshPointer to POD mesh.

Definition at line 419 of file pod.cpp.

◆ setMeshType()

void bitpit::POD::setMeshType ( POD::MeshType type)

Set the type of the POD mesh, where the fields and modes are defined. Note: even if the mesh is directly set by setMesh methods, the type MUST be set before call setMesh.

Parameters
[in]typeType of the POD mesh.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 390 of file pod.cpp.

◆ setModeCount()

void bitpit::POD::setModeCount ( std::size_t nmodes)

Set the number of retained POD modes during POD evaluation.

Parameters
[in]nmodesNumber of retained modes.
Examples
POD_application_example_00001.cpp, and POD_example_00002.cpp.

Definition at line 304 of file pod.cpp.

◆ setName()

void bitpit::POD::setName ( const std::string & name)

Set the name of the pod object.

Parameters
[in]nameis the name that will be set.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 160 of file pod.cpp.

◆ setReconstructionMode()

void bitpit::POD::setReconstructionMode ( POD::ReconstructionMode mode)

Set the reconstruction mode of the POD object.

Parameters
[in]modeis the reconstruction mode. If set to MINIMIZATION solve the least-squares problem, if set to PROJECTION uses orthogonal projection.
Examples
POD_application_example_00001.cpp.

Definition at line 598 of file pod.cpp.

◆ setRunMode()

void bitpit::POD::setRunMode ( POD::RunMode mode)

Set the run mode of the POD object.

Parameters
[in]modeis the run mode. If set to COMPUTE POD modes, mean field and POD mesh are computed during execute command, if set to RESTORE they are restored from file.
Examples
POD_application_example_00001.cpp.

Definition at line 542 of file pod.cpp.

◆ setSensorMask()

void bitpit::POD::setSensorMask ( const PiercedStorage< bool > & mask,
VolumeKernel * mesh = nullptr )

Set the boolean field used as mask for the POD reconstruction.

Parameters
[in]maskReference to boolean field used as mask to chose the active cells.
[in]meshPointer to mesh related to input mask (used only if dynamic mesh active). If set to true, the corresponding cell is used during the minimization [or projection], otherwise it is discarded.
Examples
POD_example_00002.cpp.

Definition at line 672 of file pod.cpp.

◆ setSnapshots()

void bitpit::POD::setSnapshots ( const std::vector< pod::SnapshotFile > & database)

Set the snapshots of the POD database.

Parameters
[in]databaseVector of snapshot file names.

Definition at line 230 of file pod.cpp.

◆ setStaticMesh()

void bitpit::POD::setStaticMesh ( bool flag)

Set if the mesh, where the fields are defined, is a static mesh, fixed for the whole database, or it is an AMR mesh, i.e. differently adapted for each field in the database or during reconstruction.

Parameters
[in]flagif set to true the mesh is considered static.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 483 of file pod.cpp.

◆ setTargetErrorFields()

void bitpit::POD::setTargetErrorFields ( std::vector< std::string > & namesf,
std::vector< std::array< std::string, 3 > > & namevf )

Set the target error fields used in the error bounding box evaluation.

Parameters
[in]namesfis the vector of scalar fields names.
[in]namevfis the vector of vector fields names, arranged in vector components.
Examples
POD_application_example_00001.cpp, and POD_example_00003.cpp.

Definition at line 367 of file pod.cpp.

◆ setUseMean()

void bitpit::POD::setUseMean ( bool flag)

Set if the mean fields are used during the POD basis calculation or not.

Parameters
[in]flagif set to true the mean is used.
Examples
POD_application_example_00001.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 493 of file pod.cpp.

◆ setWriteMode()

void bitpit::POD::setWriteMode ( POD::WriteMode mode)

Set the write mode of the POD object.

Parameters
[in]modeis the write mode.
Examples
POD_application_example_00001.cpp, POD_example_00001.cpp, POD_example_00002.cpp, POD_example_00003.cpp, POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 576 of file pod.cpp.

◆ unsetLeave1outSnapshots()

void bitpit::POD::unsetLeave1outSnapshots ( )

Unset the snapshots of the leave-1-out.

Definition at line 262 of file pod.cpp.

◆ write() [1/2]

void bitpit::POD::write ( const pod::PODField & field,
std::string file_name ) const

Write a POD Field as VTK files.

Parameters
[in]field,PODFieldobject.
[in]file_name,stringwith the desired file name for the VTK file.
Examples
POD_example_00004.cpp, and POD_example_00005.cpp.

Definition at line 3080 of file pod.cpp.

◆ write() [2/2]

void bitpit::POD::write ( int mode_index,
std::string file_name )

Write a POD Mode as VTK files.

Parameters
[in]int,modeindex.
[in]file_name,stringwith the desired file name for the VTK file.

Definition at line 3154 of file pod.cpp.


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