Loading...
Searching...
No Matches
Modes< Type, PatchField, GeoMesh > Class Template Reference

Implementation of a container class derived from PtrList. More...

#include <Modes.H>

Inheritance diagram for Modes< Type, PatchField, GeoMesh >:
incrementalPOD< Type, PatchField, GeoMesh >

Public Member Functions

List< Eigen::MatrixXd > toEigen ()
 Method that convert a PtrList of modes into Eigen matrices filling the EigenModes object.
 
PtrList< GeometricField< Type, PatchField, GeoMesh > > & toPtrList ()
 Function that returns the Modes object as a standard PtrList.
 
List< Eigen::MatrixXd > project (fvMatrix< Type > &Af, label numberOfModes=0, word projType="G")
 A function that project an FvMatrix (OpenFoam linear System) on the modes.
 
Eigen::MatrixXd project (GeometricField< Type, PatchField, GeoMesh > &field, label numberOfModes=0, word projType="G", fvMatrix< Type > *Af=NULL)
 A function that project a field on the modes.
 
Eigen::MatrixXd project (PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, label numberOfModes=0, word projType="G", fvMatrix< Type > *Af=NULL)
 A function that project a list of fields on the modes.
 
GeometricField< Type, PatchField, GeoMesh > projectSnapshot (GeometricField< Type, PatchField, GeoMesh > &field, label numberOfModes=0, word projType="G", fvMatrix< Type > *Af=NULL)
 A function that project and reconstruct a snapshot on the modes.
 
GeometricField< Type, PatchField, GeoMesh > reconstruct (GeometricField< Type, PatchField, GeoMesh > &inputField, Eigen::MatrixXd Coeff, word Name)
 Function to reconstruct the solution starting from the coefficients, in this case the field is passed as input/output.
 
PtrList< GeometricField< Type, PatchField, GeoMesh > > reconstruct (GeometricField< Type, PatchField, GeoMesh > &inputField, List< Eigen::MatrixXd > Coeff, word Name)
 Function to reconstruct a list of fields starting from a list of coefficients, in this case the list of fields is filled by reconstructing each field from a coefficients matrix inside the list passed.
 
void projectSnapshots (PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots, PtrList< GeometricField< Type, PatchField, GeoMesh > > &projSnapshots, label numberOfModes=0, word innerProduct="L2")
 Function to project a list of fields into the modes manifold.
 
void projectSnapshots (PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots, PtrList< GeometricField< Type, PatchField, GeoMesh > > &projSnapshots, word innerProduct="L2")
 Function to project a list of fields into the modes manifold by the use of all the modes.
 
void projectSnapshots (PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots, PtrList< GeometricField< Type, PatchField, GeoMesh > > &projSnapshots, PtrList< volScalarField > Volumes, label numberOfModes=0, word innerProduct="L2")
 Function to project a list of fields into the modes manifold.
 
void projectSnapshots (PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots, PtrList< GeometricField< Type, PatchField, GeoMesh > > &projSnapshots, PtrList< volScalarField > Volumes, word innerProduct)
 Function to project a list of fields into the modes manifold by the use of all the modes.
 
void operator= (const PtrList< GeometricField< Type, PatchField, GeoMesh > > &modes)
 

Public Attributes

List< Eigen::MatrixXd > EigenModes
 List of Matrices that contains the internalField and the additional matrices for the boundary patches.
 
label NBC
 Number of patches.
 

Detailed Description

template<class Type, template< class > class PatchField, class GeoMesh>
class Modes< Type, PatchField, GeoMesh >

Implementation of a container class derived from PtrList.

It is meant to store POD modes.

This a child class of the PtrList class, it is meant to store modes and contains some additional operations to project the modes and to reconstruct a solution from the coefficients.

Template Parameters
TType of the Geometric Field used inside the List, it can be vector or scalar

Definition at line 68 of file Modes.H.

Member Function Documentation

◆ operator=()

template<class Type , template< class > class PatchField, class GeoMesh >
void Modes< Type, PatchField, GeoMesh >::operator= ( const PtrList< GeometricField< Type, PatchField, GeoMesh > > & modes)

Definition at line 477 of file Modes.C.

◆ project() [1/3]

template<class Type , template< class > class PatchField, class GeoMesh >
List< Eigen::MatrixXd > Modes< Type, PatchField, GeoMesh >::project ( fvMatrix< Type > & Af,
label numberOfModes = 0,
word projType = "G" )

A function that project an FvMatrix (OpenFoam linear System) on the modes.

Used to project an FvMatrix that is a standard linear system of OpenFoam onto the modes defined inside the Modes container. The output is a list of matrices that contains in the first element the reduced matrix and in the second element the source term.

Parameters
[in]AfThe OpenFOAM fvMatrix linear system, it can be vector or scalar matrix
[in]numberOfModesThe number of modes used to project. If not given it will use all the available ones.
[in]projTypeThe projection type, it can be Galerkin "G" or Petrov-Galerkin "PG"
Returns
A list of Eigen Matrices of dimension 2. The first element of the list is the reduced matrix of the linear system, the second element is the reduced source term of the linear system.

Definition at line 63 of file Modes.C.

◆ project() [2/3]

template<class Type , template< class > class PatchField, class GeoMesh >
Eigen::MatrixXd Modes< Type, PatchField, GeoMesh >::project ( GeometricField< Type, PatchField, GeoMesh > & field,
label numberOfModes = 0,
word projType = "G",
fvMatrix< Type > * Af = NULL )

A function that project a field on the modes.

Used to project a field onto the modes defined inside the Modes container. The output is matrix containing the projected field.

Parameters
[in]fieldThe field to be projected, it can be vector or scalar.
[in]numberOfModesThe number of modes used to project. If not given it will use all the available ones.
[in]projTypeThe projection type, it can be Galerkin "G" or Petrov-Galerkin "PG"
AfThe system matrix used in case of Petrov-Galerkin projection
Returns
An Eigen MatrixXd.

Definition at line 119 of file Modes.C.

◆ project() [3/3]

template<class Type , template< class > class PatchField, class GeoMesh >
Eigen::MatrixXd Modes< Type, PatchField, GeoMesh >::project ( PtrList< GeometricField< Type, PatchField, GeoMesh > > & fields,
label numberOfModes = 0,
word projType = "G",
fvMatrix< Type > * Af = NULL )

A function that project a list of fields on the modes.

Used to project a list of fields onto the modes defined inside the Modes container. The output is a list of matrices containing the projected field.

Parameters
[in]fieldsThe fields list to be projected, it can be vector or scalar.
[in]numberOfModesThe number of modes used to project. If not given it will use all the available ones.
[in]projTypeThe projection type, it can be Galerkin "G", Petrov-Galerkin "PG" or "F" Frobenius
[in]AfThe system matrix used in case of Petrov-Galerkin projection
Returns
An Eigen MatricxXd list.

Definition at line 206 of file Modes.C.

◆ projectSnapshot()

template<class Type , template< class > class PatchField, class GeoMesh >
GeometricField< Type, PatchField, GeoMesh > Modes< Type, PatchField, GeoMesh >::projectSnapshot ( GeometricField< Type, PatchField, GeoMesh > & field,
label numberOfModes = 0,
word projType = "G",
fvMatrix< Type > * Af = NULL )

A function that project and reconstruct a snapshot on the modes.

Parameters
fieldThe field one wants to project
[in]numberOfModesThe number of modes
[in]projTypeThe projection type, it can be Galerkin "G", Petrov-Galerkin "PG" or "F" Frobenius
AfThe system matrix used in case of Petrov-Galerkin projection
Returns
The projected snapshot

Definition at line 195 of file Modes.C.

◆ projectSnapshots() [1/4]

template<class Type , template< class > class PatchField, class GeoMesh >
void Modes< Type, PatchField, GeoMesh >::projectSnapshots ( PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & projSnapshots,
label numberOfModes = 0,
word innerProduct = "L2" )

Function to project a list of fields into the modes manifold.

Parameters
[in]snapshotsThe list of snapshots to be projected
[in]numberOfModesThe number of modes you want to use
[in]innerProductThe inner product to be applied

Definition at line 408 of file Modes.C.

◆ projectSnapshots() [2/4]

template<class Type , template< class > class PatchField, class GeoMesh >
void Modes< Type, PatchField, GeoMesh >::projectSnapshots ( PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & projSnapshots,
PtrList< volScalarField > Volumes,
label numberOfModes = 0,
word innerProduct = "L2" )

Function to project a list of fields into the modes manifold.

Parameters
[in]snapshotsThe list of snapshots to be projected
[in]VolumesThe mesh volumes for the inner product
[in]numberOfModesThe number of modes you want to use
[in]innerProductThe inner product to be applied

Definition at line 331 of file Modes.C.

◆ projectSnapshots() [3/4]

template<class Type , template< class > class PatchField, class GeoMesh >
void Modes< Type, PatchField, GeoMesh >::projectSnapshots ( PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & projSnapshots,
PtrList< volScalarField > Volumes,
word innerProduct )

Function to project a list of fields into the modes manifold by the use of all the modes.

Parameters
[in]snapshotsThe list of snapshots to be projected
[in]VolumesThe mesh volumes for the inner product
[in]innerProductThe inner product to be applied

Definition at line 397 of file Modes.C.

◆ projectSnapshots() [4/4]

template<class Type , template< class > class PatchField, class GeoMesh >
void Modes< Type, PatchField, GeoMesh >::projectSnapshots ( PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshots,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & projSnapshots,
word innerProduct = "L2" )

Function to project a list of fields into the modes manifold by the use of all the modes.

Parameters
[in]snapshotsThe list of snapshots to be projected
[in]innerProductThe inner product to be applied

Definition at line 467 of file Modes.C.

◆ reconstruct() [1/2]

template<class Type , template< class > class PatchField, class GeoMesh >
GeometricField< Type, PatchField, GeoMesh > Modes< Type, PatchField, GeoMesh >::reconstruct ( GeometricField< Type, PatchField, GeoMesh > & inputField,
Eigen::MatrixXd Coeff,
word Name )

Function to reconstruct the solution starting from the coefficients, in this case the field is passed as input/output.

Parameters
[in/out]inputField The input/output field
[in]CoeffThe coefficients of the POD expansion
[in]NameThe name of the field you want to return
Returns
A volVectorField or volScalarField given by the reconstruction.

Definition at line 275 of file Modes.C.

◆ reconstruct() [2/2]

template<class Type , template< class > class PatchField, class GeoMesh >
PtrList< GeometricField< Type, PatchField, GeoMesh > > Modes< Type, PatchField, GeoMesh >::reconstruct ( GeometricField< Type, PatchField, GeoMesh > & inputField,
List< Eigen::MatrixXd > Coeff,
word Name )

Function to reconstruct a list of fields starting from a list of coefficients, in this case the list of fields is filled by reconstructing each field from a coefficients matrix inside the list passed.

Parameters
inputFieldThe input field
[in]CoeffThe list of coefficients of the POD expansion
[in]NameThe name
Returns
A list of volVectorFields or volScalarFields given by the reconstruction.

Definition at line 312 of file Modes.C.

◆ toEigen()

template<class Type , template< class > class PatchField, class GeoMesh >
List< Eigen::MatrixXd > Modes< Type, PatchField, GeoMesh >::toEigen ( )

Method that convert a PtrList of modes into Eigen matrices filling the EigenModes object.

Definition at line 38 of file Modes.C.

◆ toPtrList()

template<class Type , template< class > class PatchField, class GeoMesh >
PtrList< GeometricField< Type, PatchField, GeoMesh > > & Modes< Type, PatchField, GeoMesh >::toPtrList ( )
inline

Function that returns the Modes object as a standard PtrList.

Returns
The PtrList containing the modes

Definition at line 86 of file Modes.H.

Member Data Documentation

◆ EigenModes

template<class Type , template< class > class PatchField, class GeoMesh >
List<Eigen::MatrixXd> Modes< Type, PatchField, GeoMesh >::EigenModes

List of Matrices that contains the internalField and the additional matrices for the boundary patches.

Definition at line 73 of file Modes.H.

◆ NBC

template<class Type , template< class > class PatchField, class GeoMesh >
label Modes< Type, PatchField, GeoMesh >::NBC

Number of patches.

Definition at line 76 of file Modes.H.


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