Loading...
Searching...
No Matches
ITHACAutilities Namespace Reference

Namespace to implement some useful assign operation of OF fields. More...

Functions

template<typename Type>
void assignIF (GeometricField< Type, fvPatchField, volMesh > &field, Type value)
 Assign internal field.
template void assignIF (GeometricField< scalar, fvPatchField, volMesh > &field, scalar value)
template void assignIF (GeometricField< vector, fvPatchField, volMesh > &field, vector value)
template<typename Type>
void assignIF (GeometricField< Type, fvPatchField, volMesh > &field, Type &value, List< label > &indices)
 Assign internal field.
template void assignIF (GeometricField< scalar, fvPatchField, volMesh > &s, scalar &value, List< label > &indices)
template void assignIF (GeometricField< vector, fvPatchField, volMesh > &s, vector &value, List< label > &indices)
template<typename Type>
void assignIF (GeometricField< Type, fvPatchField, volMesh > &field, Type &value, label index)
 Assign internal field.
template void assignIF (GeometricField< scalar, fvPatchField, volMesh > &field, scalar &value, label index)
template void assignIF (GeometricField< vector, fvPatchField, volMesh > &field, vector &value, label index)
void assignONE (volScalarField &s, List< label > &L)
 Assign one to volScalarField.
void assignBC (GeometricField< scalar, fvPatchField, volMesh > &s, label BC_ind, double value)
 Assign uniform Boundary Condition to a volScalarField.
void assignBC (GeometricField< scalar, fvPatchField, volMesh > &s, label BC_ind, Eigen::MatrixXd valueVec)
 Assign Boundary Condition to a volScalarField.
void assignBC (GeometricField< scalar, fvPatchField, volMesh > &s, label BC_ind, List< double > valueList)
 Assign Boundary Condition to a volScalarField.
void assignBC (GeometricField< vector, fvPatchField, volMesh > &s, label BC_ind, vector value)
 Assign Boundary Condition to a volVectorField.
void assignBC (GeometricField< tensor, fvPatchField, volMesh > &s, label BC_ind, tensor value)
 Assign Boundary Condition to a volTensorField.
void assignBC (GeometricField< vector, fvPatchField, volMesh > &s, label BC_ind, Eigen::MatrixXd valueVec)
 Assign Boundary Condition to a volVectorField.
void assignBC (GeometricField< tensor, fvPatchField, volMesh > &s, label BC_ind, Eigen::MatrixXd valueVec)
 Assign Boundary Condition to a volTensorField.
void assignBC (GeometricField< vector, pointPatchField, pointMesh > &s, label BC_ind, Eigen::MatrixXd valueVec)
 Assign Boundary Condition to a pointVectorField.
void assignBC (GeometricField< vector, pointPatchField, pointMesh > &s, label BC_ind, double value)
void assignBC (GeometricField< scalar, fvsPatchField, surfaceMesh > &field, label BC_ind, Eigen::MatrixXd value)
 Assign Boundary Condition to a surfaceField.
void assignBC (GeometricField< vector, fvsPatchField, surfaceMesh > &s, label BC_ind, Eigen::MatrixXd valueVec)
void assignBC (GeometricField< vector, fvPatchField, volMesh > &s, label BC_ind, List< vector > valueList)
 Assign Boundary Condition to a volVectorField.
void assignBC (GeometricField< vector, pointPatchField, pointMesh > &s, label BC_ind, List< vector > valueList)
 Assign Boundary Condition to a pointVectorField.
void assignBC (GeometricField< tensor, fvPatchField, volMesh > &s, label BC_ind, List< tensor > valueList)
 Assign Boundary Condition to a volTensorField.
void assignBC (GeometricField< vector, pointPatchField, pointMesh > &s, label BC_ind, vector value)
 Assign Boundary Condition to a pointVectorField.
void assignBC (GeometricField< vector, pointPatchField, pointMesh > &s, label BC_ind, List< double > valueList)
 Assign Boundary Condition to a pointVectorField.
template<typename Type>
void assignBC (GeometricField< Type, fvsPatchField, surfaceMesh > &field, label BC_ind, List< Type > &value)
 Assign Boundary Condition to a surfaceField.
template void assignBC (GeometricField< scalar, fvsPatchField, surfaceMesh > &s, label BC_ind, List< scalar > &valueList)
template void assignBC (GeometricField< vector, fvsPatchField, surfaceMesh > &s, label BC_ind, List< vector > &valueList)
template<typename Type>
void assignBC (GeometricField< Type, fvsPatchField, surfaceMesh > &field, label BC_ind, Type &value)
 Assign Boundary Condition to a surfaceField.
template void assignBC (GeometricField< scalar, fvsPatchField, surfaceMesh > &s, label BC_ind, scalar &valueList)
template void assignBC (GeometricField< vector, fvsPatchField, surfaceMesh > &s, label BC_ind, vector &valueList)
template<typename Type>
void changeNeumann2Dirichlet (GeometricField< Type, fvPatchField, volMesh > &field, Type &value)
 Change all Neumann boundary conditions to Dirichlet boundary conditions.
template void changeNeumann2Dirichlet (GeometricField< scalar, fvPatchField, volMesh > &field, scalar &value)
template void changeNeumann2Dirichlet (GeometricField< vector, fvPatchField, volMesh > &field, vector &value)
template<typename Type>
void assignZeroDirichlet (GeometricField< Type, fvPatchField, volMesh > &field)
 Assign zero internal field.
template void assignZeroDirichlet (GeometricField< vector, fvPatchField, volMesh > &field)
template void assignZeroDirichlet (GeometricField< scalar, fvPatchField, volMesh > &field)
template<typename Type>
void setBoxToValue (GeometricField< Type, fvPatchField, volMesh > &field, Eigen::MatrixXd Box, Type value)
 Set value of a volScalarField to a constant inside a given box.
template void setBoxToValue (GeometricField< scalar, fvPatchField, volMesh > &field, Eigen::MatrixXd Box, scalar value)
template void setBoxToValue (GeometricField< vector, fvPatchField, volMesh > &field, Eigen::MatrixXd Box, vector value)
template<typename Type>
void setIndices2Value (labelList &ind2set, List< Type > &value2set, labelList &movingIDS, List< Type > &originalList)
 Sets some given Indices of a list of objects to given values.
template void setIndices2Value (labelList &ind2set, List< scalar > &value2set, labelList &movingIDS, List< scalar > &originalList)
template void setIndices2Value (labelList &ind2set, List< vector > &value2set, labelList &movingIDS, List< vector > &originalList)
template<class Type>
void changeBCtype (GeometricField< Type, fvPatchField, volMesh > &field, word BCtype, label BC_ind)
 Change the boundary condition type for a GeometricField.
template void changeBCtype< scalar > (GeometricField< scalar, fvPatchField, volMesh > &field, word BCtype, label BC_ind)
template void changeBCtype< vector > (GeometricField< vector, fvPatchField, volMesh > &field, word BCtype, label BC_ind)
template<typename Type>
void assignMixedBC (GeometricField< Type, fvPatchField, volMesh > &field, label BC_ind, List< Type > &value, List< Type > &grad, List< scalar > &valueFrac)
 Assign value of a boundary condition of type "mixed".
template void assignMixedBC< scalar > (GeometricField< scalar, fvPatchField, volMesh > &field, label BC_ind, List< scalar > &value, List< scalar > &grad, List< scalar > &valueFrac)
template void assignMixedBC< vector > (GeometricField< vector, fvPatchField, volMesh > &field, label BC_ind, List< vector > &value, List< vector > &grad, List< scalar > &valueFrac)
template<typename T>
void setToZero (T &f1)
 Set a field of type vol[Scalar|Vector|Tensor]Field to 0.
template void setToZero (volScalarField &f1)
template void setToZero (volVectorField &f1)
template void setToZero (volTensorField &f1)
template<typename Type>
void assignMixedBC (GeometricField< Type, fvPatchField, volMesh > &field, label BC_ind, Eigen::MatrixXd &value, Eigen::MatrixXd &grad, Eigen::MatrixXd &valueFrac)
 Assign value of a boundary condition of type "mixed".
template<class Type, template< class > class PatchField, class GeoMesh>
PtrList< GeometricField< Type, PatchField, GeoMesh > > reconstructFromCoeff (PtrList< GeometricField< Type, PatchField, GeoMesh > > &modes, Eigen::MatrixXd &coeff_matrix, label Nmodes)
 Exact reconstruction using a certain number of modes for a list of fields and the projection coefficients.
template PtrList< GeometricField< scalar, fvPatchField, volMesh > > reconstructFromCoeff (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes, Eigen::MatrixXd &coeff_matrix, label Nmodes)
template PtrList< GeometricField< vector, fvPatchField, volMesh > > reconstructFromCoeff (PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes, Eigen::MatrixXd &coeff_matrix, label Nmodes)
template PtrList< GeometricField< tensor, fvPatchField, volMesh > > reconstructFromCoeff (PtrList< GeometricField< tensor, fvPatchField, volMesh > > &modes, Eigen::MatrixXd &coeff_matrix, label Nmodes)
template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, label nModes=0, bool consider_volumes=true)
 Gets the mass matrix using the eigen routine.
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &modes, label Nmodes, bool consider_volumes=false)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< tensor, fvPatchField, volMesh > > &modes, label Nmodes, bool consider_volumes)
template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields2, label nModes=0, bool consider_volumes=true)
 Gets the cross mass matrix using the eigen routine.
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes2, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &modes, PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &modes2, label Nmodes, bool consider_volumes=false)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes, PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes2, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< tensor, fvPatchField, volMesh > > &modes, PtrList< GeometricField< tensor, fvPatchField, volMesh > > &modes2, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< vector, pointPatchField, pointMesh > > &modes, label Nmodes, bool consider_volumes)
template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields2, Eigen::VectorXd weights, label Nmodes=0, bool consider_volumes=true)
 Gets the cross mass matrix using the eigen routine.
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes2, Eigen::VectorXd weights, label Nmodes=0, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &modes, PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &modes2, Eigen::VectorXd weights, label Nmodes=0, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes, PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes2, Eigen::VectorXd weights, label Nmodes=0, bool consider_volumes)
template Eigen::MatrixXd getMassMatrix (PtrList< GeometricField< tensor, fvPatchField, volMesh > > &modes, PtrList< GeometricField< tensor, fvPatchField, volMesh > > &modes2, Eigen::VectorXd weights, label Nmodes=0, bool consider_volumes)
template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::VectorXd getMassMatrixFV (GeometricField< Type, PatchField, GeoMesh > &snapshot)
 Gets a vector containing the volumes of each cell of the mesh.
template Eigen::VectorXd getMassMatrixFV (GeometricField< scalar, fvPatchField, volMesh > &snapshot)
template Eigen::VectorXd getMassMatrixFV (GeometricField< vector, fvPatchField, volMesh > &snapshot)
template Eigen::VectorXd getMassMatrixFV (GeometricField< vector, pointPatchField, pointMesh > &snapshot)
template Eigen::VectorXd getMassMatrixFV (GeometricField< tensor, fvPatchField, volMesh > &snapshot)
template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::VectorXd getCoeffs (GeometricField< Type, PatchField, GeoMesh > &snapshot, PtrList< GeometricField< Type, PatchField, GeoMesh > > &modes, label Nmodes=0, bool consider_volumes=true)
 Projects a snapshot on a basis function and gets the coefficients of the projection.
template Eigen::VectorXd getCoeffs (GeometricField< scalar, fvPatchField, volMesh > &snapshot, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes, label Nmodes, bool consider_volumes)
template Eigen::VectorXd getCoeffs (GeometricField< scalar, fvsPatchField, surfaceMesh > &snapshot, PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &modes, label Nmodes, bool consider_volumes=false)
template Eigen::VectorXd getCoeffs (GeometricField< vector, fvPatchField, volMesh > &snapshot, PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes, label Nmodes, bool consider_volumes)
template Eigen::VectorXd getCoeffs (GeometricField< vector, pointPatchField, pointMesh > &snapshot, PtrList< GeometricField< vector, pointPatchField, pointMesh > > &modes, label Nmodes, bool consider_volumes)
template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd getCoeffs (PtrList< GeometricField< Type, PatchField, GeoMesh > > &snapshot, PtrList< GeometricField< Type, PatchField, GeoMesh > > &modes, label Nmodes=0, bool consider_volumes=true)
 Projects snapshots on a basis function and gets the coefficients of the projection.
template Eigen::MatrixXd getCoeffs (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &snapshot, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &modes, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getCoeffs (PtrList< GeometricField< vector, fvPatchField, volMesh > > &snapshot, PtrList< GeometricField< vector, fvPatchField, volMesh > > &modes, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getCoeffs (PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &snapshot, PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &modes, label Nmodes, bool consider_volumes)
template Eigen::MatrixXd getCoeffs (PtrList< GeometricField< vector, pointPatchField, pointMesh > > &snapshot, PtrList< GeometricField< vector, pointPatchField, pointMesh > > &modes, label Nmodes, bool consider_volumes)
template<typename T>
project_to_POD_basis (T &field, PtrList< T > &modes)
 Compute the projection of a field in a POD basis.
template volVectorField project_to_POD_basis (volVectorField &field, PtrList< volVectorField > &modes)
template volScalarField project_to_POD_basis (volScalarField &field, PtrList< volScalarField > &modes)
template<typename T>
project_to_POD_basis (T &field, PtrList< T > &modes, const T &meanField)
 Compute the projection of a field in a POD basis.
template volVectorField project_to_POD_basis (volVectorField &field, PtrList< volVectorField > &modes, const volVectorField &meanField)
template volScalarField project_to_POD_basis (volScalarField &field, PtrList< volScalarField > &modes, const volScalarField &meanField)
Eigen::MatrixXd parTimeCombMat (List< Eigen::VectorXd > acquiredSnapshotsTimes, Eigen::MatrixXd parameters)
 A method to compute the time-parameter combined matrix whose any single element corresponds to a unique snapshot in the snapshots acquired for the offline stage.
template<class Type, template< class > class PatchField, class GeoMesh>
double errorFrobRel (GeometricField< Type, PatchField, GeoMesh > &field1, GeometricField< Type, PatchField, GeoMesh > &field2, List< label > *labels=NULL)
 Computes the relative error between two Fields in the Frobenius norm.
template double errorFrobRel (GeometricField< scalar, fvPatchField, volMesh > &field1, GeometricField< scalar, fvPatchField, volMesh > &field2, List< label > *labels)
template double errorFrobRel (GeometricField< vector, fvPatchField, volMesh > &field1, GeometricField< vector, fvPatchField, volMesh > &field2, List< label > *labels)
template double errorFrobRel (GeometricField< scalar, fvsPatchField, surfaceMesh > &field1, GeometricField< scalar, fvsPatchField, surfaceMesh > &field2, List< label > *labels)
template<typename T>
double errorLinfRel (GeometricField< T, fvPatchField, volMesh > &field1, GeometricField< T, fvPatchField, volMesh > &field2, List< label > *labels=NULL)
 Computes the relative error between two geometric Fields in Linf norm.
template double errorLinfRel (GeometricField< scalar, fvPatchField, volMesh > &field1, GeometricField< scalar, fvPatchField, volMesh > &field2, List< label > *labels)
template double errorLinfRel (GeometricField< vector, fvPatchField, volMesh > &field1, GeometricField< vector, fvPatchField, volMesh > &field2, List< label > *labels)
template<>
double errorL2Abs (GeometricField< vector, fvPatchField, volMesh > &field1, GeometricField< vector, fvPatchField, volMesh > &field2, volScalarField &Volumes)
template<>
double errorL2Abs (GeometricField< scalar, fvPatchField, volMesh > &field1, GeometricField< scalar, fvPatchField, volMesh > &field2, volScalarField &Volumes)
template<typename T>
double errorL2Abs (GeometricField< T, fvPatchField, volMesh > &field1, GeometricField< T, fvPatchField, volMesh > &field2, List< label > *labels=NULL)
 Computes the absolute error between two Fields in L2 norm.
template double errorL2Abs (GeometricField< scalar, fvPatchField, volMesh > &field1, GeometricField< scalar, fvPatchField, volMesh > &field2, List< label > *labels)
template double errorL2Abs (GeometricField< vector, fvPatchField, volMesh > &field1, GeometricField< vector, fvPatchField, volMesh > &field2, List< label > *labels)
template<class T, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd errorFrobRel (PtrList< GeometricField< T, PatchField, GeoMesh > > &fields1, PtrList< GeometricField< T, PatchField, GeoMesh > > &fields2, List< label > *labels=NULL)
 Computes the relative error in the Frobenius norm between two lists of fields.
template Eigen::MatrixXd errorFrobRel (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields2, List< label > *labels)
template Eigen::MatrixXd errorFrobRel (PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields2, List< label > *labels)
template Eigen::MatrixXd errorFrobRel (PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &fields1, PtrList< GeometricField< scalar, fvsPatchField, surfaceMesh > > &fields2, List< label > *labels)
template<typename T>
Eigen::MatrixXd errorL2Abs (PtrList< GeometricField< T, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< T, fvPatchField, volMesh > > &fields2, PtrList< volScalarField > &Volumes)
 Computes the relative error in L2 norm between two lists of Fields given the list of mesh volumes fields.
template Eigen::MatrixXd errorL2Abs (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields2, PtrList< volScalarField > &Volumes)
template Eigen::MatrixXd errorL2Abs (PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields2, PtrList< volScalarField > &Volumes)
template<typename T>
Eigen::MatrixXd errorL2Abs (PtrList< GeometricField< T, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< T, fvPatchField, volMesh > > &fields2, List< label > *labels=NULL)
 Computes the absolute error in L2 norm between two lists of Fields.
template Eigen::MatrixXd errorL2Abs (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields2, List< label > *labels)
template Eigen::MatrixXd errorL2Abs (PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields2, List< label > *labels)
template<typename T>
double errorL2Rel (GeometricField< T, fvPatchField, volMesh > &field1, GeometricField< T, fvPatchField, volMesh > &field2, List< label > *labels=NULL)
 Computes the relative error between two geometric Fields in L2 norm.
template double errorL2Rel (GeometricField< scalar, fvPatchField, volMesh > &field1, GeometricField< scalar, fvPatchField, volMesh > &field2, List< label > *labels)
template double errorL2Rel (GeometricField< vector, fvPatchField, volMesh > &field1, GeometricField< vector, fvPatchField, volMesh > &field2, List< label > *labels)
template<typename T>
Eigen::MatrixXd errorL2Rel (PtrList< GeometricField< T, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< T, fvPatchField, volMesh > > &fields2, List< label > *labels=NULL)
 Computes the relative error in L2 norm between two lists of fields.
template Eigen::MatrixXd errorL2Rel (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields2, List< label > *labels)
template Eigen::MatrixXd errorL2Rel (PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields1, PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields2, List< label > *labels)
template<typename T>
double errorL2Abs (GeometricField< T, fvPatchField, volMesh > &field1, GeometricField< T, fvPatchField, volMesh > &field2, volScalarField &Volumes)
 Computes the absolute error between two geometric Fields in L2 norm, given the mesh volumes field.
template<typename T>
void multField (T &f1, double alpha)
 Multiplication between a field of type vol[Scalar|Vector|Tensor]Field and a double.
template void multField (volScalarField &f1, double alpha)
template void multField (volVectorField &f1, double alpha)
template void multField (volTensorField &f1, double alpha)
template<typename T>
void multField (T &f1, const Eigen::VectorXd alphaVec)
 Multiplication between field of type vol[Scalar|Vector|Tensor]Field and a vector.
template void multField (volScalarField &f1, const Eigen::VectorXd alphaVec)
template void multField (volVectorField &f1, const Eigen::VectorXd alphaVec)
template void multField (volTensorField &f1, const Eigen::VectorXd alphaVec)
template<typename T>
void multField (PtrList< T > &f1, const Eigen::VectorXd alphaVec)
 Multiplication between a list of field of type vol[Scalar|Vector|Tensor]Field.
template void multField (PtrList< volScalarField > &f1, const Eigen::VectorXd alphaVec)
template void multField (PtrList< volVectorField > &f1, const Eigen::VectorXd alphaVec)
template void multField (PtrList< volTensorField > &f1, const Eigen::VectorXd alphaVec)
template<typename T>
void addFields (T &f1, const T &f2c, double alpha=1.0)
 Perform the following operation f1 + f2 * alpha with f1 and f2 being of type vol[Scalar|Vector|Tensor]Field and alpha a double.
template void addFields (volScalarField &f1, const volScalarField &f2c, double alpha)
template void addFields (volVectorField &f1, const volVectorField &f2c, double alpha)
template void addFields (volTensorField &f1, const volTensorField &f2c, double alpha)
template<typename T>
void subtractFields (T &f1, const T &f2)
 Perform the substraction (f1 - f2) between two fields of type vol[Scalar|Vector|Tensor]Field and alpha a double.
template void subtractFields (volScalarField &f1, const volScalarField &f2)
template void subtractFields (volVectorField &f1, const volVectorField &f2)
template void subtractFields (volTensorField &f1, const volTensorField &f2)
volTensorField tensorFieldProduct (const volScalarField &coef, const volTensorField &S)
 Tensor field product between a volScalarField and a volTensorField.
volTensorField tensorFieldProduct (const volTensorField &coef, const volTensorField &S)
 Tensor field product between two volTensorFields.
int dimensionField (const volTensorField &v)
 Return the dimension of a volTensorField.
int dimensionField (const volVectorField &v)
 Return the dimension of a volVectorField.
int dimensionField (const volScalarField &v)
 Return the dimension of a volScalarField.
template<class TypeField>
PtrList< TypeField > averageSubtract (PtrList< TypeField > fields, Eigen::MatrixXd ind, PtrList< TypeField > &ave)
 A function to compute time-averaged fields for a set of different parameter samples and also the fields with the corresponding averaged subtracted.
template PtrList< volScalarField > averageSubtract (PtrList< volScalarField > fields, Eigen::MatrixXd ind, PtrList< volScalarField > &ave)
template PtrList< volVectorField > averageSubtract (PtrList< volVectorField > fields, Eigen::MatrixXd ind, PtrList< volVectorField > &ave)
template<class TypeField>
TypeField computeAverage (PtrList< TypeField > &fields)
 Calculates the average of a list of fields.
template volVectorField computeAverage (PtrList< volVectorField > &fields)
template volScalarField computeAverage (PtrList< volScalarField > &fields)
template<typename Type>
void normalizeFields (PtrList< GeometricField< Type, fvPatchField, volMesh > > &fields)
 Normalize list of Geometric fields.
template void normalizeFields (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields)
template void normalizeFields (PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields)
template<typename Type>
Eigen::MatrixXd getValues (GeometricField< Type, fvPatchField, volMesh > &field, labelList &indices)
template<>
Eigen::MatrixXd getValues (GeometricField< vector, fvPatchField, volMesh > &field, labelList &indices, labelList *xyz)
template<>
Eigen::MatrixXd getValues (GeometricField< scalar, fvPatchField, volMesh > &field, labelList &indices, labelList *xyz)
template<typename T>
Eigen::MatrixXd getValues (PtrList< GeometricField< T, fvPatchField, volMesh > > &fields, labelList &indices, labelList *xyz)
template Eigen::MatrixXd getValues (PtrList< GeometricField< scalar, fvPatchField, volMesh > > &fields, labelList &indices, labelList *xyz)
template Eigen::MatrixXd getValues (PtrList< GeometricField< vector, fvPatchField, volMesh > > &fields, labelList &indices, labelList *xyz)
template<typename Type>
Eigen::MatrixXd getValues (GeometricField< Type, fvPatchField, volMesh > &field, labelList &indices, labelList *xyz=NULL)
 ///
template<typename Type>
Eigen::MatrixXd getValues (PtrList< GeometricField< Type, fvPatchField, volMesh > > &field, labelList &indices, labelList *xyz=NULL)
 Gets the values from a list of indices.
labelList getIndicesFromBox (const fvMesh &mesh, List< label > indices, Eigen::MatrixXd Box, List< vector > &points2Move)
 Gives the indices conteined into a defined box.
List< label > getIndices (const fvMesh &mesh, int index, int layers)
 Gets the indices of the cells around a certain cell.
List< label > getIndices (const fvMesh &mesh, int index_row, int index_col, int layers)
 Gets the indices of the cells around a certain cell.
void getPointsFromPatch (fvMesh &mesh, label ind, List< vector > &points, labelList &indices)
 Get the polabel coordinates and indices from patch.
List< vector > displacedSegment (List< vector > x0, double mux1, double mux2, double muy1, double muy2)
 Get position of displaced segment of points given the displacements of the end points.
vector displacePolabel (vector x0, vector x_low, vector x_up, double mux_low, double mux_up, double muy_low, double muy_up, double muz_low=0.0, double muz_up=0.0)
 Displace a Polabel belonging to a given segment.
Field< vector > rotateMesh (fvMesh &mesh, double r1, double r2, vector axis, double alpha, labelList movingPointsIDs, List< double > radii, word angleVariationMethod="Linear", double v=3)
 A function that rotates the mesh rigidly, by a fixed specified angle for the points lying within a disc of radius r1, and by a an angle which diminishes from the former angle to zero either linearly or following a Sinusoidal relation or Sigmoid function in a disc of radius r2 larger than r1.
Eigen::MatrixXd rotationMatrix (vector AxisOfRotation, double AngleOfRotation)
 Functions that return a Rotation Matrix given an axis of rotation and an angle in degrees.
Eigen::VectorXd boudaryFaceToCellDistance (fvMesh &mesh, label BC_ind)
 Compute the distance between the boundary face center and the boundary cell center.
List< label > getIndicesFromDisc (const fvMesh &mesh, double radius, vector origin, vector axis, List< double > &radii)
 Gets the indices of the points which are inside a disc of a specified radius before carrying out a rotation around an axis.
template<typename type_f>
List< label > getIndicesFromBox (GeometricField< type_f, fvPatchField, volMesh > &field, Eigen::MatrixXd Box)
 Gets the indices from coordinates of a given box.
template List< label > getIndicesFromBox (GeometricField< scalar, fvPatchField, volMesh > &field, Eigen::MatrixXd Box)
template List< label > getIndicesFromBox (GeometricField< vector, fvPatchField, volMesh > &field, Eigen::MatrixXd Box)
template<typename type_f>
fvMeshSubset * getSubMeshFromBox (GeometricField< type_f, fvPatchField, volMesh > &field, Eigen::MatrixXd Box)
 Gets a subMesh from a box of coordinates and a given field (used only for the mesh).
template fvMeshSubset * getSubMeshFromBox (GeometricField< scalar, fvPatchField, volMesh > &field, Eigen::MatrixXd Box)
template fvMeshSubset * getSubMeshFromBox (GeometricField< vector, fvPatchField, volMesh > &field, Eigen::MatrixXd Box)
volScalarField meshNonOrtho (fvMesh &mesh, volScalarField &NonOrtho)
 Returns a scalarField that containes the non-orthogonality value of a given mesh.
List< vector > rotatePoints (const List< vector > &originalPoints, vector AxisOfRotation, double AngleOfRotation)
 Rotate a list of points in clockwise direction given an axis of rotation and an angle in degrees.
template<typename T>
Eigen::MatrixXd dot_product_POD (PtrList< T > &v, PtrList< T > &w, const word &hilbertSpacePOD, const double &weightBC, const word &patchBC, const double &weightH1=1.0)
 Perform the dot product of two PtrList of type T.
template Eigen::MatrixXd dot_product_POD (PtrList< volTensorField > &v, PtrList< volTensorField > &w, const word &hilbertSpacePOD, const double &weightBC, const word &patchBC, const double &weightH1)
template Eigen::MatrixXd dot_product_POD (PtrList< volVectorField > &v, PtrList< volVectorField > &w, const word &hilbertSpacePOD, const double &weightBC, const word &patchBC, const double &weightH1)
template Eigen::MatrixXd dot_product_POD (PtrList< volScalarField > &v, PtrList< volScalarField > &w, const word &hilbertSpacePOD, const double &weightBC, const word &patchBC, const double &weightH1)
double dot_product_POD (const volScalarField &v, const volScalarField &w, const word &hilbertSpacePOD, const double &weightBC=0., const word &patchBC="inlet", const double &weightH1=1.0)
 Perform the dot product of v and w for a given hilbertSpace.
double dot_product_POD (const volVectorField &v, const volVectorField &w, const word &hilbertSpacePOD, const double &weightBC=0., const word &patchBC="inlet", const double &weightH1=1.0)
 Perform the dot product of v and w for a given hilbertSpace.
double dot_product_POD (const volTensorField &v, const volTensorField &w, const word &hilbertSpacePOD, const double &weightBC=0., const word &patchBC="inlet", const double &weightH1=1.0)
 Perform the dot product of v and w for a given hilbertSpace.
template<typename T>
double dot_product_H1 (const T &v, const T &w, const double &weightH1=1.0)
 Perform the H1 dot product of v and w.
template double dot_product_H1 (const volVectorField &v, const volVectorField &w, const double &weightH1)
template double dot_product_H1 (const volScalarField &v, const volScalarField &w, const double &weightH1)
double dot_product_L2 (const volVectorField &v, const volVectorField &w)
 Perform the L2 dot product of v and w.
double dot_product_L2 (const volScalarField &v, const volScalarField &w)
 Perform the L2 dot product of v and w.
double dot_product_L2 (const volTensorField &v, const volTensorField &w)
 Perform the L2 dot product of v and w.
double dot_product_patch (const Eigen::VectorXd &f1BC_i, const Eigen::VectorXd &f2BC_i, const scalarField &AreaFace, const int &d)
 Perform the L2 dot product of v and w at a given boundary patch.
template<typename T>
double dot_product_boundary (const T &v, const T &w, const word &patchBC)
 Perform the L2 dot product of v and w at a given boundary.
template double dot_product_boundary (const volTensorField &v, const volTensorField &w, const word &patchBC)
template double dot_product_boundary (const volVectorField &v, const volVectorField &w, const word &patchBC)
template double dot_product_boundary (const volScalarField &v, const volScalarField &w, const word &patchBC)
template<typename T>
double dot_product_L2wBC (const T &v, const T &w, const double &weightBC, const word &patchBC="inlet")
 Perform the L2 dot product of v and w at the boundaries.
template double dot_product_L2wBC (const volTensorField &v, const volTensorField &w, const double &weightBC, const word &patchBC)
template double dot_product_L2wBC (const volVectorField &v, const volVectorField &w, const double &weightBC, const word &patchBC)
template double dot_product_L2wBC (const volScalarField &v, const volScalarField &w, const double &weightBC, const word &patchBC)
template<typename T>
double norm_L2wBC (const T &v, const double &weightBC, const word &patchBC="inlet")
 Compute the norm using the L2 dot product of v at the boundaries.
template double norm_L2wBC (const volTensorField &v, const double &weightBC, const word &patchBC)
template double norm_L2wBC (const volVectorField &v, const double &weightBC, const word &patchBC)
template double norm_L2wBC (const volScalarField &v, const double &weightBC, const word &patchBC)
template<typename T>
double norm_POD (const T &v, const word &hilbertSpacePOD, const double &weightBC=0., const word &patchBC="inlet", const double &weightH1=1.0)
 Compute the norm of v.
template double norm_POD (const volVectorField &v, const word &hilbertSpacePOD, const double &weightBC, const word &patchBC, const double &weightH1)
template double norm_POD (const volScalarField &v, const word &hilbertSpacePOD, const double &weightBC, const word &patchBC, const double &weightH1)
template<typename T>
double L2Norm (const T v)
 Compute the L2 norm of v.
template double L2Norm (const volTensorField &v)
template double L2Norm (const volVectorField &v)
template double L2Norm (const volScalarField &v)
template double L2Norm (const volTensorField v)
template double L2Norm (const volVectorField v)
template double L2Norm (const volScalarField v)
template double L2Norm (const tmp< volTensorField > v)
template double L2Norm (const tmp< volVectorField > v)
template double L2Norm (const tmp< volScalarField > v)
template<>
double LinfNorm (GeometricField< scalar, fvPatchField, volMesh > &field)
template<>
double LinfNorm (GeometricField< vector, fvPatchField, volMesh > &field)
template<>
double H1Seminorm (GeometricField< scalar, fvPatchField, volMesh > &field)
template<>
double H1Seminorm (GeometricField< vector, fvPatchField, volMesh > &field)
template<class Type, template< class > class PatchField, class GeoMesh>
double frobNorm (GeometricField< Type, PatchField, GeoMesh > &field)
 Evaluate the Frobenius norm of a field.
template double frobNorm (GeometricField< scalar, fvPatchField, volMesh > &field)
template double frobNorm (GeometricField< scalar, fvsPatchField, surfaceMesh > &field)
template double frobNorm (GeometricField< vector, fvPatchField, volMesh > &field)
double L2normOnPatch (fvMesh &mesh, volScalarField &field, word patch)
 Evaluate the L2 norm of a field on a boundary patch.
double L2productOnPatch (fvMesh &mesh, List< scalar > &field1, List< scalar > &field2, word patch)
 Evaluate the L2 inner product between two scalarLists.
double LinfNormOnPatch (fvMesh &mesh, volScalarField &field, word patch)
 Evaluate the Linf norm of a field on a boundary patch.
double integralOnPatch (fvMesh &mesh, volScalarField &field, word patch)
 Evaluate the integral on a patch.
double integralOnPatch (fvMesh &mesh, List< scalar > field, word patch)
 Evaluate the integral on a patch.
template<class T>
double LinfNorm (GeometricField< T, fvPatchField, volMesh > &field)
 Evaluate the Linf norm of a geometric field.
template<class T>
double H1Seminorm (GeometricField< T, fvPatchField, volMesh > &field)
 Evaluate the H1 seminorm of a geoemtri.
std::string str_trim (std::string const &s)
 Trim a string cf.
void str_format_io (std::string const &s, unsigned int Nmax)
 Format a string.
std::string double2ConciseString (const double &d)
 Returns the double d in string format without keeping all the extra 0.
bool containsSubstring (std::string contain, std::string contained)
 Returns true if contained is a substring of contain, false otherwise.
std::vector< int > extractIntFromString (std::string input)
 Returns an array storing all the integers in the input string.
void createSymLink (word folder)
 Creates symbolic links to 0, system and constant.
void createSymLink (word linkFolder, word destFolder)
 Creates a symbolic link to linkFolder into the destFolder.
bool check_folder (word folder)
 Checks if a folder exists.
bool check_off ()
 Check if the offline data folder "./ITHACAoutput/Offline" exists.
bool check_file (std::string fileName)
 Function that returns true if a file exists.
bool check_pod ()
 Check if the POD data folder "./ITHACAoutput/POD" exists.
bool check_sup ()
 Check if the supremizer folder exists.
Eigen::MatrixXd rand (label rows, label cols, double min, double max)
 Generates random matrix with random values in an interval.
Eigen::MatrixXd rand (label rows, Eigen::MatrixXd minMax)
 Generates random matrix with random values in an interval.
bool isInteger (double ratio)
 This function checks if ratio is an integer.
bool isTurbulent ()
 This function checks if the case is turbulent.
template<typename T>
List< T > combineList (List< List< T > > &doubleList)
 Combine a list of list into a single list with unique elements.
template List< label > combineList (List< List< label > > &doubleList)
Eigen::MatrixXd pinv_eigen_based (Eigen::MatrixXd &origin, const float er=0)
 Using the Eigen library, using the SVD decomposition method to solve the matrix pseudo-inverse, the default error er is 0.
Eigen::MatrixXd invertMatrix (Eigen::MatrixXd &matrixToInvert, const word inversionMethod)
 Invert a matrix given the method name in the ITHACAdict.

Detailed Description

Namespace to implement some useful assign operation of OF fields.

Namespace to implement some useful functions inside ITHACA-FV.

Namespace to implement some useful system calls inside ITHACA-FV.

Namespace to implement projection coefficients calculation and mass matrices.

Function Documentation

◆ addFields()

template<typename T>
void ITHACAutilities::addFields ( T & f1,
const T & f2c,
double alpha = 1.0 )

Perform the following operation f1 + f2 * alpha with f1 and f2 being of type vol[Scalar|Vector|Tensor]Field and alpha a double.

Parameters
f1field
f2field
alphadouble

Definition at line 110 of file ITHACAfieldsOperations.C.

◆ assignBC() [1/18]

void ITHACAutilities::assignBC ( GeometricField< scalar, fvPatchField, volMesh > & s,
label BC_ind,
double value )

Assign uniform Boundary Condition to a volScalarField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueThe value you want to assign (it must be a double).

Definition at line 80 of file ITHACAassign.C.

◆ assignBC() [2/18]

void ITHACAutilities::assignBC ( GeometricField< scalar, fvPatchField, volMesh > & s,
label BC_ind,
Eigen::MatrixXd valueVec )

Assign Boundary Condition to a volScalarField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueVecThe value you want to assign (it must be an Eigen MatrixXd).

Definition at line 94 of file ITHACAassign.C.

◆ assignBC() [3/18]

void ITHACAutilities::assignBC ( GeometricField< scalar, fvPatchField, volMesh > & s,
label BC_ind,
List< double > valueList )

Assign Boundary Condition to a volScalarField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueListThe value you want to assign (it must be a list of doubles).

Definition at line 111 of file ITHACAassign.C.

◆ assignBC() [4/18]

void ITHACAutilities::assignBC ( GeometricField< scalar, fvsPatchField, surfaceMesh > & field,
label BC_ind,
Eigen::MatrixXd value )

Assign Boundary Condition to a surfaceField.

Parameters
fieldfield where you want to assign the BC.
[in]BC_indThe bc ind
valueyou want to assign (it must be column matrix).
Template Parameters
TypeType of field (vector or scalar)

Definition at line 283 of file ITHACAassign.C.

◆ assignBC() [5/18]

void ITHACAutilities::assignBC ( GeometricField< tensor, fvPatchField, volMesh > & s,
label BC_ind,
Eigen::MatrixXd valueVec )

Assign Boundary Condition to a volTensorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueVecThe value you want to assign (it must be an Eigen MatrixXd).

Definition at line 231 of file ITHACAassign.C.

◆ assignBC() [6/18]

void ITHACAutilities::assignBC ( GeometricField< tensor, fvPatchField, volMesh > & s,
label BC_ind,
List< tensor > valueList )

Assign Boundary Condition to a volTensorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueListThe value you want to assign (it must be a list of tensors).

Definition at line 421 of file ITHACAassign.C.

◆ assignBC() [7/18]

void ITHACAutilities::assignBC ( GeometricField< tensor, fvPatchField, volMesh > & s,
label BC_ind,
tensor value )

Assign Boundary Condition to a volTensorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueThe value you want to assign (it must be an OpenFOAM tensor).

Definition at line 196 of file ITHACAassign.C.

◆ assignBC() [8/18]

template<typename Type>
void ITHACAutilities::assignBC ( GeometricField< Type, fvsPatchField, surfaceMesh > & field,
label BC_ind,
List< Type > & value )

Assign Boundary Condition to a surfaceField.

Parameters
fieldfield where you want to assign the BC.
[in]BC_indThe bc ind
valueyou want to assign (it must be a list of double or vector).
Template Parameters
TypeType of field (vector or scalar)

Definition at line 544 of file ITHACAassign.C.

◆ assignBC() [9/18]

template<typename Type>
void ITHACAutilities::assignBC ( GeometricField< Type, fvsPatchField, surfaceMesh > & field,
label BC_ind,
Type & value )

Assign Boundary Condition to a surfaceField.

Parameters
fieldfield where you want to assign the BC.
[in]BC_indThe bc ind
valueyou want to assign (it must be a double or vector).
Template Parameters
TypeType of field (vector or scalar)

Definition at line 618 of file ITHACAassign.C.

◆ assignBC() [10/18]

void ITHACAutilities::assignBC ( GeometricField< vector, fvPatchField, volMesh > & s,
label BC_ind,
Eigen::MatrixXd valueVec )

Assign Boundary Condition to a volVectorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueVecThe value you want to assign (it must be an Eigen MatrixXd).

Definition at line 212 of file ITHACAassign.C.

◆ assignBC() [11/18]

void ITHACAutilities::assignBC ( GeometricField< vector, fvPatchField, volMesh > & s,
label BC_ind,
List< vector > valueList )

Assign Boundary Condition to a volVectorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueListThe value you want to assign (it must be a list of vectors).

Definition at line 318 of file ITHACAassign.C.

◆ assignBC() [12/18]

void ITHACAutilities::assignBC ( GeometricField< vector, fvPatchField, volMesh > & s,
label BC_ind,
vector value )

Assign Boundary Condition to a volVectorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueThe value you want to assign (it must be an OpenFOAM vector).

Definition at line 180 of file ITHACAassign.C.

◆ assignBC() [13/18]

void ITHACAutilities::assignBC ( GeometricField< vector, fvsPatchField, surfaceMesh > & s,
label BC_ind,
Eigen::MatrixXd valueVec )

Definition at line 299 of file ITHACAassign.C.

◆ assignBC() [14/18]

void ITHACAutilities::assignBC ( GeometricField< vector, pointPatchField, pointMesh > & s,
label BC_ind,
double value )

Definition at line 268 of file ITHACAassign.C.

◆ assignBC() [15/18]

void ITHACAutilities::assignBC ( GeometricField< vector, pointPatchField, pointMesh > & s,
label BC_ind,
Eigen::MatrixXd valueVec )

Assign Boundary Condition to a pointVectorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueVecThe value you want to assign (it must be an Eigen MatrixXd).

Definition at line 249 of file ITHACAassign.C.

◆ assignBC() [16/18]

void ITHACAutilities::assignBC ( GeometricField< vector, pointPatchField, pointMesh > & s,
label BC_ind,
List< double > valueList )

Assign Boundary Condition to a pointVectorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueListThe value you want to assign (it must be a list of doubles).

Definition at line 498 of file ITHACAassign.C.

◆ assignBC() [17/18]

void ITHACAutilities::assignBC ( GeometricField< vector, pointPatchField, pointMesh > & s,
label BC_ind,
List< vector > valueList )

Assign Boundary Condition to a pointVectorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueListThe value you want to assign (it must be a list of doubles).

Definition at line 379 of file ITHACAassign.C.

◆ assignBC() [18/18]

void ITHACAutilities::assignBC ( GeometricField< vector, pointPatchField, pointMesh > & s,
label BC_ind,
vector value )

Assign Boundary Condition to a pointVectorField.

Parameters
[in]sfield where you want to assign the BC.
[in]BC_indThe BC index.
[in]valueThe value you want to assign (it must be an OpenFOAM vector).

Definition at line 482 of file ITHACAassign.C.

◆ assignIF() [1/3]

template<typename Type>
void ITHACAutilities::assignIF ( GeometricField< Type, fvPatchField, volMesh > & field,
Type & value,
label index )

Assign internal field.

Parameters
[in,out]fieldField to which assign the internal field
valueThe value you want to assign
indexThe index where you want assign
Template Parameters
TypeType of field vector or scalar

Definition at line 61 of file ITHACAassign.C.

◆ assignIF() [2/3]

template<typename Type>
void ITHACAutilities::assignIF ( GeometricField< Type, fvPatchField, volMesh > & field,
Type & value,
List< label > & indices )

Assign internal field.

Parameters
[in,out]fieldField to which assign the internal field
valueThe value you want to assign
indicesThe list of indices where you want assign
Template Parameters
TypeType of field vector or scalar

Definition at line 46 of file ITHACAassign.C.

◆ assignIF() [3/3]

template<typename Type>
void ITHACAutilities::assignIF ( GeometricField< Type, fvPatchField, volMesh > & field,
Type value )

Assign internal field.

Parameters
[in,out]fieldField to which assign the internal field
valueThe value you want to assign
Template Parameters
TypeType of field vector or scalar

Definition at line 31 of file ITHACAassign.C.

◆ assignMixedBC() [1/2]

template<typename Type>
void ITHACAutilities::assignMixedBC ( GeometricField< Type, fvPatchField, volMesh > & field,
label BC_ind,
Eigen::MatrixXd & value,
Eigen::MatrixXd & grad,
Eigen::MatrixXd & valueFrac )

Assign value of a boundary condition of type "mixed".

Parameters
[in,out]fieldField
[in]BC_indIndex of the boundary patch
[in]valueReference fixed value
[in]gradReference normal gradient
[in]valueFracWeight field
Template Parameters
TypeType of the field, it can be scalar or vector.

◆ assignMixedBC() [2/2]

template<typename Type>
void ITHACAutilities::assignMixedBC ( GeometricField< Type, fvPatchField, volMesh > & field,
label BC_ind,
List< Type > & value,
List< Type > & grad,
List< scalar > & valueFrac )

Assign value of a boundary condition of type "mixed".

Parameters
[in,out]fieldField
[in]BC_indIndex of the boundary patch
[in]valueReference fixed value
[in]gradReference normal gradient
[in]valueFracWeight field
Template Parameters
TypeType of the field, it can be scalar or vector.

Definition at line 779 of file ITHACAassign.C.

◆ assignONE()

void ITHACAutilities::assignONE ( volScalarField & s,
List< label > & L )

Assign one to volScalarField.

Parameters
[in,out]sfield where you want to assign the internal field condition
LList of indices

Definition at line 72 of file ITHACAassign.C.

◆ assignZeroDirichlet()

template<typename Type>
void ITHACAutilities::assignZeroDirichlet ( GeometricField< Type, fvPatchField, volMesh > & field)

Assign zero internal field.

Change all non-zero Dirichlet boundary condition values to zero. Change all Neumann boundary conditions to Dirichlet boundary conditions.

Parameters
[in,out]fieldField of which the BCs need to be changed
Template Parameters
TypeType of field (vector or scalar)

Definition at line 662 of file ITHACAassign.C.

◆ averageSubtract()

template<class TypeField>
PtrList< TypeField > ITHACAutilities::averageSubtract ( PtrList< TypeField > fields,
Eigen::MatrixXd ind,
PtrList< TypeField > & ave )

A function to compute time-averaged fields for a set of different parameter samples and also the fields with the corresponding averaged subtracted.

Parameters
[in]fieldsThe fields from which the time-averaged fields have to be computed
[in]indThe indices at which fields for different samples of the parameter start
aveThe computed time-averaged fields
Template Parameters
TypeFieldType of field
Returns
A list of fields which correspond to the original fields subtracted by the time-averaged part

Definition at line 183 of file ITHACAfieldsOperations.C.

◆ boudaryFaceToCellDistance()

Eigen::VectorXd ITHACAutilities::boudaryFaceToCellDistance ( fvMesh & mesh,
label BC_ind )

Compute the distance between the boundary face center and the boundary cell center.

Parameters
[in]BC_indIndex of the boundary patch
[in]meshMesh
Returns
Vector of the face to cell center distance in Eigen format

Definition at line 295 of file ITHACAgeometry.C.

◆ changeBCtype()

template<class Type>
void ITHACAutilities::changeBCtype ( GeometricField< Type, fvPatchField, volMesh > & field,
word BCtype,
label BC_ind )

Change the boundary condition type for a GeometricField.

Parameters
fieldThe field
[in]BCtypeThe The BC type you want to set
[in]BC_indThe BC index
Template Parameters
TypeThe type of field it can be scalar or vector

Definition at line 763 of file ITHACAassign.C.

◆ changeNeumann2Dirichlet()

template<typename Type>
void ITHACAutilities::changeNeumann2Dirichlet ( GeometricField< Type, fvPatchField, volMesh > & field,
Type & value )

Change all Neumann boundary conditions to Dirichlet boundary conditions.

Parameters
[in,out]fieldField of which the BCs need to be changed
valueThe value you want to assign
Template Parameters
TypeType of field vector or scalar

Definition at line 641 of file ITHACAassign.C.

◆ check_file()

bool ITHACAutilities::check_file ( std::string fileName)

Function that returns true if a file exists.

Parameters
[in]fileNameThe name of the file
Returns
1 if the file exists 0 elsewhere.

Definition at line 136 of file ITHACAsystem.C.

◆ check_folder()

bool ITHACAutilities::check_folder ( word folder)

Checks if a folder exists.

Parameters
[in]folderThe folder you want to check.
Returns
1 if the folder exists 0 elsewhere.

Definition at line 89 of file ITHACAsystem.C.

◆ check_off()

bool ITHACAutilities::check_off ( )

Check if the offline data folder "./ITHACAoutput/Offline" exists.

Returns
1 if the folder exists 0 elsewhere.

Definition at line 107 of file ITHACAsystem.C.

◆ check_pod()

bool ITHACAutilities::check_pod ( )

Check if the POD data folder "./ITHACAoutput/POD" exists.

Returns
1 if the folder exists 0 elsewhere.

Definition at line 143 of file ITHACAsystem.C.

◆ check_sup()

bool ITHACAutilities::check_sup ( )

Check if the supremizer folder exists.

Returns
1 if the folder exists 0 elsewhere.

Definition at line 173 of file ITHACAsystem.C.

◆ combineList()

template<typename T>
List< T > ITHACAutilities::combineList ( List< List< T > > & doubleList)

Combine a list of list into a single list with unique elements.

Parameters
doubleListThe list of list
Template Parameters
Ttype of element label, double, etc...
Returns
list in unique order

Definition at line 111 of file ITHACAutilities.C.

◆ computeAverage()

template<class TypeField>
TypeField ITHACAutilities::computeAverage ( PtrList< TypeField > & fields)

Calculates the average of a list of fields.

Parameters
fieldsThe fields
Template Parameters
TypeField{ description }
Returns
The average.

Definition at line 227 of file ITHACAfieldsOperations.C.

◆ containsSubstring()

bool ITHACAutilities::containsSubstring ( std::string contain,
std::string contained )

Returns true if contained is a substring of contain, false otherwise.

Parameters
containstring
containedstring

Definition at line 81 of file ITHACAstring.C.

◆ createSymLink() [1/2]

void ITHACAutilities::createSymLink ( word folder)

Creates symbolic links to 0, system and constant.

Parameters
[in]folderThe folder where to create the symbolic links

Definition at line 30 of file ITHACAsystem.C.

◆ createSymLink() [2/2]

void ITHACAutilities::createSymLink ( word linkFolder,
word destFolder )

Creates a symbolic link to linkFolder into the destFolder.

Parameters
[in]linkFolderThe folder to be linked
[in]destFolderThe folder where to create the symbolic link

Definition at line 78 of file ITHACAsystem.C.

◆ dimensionField() [1/3]

int ITHACAutilities::dimensionField ( const volScalarField & v)

Return the dimension of a volScalarField.

Parameters
v

Definition at line 175 of file ITHACAfieldsOperations.C.

◆ dimensionField() [2/3]

int ITHACAutilities::dimensionField ( const volTensorField & v)

Return the dimension of a volTensorField.

Parameters
v

Definition at line 163 of file ITHACAfieldsOperations.C.

◆ dimensionField() [3/3]

int ITHACAutilities::dimensionField ( const volVectorField & v)

Return the dimension of a volVectorField.

Parameters
v

Definition at line 169 of file ITHACAfieldsOperations.C.

◆ displacedSegment()

List< vector > ITHACAutilities::displacedSegment ( List< vector > x0,
double mux1,
double mux2,
double muy1,
double muy2 )

Get position of displaced segment of points given the displacements of the end points.

Parameters
[in]x0The points of the segment before displacement
[in]mux1The x displacement of the 1st end of the segment
[in]mux2The x displacement of the 2nd end of the segment
[in]muy1The y displacement of the 1st end of the segment
[in]muy2The y displacement of the 2nd end of the segment
Returns
The points coordinates of the displaced segment

Definition at line 132 of file ITHACAgeometry.C.

◆ displacePolabel()

vector ITHACAutilities::displacePolabel ( vector x0,
vector x_low,
vector x_up,
double mux_low,
double mux_up,
double muy_low,
double muy_up,
double muz_low = 0.0,
double muz_up = 0.0 )

Displace a Polabel belonging to a given segment.

Parameters
[in]x0The initial coordinate of the polabel
[in]x_lowThe position of the lower end of the segment
[in]x_upThe posizion of the upper end of the segment
[in]mux_lowThe x displacement of the lower end of the segment
[in]mux_upThe x displacement of the upper end of the segment
[in]muy_lowThe y displacement of the lower end of the segment
[in]muy_upThe y displacement of the upper end of the segment
[in]muz_lowThe z displacement of the lower end of the segment
[in]muz_upThe z displacement of the upper end of the segment
Returns
The displaced polabel

Definition at line 159 of file ITHACAgeometry.C.

◆ dot_product_boundary()

template<typename T>
double ITHACAutilities::dot_product_boundary ( const T & v,
const T & w,
const word & patchBC )

Perform the L2 dot product of v and w at a given boundary.

Template Parameters
Ttype of v & w, can be vol[Scalar|Vector|Tensor]Field
Parameters
vfield of type T
wfield of type T
patchBCselect which boundary patch to apply the dot product
Returns
result of the dot product

Definition at line 220 of file ITHACAnorm.C.

◆ dot_product_H1()

template<typename T>
double ITHACAutilities::dot_product_H1 ( const T & v,
const T & w,
const double & weightH1 = 1.0 )

Perform the H1 dot product of v and w.

Template Parameters
Ttype of v and w, can be vol[Scalar|Vector]Field
Parameters
vfield of type T
wfield of type T
Returns
Result of the dot product

Definition at line 174 of file ITHACAnorm.C.

◆ dot_product_L2() [1/3]

double ITHACAutilities::dot_product_L2 ( const volScalarField & v,
const volScalarField & w )

Perform the L2 dot product of v and w.

Parameters
va volScalarField
wa volScalarField
Returns
Result of the dot product

Definition at line 188 of file ITHACAnorm.C.

◆ dot_product_L2() [2/3]

double ITHACAutilities::dot_product_L2 ( const volTensorField & v,
const volTensorField & w )

Perform the L2 dot product of v and w.

Parameters
va volScalarField
wa volScalarField
Returns
Result of the dot product

Definition at line 194 of file ITHACAnorm.C.

◆ dot_product_L2() [3/3]

double ITHACAutilities::dot_product_L2 ( const volVectorField & v,
const volVectorField & w )

Perform the L2 dot product of v and w.

Parameters
va volVectorField
wa volVectorField
Returns
Result of the dot product

Definition at line 182 of file ITHACAnorm.C.

◆ dot_product_L2wBC()

template<typename T>
double ITHACAutilities::dot_product_L2wBC ( const T & v,
const T & w,
const double & weightBC,
const word & patchBC = "inlet" )

Perform the L2 dot product of v and w at the boundaries.

Template Parameters
Ttype of v & w, can be vol[Scalar|Vector|Tensor]Field
Parameters
vfield of type T
wfield of type T
weightBCset the weight of the dot product at the boundary
patchBCselect which boundary patch to apply the dot product on pathBC
Returns
result of the dot product

Definition at line 264 of file ITHACAnorm.C.

◆ dot_product_patch()

double ITHACAutilities::dot_product_patch ( const Eigen::VectorXd & f1BC_i,
const Eigen::VectorXd & f2BC_i,
const scalarField & AreaFace,
const int & d )

Perform the L2 dot product of v and w at a given boundary patch.

Template Parameters
Ttype of v & w, can be vol[Scalar|Vector|Tensor]Field
Parameters
f1BC_ifield of type T
f2BC_ifield of type T
AreaFaceset the weight of the dot product at the boundary
patchBCselect which boundary patch to apply the dot product on pathBC
ddimension of the field f1BC_i
Returns
result of the dot product

Definition at line 200 of file ITHACAnorm.C.

◆ dot_product_POD() [1/4]

double ITHACAutilities::dot_product_POD ( const volScalarField & v,
const volScalarField & w,
const word & hilbertSpacePOD,
const double & weightBC = 0.,
const word & patchBC = "inlet",
const double & weightH1 = 1.0 )

Perform the dot product of v and w for a given hilbertSpace.

Parameters
va volScalarField
wa volScalarField
hilbertSpacePODhibert space use to compute the dot product, can be L2, L2wBC, H1, wH1
weightBCin the case of L2wBC, set the weight of the dot product at the boundary
patchBCin the case of L2wBC, select which boundary patch to apply the dot product on pathBC
weightH1coefficient in front of the dot product of the gradient

Definition at line 84 of file ITHACAnorm.C.

◆ dot_product_POD() [2/4]

double ITHACAutilities::dot_product_POD ( const volTensorField & v,
const volTensorField & w,
const word & hilbertSpacePOD,
const double & weightBC = 0.,
const word & patchBC = "inlet",
const double & weightH1 = 1.0 )

Perform the dot product of v and w for a given hilbertSpace.

Parameters
va volTensorField
wa volTensorField
hilbertSpacePODhibert space use to compute the dot product, can be L2, L2wBC, H1, wH1
weightBCin the case of L2wBC, set the weight of the dot product at the boundary
patchBCin the case of L2wBC, select which boundary patch to apply the dot product on pathBC
weightH1coefficient in front of the dot product of the gradient

Definition at line 144 of file ITHACAnorm.C.

◆ dot_product_POD() [3/4]

double ITHACAutilities::dot_product_POD ( const volVectorField & v,
const volVectorField & w,
const word & hilbertSpacePOD,
const double & weightBC = 0.,
const word & patchBC = "inlet",
const double & weightH1 = 1.0 )

Perform the dot product of v and w for a given hilbertSpace.

Parameters
va volVectorField
wa volVectorField
hilbertSpacePODhibert space use to compute the dot product, can be L2, L2wBC, H1, wH1
weightBCin the case of L2wBC, set the weight of the dot product at the boundary
patchBCin the case of L2wBC, select which boundary patch to apply the dot product on pathBC
weightH1coefficient in front of the dot product of the gradient

Definition at line 116 of file ITHACAnorm.C.

◆ dot_product_POD() [4/4]

template<typename T>
Eigen::MatrixXd ITHACAutilities::dot_product_POD ( PtrList< T > & v,
PtrList< T > & w,
const word & hilbertSpacePOD,
const double & weightBC,
const word & patchBC,
const double & weightH1 = 1.0 )

Perform the dot product of two PtrList of type T.

Template Parameters
Ttype of v and w, vol[Scalar|Vector|Tensor]Field
Parameters
vfield of type T
wfield of type T
hilbertSpacePODhibert space use to compute the dot product, can be L2, L2wBC, H1, wH1
weightBCin the case of L2wBC, set the weight of the dot product at the boundary
patchBCin the case of L2wBC, select which boundary patch to apply the dot product on pathBC
weightH1coefficient in front of the dot product of the gradient

Definition at line 41 of file ITHACAnorm.C.

◆ double2ConciseString()

std::string ITHACAutilities::double2ConciseString ( const double & d)

Returns the double d in string format without keeping all the extra 0.

Parameters
ddouble

Definition at line 63 of file ITHACAstring.C.

◆ errorFrobRel() [1/2]

template<class Type, template< class > class PatchField, class GeoMesh>
double ITHACAutilities::errorFrobRel ( GeometricField< Type, PatchField, GeoMesh > & field1,
GeometricField< Type, PatchField, GeoMesh > & field2,
List< label > * labels = NULL )

Computes the relative error between two Fields in the Frobenius norm.

Parameters
field1The reference field to which the norm is computed
field2The field for which the error is computed
labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
TypeType of field, can be scalar or vector
PatchFieldType of PatchField, surface or volumetric
GeoMeshType of Mesh, surface or volumetric
Returns
Frobenius norm of the relative error.

Definition at line 41 of file ITHACAerror.C.

◆ errorFrobRel() [2/2]

template<class T, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd ITHACAutilities::errorFrobRel ( PtrList< GeometricField< T, PatchField, GeoMesh > > & fields1,
PtrList< GeometricField< T, PatchField, GeoMesh > > & fields2,
List< label > * labels = NULL )

Computes the relative error in the Frobenius norm between two lists of fields.

Parameters
[in]field1The reference field to which the norm is computed
[in]field2The field for which the error is computed
[in]labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
Ttype of field
Returns
Column vector, in each row the Frobenius norm of the relative error.

Definition at line 234 of file ITHACAerror.C.

◆ errorL2Abs() [1/6]

template<>
double ITHACAutilities::errorL2Abs ( GeometricField< scalar, fvPatchField, volMesh > & field1,
GeometricField< scalar, fvPatchField, volMesh > & field2,
volScalarField & Volumes )

Definition at line 175 of file ITHACAerror.C.

◆ errorL2Abs() [2/6]

template<typename T>
double ITHACAutilities::errorL2Abs ( GeometricField< T, fvPatchField, volMesh > & field1,
GeometricField< T, fvPatchField, volMesh > & field2,
List< label > * labels = NULL )

Computes the absolute error between two Fields in L2 norm.

Parameters
[in]field1The reference field to which the norm is computed
[in]field2The field for which the error is computed
[in]labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
Ttype of field
Returns
L2 norm of the absolute error.

Definition at line 186 of file ITHACAerror.C.

◆ errorL2Abs() [3/6]

template<typename T>
double ITHACAutilities::errorL2Abs ( GeometricField< T, fvPatchField, volMesh > & field1,
GeometricField< T, fvPatchField, volMesh > & field2,
volScalarField & Volumes )

Computes the absolute error between two geometric Fields in L2 norm, given the mesh volumes field.

Parameters
[in]field1The reference field to which the norm is computed
[in]field2The field for which the error is computed
[in]labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
Ttype of field
Returns
L2 norm of the absolute error.

◆ errorL2Abs() [4/6]

template<>
double ITHACAutilities::errorL2Abs ( GeometricField< vector, fvPatchField, volMesh > & field1,
GeometricField< vector, fvPatchField, volMesh > & field2,
volScalarField & Volumes )

Definition at line 164 of file ITHACAerror.C.

◆ errorL2Abs() [5/6]

template<typename T>
Eigen::MatrixXd ITHACAutilities::errorL2Abs ( PtrList< GeometricField< T, fvPatchField, volMesh > > & fields1,
PtrList< GeometricField< T, fvPatchField, volMesh > > & fields2,
List< label > * labels = NULL )

Computes the absolute error in L2 norm between two lists of Fields.

Parameters
[in]field1The reference field to which the norm is computed
[in]field2The field for which the error is computed
[in]labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
Ttype of field
Returns
column vector, in each row the L2 norm of the absolute error.

Definition at line 303 of file ITHACAerror.C.

◆ errorL2Abs() [6/6]

template<typename T>
Eigen::MatrixXd ITHACAutilities::errorL2Abs ( PtrList< GeometricField< T, fvPatchField, volMesh > > & fields1,
PtrList< GeometricField< T, fvPatchField, volMesh > > & fields2,
PtrList< volScalarField > & Volumes )

Computes the relative error in L2 norm between two lists of Fields given the list of mesh volumes fields.

Parameters
[in]fields1The fields 1, scalar or vector
[in]fields2The fields 2, scalar or vector
[in]VolumesThe list of the mesh volumes fields
Template Parameters
TypeFieldtype of field
Returns
Column vector, in each row the L2 norm of the error.

Definition at line 272 of file ITHACAerror.C.

◆ errorL2Rel() [1/2]

template<typename T>
double ITHACAutilities::errorL2Rel ( GeometricField< T, fvPatchField, volMesh > & field1,
GeometricField< T, fvPatchField, volMesh > & field2,
List< label > * labels = NULL )

Computes the relative error between two geometric Fields in L2 norm.

Parameters
[in]field1The reference field to which the norm is computed
[in]field2The field for which the error is computed
[in]labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
Ttype of field
Returns
L2 norm of the relative error.

Definition at line 337 of file ITHACAerror.C.

◆ errorL2Rel() [2/2]

template<typename T>
Eigen::MatrixXd ITHACAutilities::errorL2Rel ( PtrList< GeometricField< T, fvPatchField, volMesh > > & fields1,
PtrList< GeometricField< T, fvPatchField, volMesh > > & fields2,
List< label > * labels = NULL )

Computes the relative error in L2 norm between two lists of fields.

Parameters
[in]field1The reference field to which the norm is computed
[in]field2The field for which the error is computed
[in]labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
Ttype of field
Returns
Column vector, in each row the L2 norm of the relative error.

Definition at line 395 of file ITHACAerror.C.

◆ errorLinfRel()

template<typename T>
double ITHACAutilities::errorLinfRel ( GeometricField< T, fvPatchField, volMesh > & field1,
GeometricField< T, fvPatchField, volMesh > & field2,
List< label > * labels = NULL )

Computes the relative error between two geometric Fields in Linf norm.

Parameters
[in]field1The reference field to which the norm is computed
[in]field2The field for which the error is computed
[in]labels(optional) a list of labels with the indices were you want to compute the error
Template Parameters
Ttype of field
Returns
Linf norm of the relative error.

Definition at line 106 of file ITHACAerror.C.

◆ extractIntFromString()

std::vector< int > ITHACAutilities::extractIntFromString ( std::string input)

Returns an array storing all the integers in the input string.

Parameters
inputstring

Definition at line 88 of file ITHACAstring.C.

◆ frobNorm()

template<class Type, template< class > class PatchField, class GeoMesh>
double ITHACAutilities::frobNorm ( GeometricField< Type, PatchField, GeoMesh > & field)

Evaluate the Frobenius norm of a field.

Parameters
[in]fieldThe field.
Template Parameters
TType of field, scalar or vector
Returns
Frobenius norm of the field.

Definition at line 355 of file ITHACAnorm.C.

◆ getCoeffs() [1/2]

template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::VectorXd ITHACAutilities::getCoeffs ( GeometricField< Type, PatchField, GeoMesh > & snapshot,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & modes,
label Nmodes = 0,
bool consider_volumes = true )

Projects a snapshot on a basis function and gets the coefficients of the projection.

Parameters
[in]snapshotThe snapshot.
[in]modesThe modes.
[in]NmodesThe number of modes
[in]consider_volumesConsider volumes or not, in not equals Frobenius Projection
Template Parameters
Typevector or scalar.
PatchFieldfvPatchField or fvsPatchField.
GeoMeshvolMesh or surfaceMesh.
Returns
The coefficients of the projection.

Definition at line 349 of file ITHACAcoeffsMass.C.

◆ getCoeffs() [2/2]

template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd ITHACAutilities::getCoeffs ( PtrList< GeometricField< Type, PatchField, GeoMesh > > & snapshot,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & modes,
label Nmodes = 0,
bool consider_volumes = true )

Projects snapshots on a basis function and gets the coefficients of the projection.

Parameters
[in]snapshotThe snapshots.
[in]modesThe modes.
[in]NmodesThe number of modes you want to use
[in]consider_volumesThe consider volumes (if not equals Frobenius Projection)
Template Parameters
Typevector or scalar.
PatchFieldfvPatchField or fvsPatchField.
GeoMeshvolMesh or surfaceMesh.
Returns
The coefficients of the projection.

Definition at line 418 of file ITHACAcoeffsMass.C.

◆ getIndices() [1/2]

List< label > ITHACAutilities::getIndices ( const fvMesh & mesh,
int index,
int layers )

Gets the indices of the cells around a certain cell.

Parameters
meshThe mesh
[in]indexThe index of the considered cell
[in]layersThe number of layers to be considered
Returns
The indices.

Definition at line 62 of file ITHACAgeometry.C.

◆ getIndices() [2/2]

List< label > ITHACAutilities::getIndices ( const fvMesh & mesh,
int index_row,
int index_col,
int layers )

Gets the indices of the cells around a certain cell.

Parameters
meshThe mesh
[in]index_rowThe index of the considered cell
[in]index_colThe index of the considered cell
[in]layersThe number of layers to be considered
Returns
The indices.

Definition at line 88 of file ITHACAgeometry.C.

◆ getIndicesFromBox() [1/2]

labelList ITHACAutilities::getIndicesFromBox ( const fvMesh & mesh,
List< label > indices,
Eigen::MatrixXd Box,
List< vector > & points2Move )

Gives the indices conteined into a defined box.

Parameters
[in]meshThe mesh
[in]indicesThe list where indices have to be stored
[in]BoxThe box defined by two opposite points
[in]points2MoveThe list containing the coordines of the points into the box
Returns
the labels list of the points

Definition at line 31 of file ITHACAgeometry.C.

◆ getIndicesFromBox() [2/2]

template<typename type_f>
List< label > ITHACAutilities::getIndicesFromBox ( GeometricField< type_f, fvPatchField, volMesh > & field,
Eigen::MatrixXd Box )

Gets the indices from coordinates of a given box.

Parameters
fieldA geometric Field from OpenFoam field
[in]BoxThe box
Template Parameters
type_ftype of the Field can be Scalar or Vector
Returns
The indices from box.

Definition at line 347 of file ITHACAgeometry.C.

◆ getIndicesFromDisc()

List< label > ITHACAutilities::getIndicesFromDisc ( const fvMesh & mesh,
double radius,
vector origin,
vector axis,
List< double > & radii )

Gets the indices of the points which are inside a disc of a specified radius before carrying out a rotation around an axis.

Parameters
meshThe mesh for which you want to find the indices of the points inside a disc
[in]radiusThe radius of the disc
[in]originThe origin of the disc
[in]axisThe axis of the rotation
radiiThe distances of the points lying inside the disc to the origin
Returns
The indices of the points lying inside the specified the disc.

Definition at line 316 of file ITHACAgeometry.C.

◆ getMassMatrix() [1/3]

template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd ITHACAutilities::getMassMatrix ( PtrList< GeometricField< Type, PatchField, GeoMesh > > & fields,
label nModes = 0,
bool consider_volumes = true )

Gets the mass matrix using the eigen routine.

Parameters
[in]fieldsThe openFoam fields
[in]consider_volumesTrue if you want to consider the volumes
Template Parameters
Typevector or scalar.
PatchFieldfvPatchField or fvsPatchField.
GeoMeshvolMesh or surfaceMesh.
Returns
The mass matrix eigen.

Definition at line 68 of file ITHACAcoeffsMass.C.

◆ getMassMatrix() [2/3]

template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd ITHACAutilities::getMassMatrix ( PtrList< GeometricField< Type, PatchField, GeoMesh > > & fields,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & fields2,
Eigen::VectorXd weights,
label Nmodes = 0,
bool consider_volumes = true )

Gets the cross mass matrix using the eigen routine.

Parameters
[in]fieldsThe openFoam fields
[in]fields2The second openFoam fields
[in]weightsWeights
[in]consider_volumesTrue if you want to consider the volumes
Template Parameters
Typevector or scalar.
PatchFieldfvPatchField or fvsPatchField.
GeoMeshvolMesh or surfaceMesh.
Returns
The cross mass matrix eigen.

Definition at line 222 of file ITHACAcoeffsMass.C.

◆ getMassMatrix() [3/3]

template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::MatrixXd ITHACAutilities::getMassMatrix ( PtrList< GeometricField< Type, PatchField, GeoMesh > > & fields,
PtrList< GeometricField< Type, PatchField, GeoMesh > > & fields2,
label nModes = 0,
bool consider_volumes = true )

Gets the cross mass matrix using the eigen routine.

Parameters
[in]fieldsThe openFoam fields
[in]consider_volumesTrue if you want to consider the volumes
Template Parameters
Typevector or scalar.
PatchFieldfvPatchField or fvsPatchField.
GeoMeshvolMesh or surfaceMesh.
Returns
The cross mass matrix eigen.

Definition at line 138 of file ITHACAcoeffsMass.C.

◆ getMassMatrixFV()

template<class Type, template< class > class PatchField, class GeoMesh>
Eigen::VectorXd ITHACAutilities::getMassMatrixFV ( GeometricField< Type, PatchField, GeoMesh > & snapshot)

Gets a vector containing the volumes of each cell of the mesh.

Parameters
[in]snapshotA snapshot, scalar or vector field.
Template Parameters
Typevector or scalar.
PatchFieldfvPatchField or fvsPatchField.
GeoMeshvolMesh or surfaceMesh.
Returns
The FV mass matrix in Eigen::MatrixXd form.

Definition at line 313 of file ITHACAcoeffsMass.C.

◆ getPointsFromPatch()

void ITHACAutilities::getPointsFromPatch ( fvMesh & mesh,
label ind,
List< vector > & points,
labelList & indices )

Get the polabel coordinates and indices from patch.

Parameters
[in]meshThe mesh
[in]indThe index of the patch from which you want to extract the points
[out]pointsThe coordinates of the points on the patch
[out]indicesThe indices of the points on the patch

Definition at line 116 of file ITHACAgeometry.C.

◆ getSubMeshFromBox()

template<typename type_f>
fvMeshSubset * ITHACAutilities::getSubMeshFromBox ( GeometricField< type_f, fvPatchField, volMesh > & field,
Eigen::MatrixXd Box )

Gets a subMesh from a box of coordinates and a given field (used only for the mesh).

Parameters
fieldThe field passed
[in]BoxThe box of coordinates 3*2 matrix
Template Parameters
type_ftype of the Field can be Scalar or Vector
Returns
The subMesh from the box. It can later used to interpolate any Field

Definition at line 380 of file ITHACAgeometry.C.

◆ getValues() [1/6]

template<>
Eigen::MatrixXd ITHACAutilities::getValues ( GeometricField< scalar, fvPatchField, volMesh > & field,
labelList & indices,
labelList * xyz )

Definition at line 346 of file ITHACAfieldsOperations.C.

◆ getValues() [2/6]

template<typename Type>
Eigen::MatrixXd ITHACAutilities::getValues ( GeometricField< Type, fvPatchField, volMesh > & field,
labelList & indices )

Definition at line 294 of file ITHACAfieldsOperations.C.

◆ getValues() [3/6]

template<typename Type>
Eigen::MatrixXd ITHACAutilities::getValues ( GeometricField< Type, fvPatchField, volMesh > & field,
labelList & indices,
labelList * xyz = NULL )

///

Gets the values from a list of indices

Parameters
fieldThe field from which you want to extract the values
indicesThe indices at the point
xyzDefinition of the x, y, z coordinate of the value you want to extract 0 for x, 1 for y, 2 for z
Template Parameters
Typetype of the Field can be Scalar or Vector
Returns
The values.

◆ getValues() [4/6]

template<>
Eigen::MatrixXd ITHACAutilities::getValues ( GeometricField< vector, fvPatchField, volMesh > & field,
labelList & indices,
labelList * xyz )

Definition at line 310 of file ITHACAfieldsOperations.C.

◆ getValues() [5/6]

template<typename T>
Eigen::MatrixXd ITHACAutilities::getValues ( PtrList< GeometricField< T, fvPatchField, volMesh > > & fields,
labelList & indices,
labelList * xyz )

Definition at line 363 of file ITHACAfieldsOperations.C.

◆ getValues() [6/6]

template<typename Type>
Eigen::MatrixXd ITHACAutilities::getValues ( PtrList< GeometricField< Type, fvPatchField, volMesh > > & field,
labelList & indices,
labelList * xyz = NULL )

Gets the values from a list of indices.

Parameters
fieldThe field
indicesThe indices
xyzThe xyz
Template Parameters
Type{ description }
Returns
The values.

◆ H1Seminorm() [1/3]

template<>
double ITHACAutilities::H1Seminorm ( GeometricField< scalar, fvPatchField, volMesh > & field)

Definition at line 337 of file ITHACAnorm.C.

◆ H1Seminorm() [2/3]

template<class T>
double ITHACAutilities::H1Seminorm ( GeometricField< T, fvPatchField, volMesh > & field)

Evaluate the H1 seminorm of a geoemtri.

Parameters
[in]fieldThe field.
Template Parameters
TType of field, scalar or vector
Returns
H1 seminorm of the volVectorField.

◆ H1Seminorm() [3/3]

template<>
double ITHACAutilities::H1Seminorm ( GeometricField< vector, fvPatchField, volMesh > & field)

Definition at line 346 of file ITHACAnorm.C.

◆ integralOnPatch() [1/2]

double ITHACAutilities::integralOnPatch ( fvMesh & mesh,
List< scalar > field,
word patch )

Evaluate the integral on a patch.

Parameters
[in]meshThe mesh.
[in]fieldA list of values of the field on the patch.
[in]patchName of the patch.
Returns
Integral of the field on the patch.

Definition at line 452 of file ITHACAnorm.C.

◆ integralOnPatch() [2/2]

double ITHACAutilities::integralOnPatch ( fvMesh & mesh,
volScalarField & field,
word patch )

Evaluate the integral on a patch.

Parameters
[in]meshThe mesh.
[in]fieldThe field.
[in]patchName of the patch.
Returns
Integral of the field on the patch.

Definition at line 432 of file ITHACAnorm.C.

◆ invertMatrix()

Eigen::MatrixXd ITHACAutilities::invertMatrix ( Eigen::MatrixXd & matrixToInvert,
const word inversionMethod )

Invert a matrix given the method name in the ITHACAdict.

Parameters
[in]matrixToInvertMatrix to invert
[in]methodNameMethod
Returns
Inversed matrix

Definition at line 167 of file ITHACAutilities.C.

◆ isInteger()

bool ITHACAutilities::isInteger ( double ratio)

This function checks if ratio is an integer.

Parameters
[in]ratioThe ratio
Returns
1 if ratio is an integer

Definition at line 74 of file ITHACAutilities.C.

◆ isTurbulent()

bool ITHACAutilities::isTurbulent ( )

This function checks if the case is turbulent.

Returns
1 if the case is turbulent

Definition at line 90 of file ITHACAutilities.C.

◆ L2Norm()

template<typename T>
double ITHACAutilities::L2Norm ( const T v)

Compute the L2 norm of v.

Template Parameters
Ttype of v, vol[Scalar|Vector|Tensor]Field
Parameters
vfield of type T
Returns
Norm of v

Definition at line 300 of file ITHACAnorm.C.

◆ L2normOnPatch()

double ITHACAutilities::L2normOnPatch ( fvMesh & mesh,
volScalarField & field,
word patch )

Evaluate the L2 norm of a field on a boundary patch.

Parameters
[in]meshThe mesh.
[in]fieldThe field.
[in]patchName of the patch.
Returns
L2 norm of the field on the patch.

Definition at line 366 of file ITHACAnorm.C.

◆ L2productOnPatch()

double ITHACAutilities::L2productOnPatch ( fvMesh & mesh,
List< scalar > & field1,
List< scalar > & field2,
word patch )

Evaluate the L2 inner product between two scalarLists.

Parameters
[in]meshThe mesh.
[in]field1The first field.
[in]field2The second field.
[in]patchName of the patch.
Returns
L2 norm of the field on the patch.

Definition at line 386 of file ITHACAnorm.C.

◆ LinfNorm() [1/3]

template<>
double ITHACAutilities::LinfNorm ( GeometricField< scalar, fvPatchField, volMesh > & field)

Definition at line 318 of file ITHACAnorm.C.

◆ LinfNorm() [2/3]

template<class T>
double ITHACAutilities::LinfNorm ( GeometricField< T, fvPatchField, volMesh > & field)

Evaluate the Linf norm of a geometric field.

Parameters
[in]fieldThe field.
Template Parameters
TType of field, scalar or vector
Returns
Linf norm of the volVectorField.

◆ LinfNorm() [3/3]

template<>
double ITHACAutilities::LinfNorm ( GeometricField< vector, fvPatchField, volMesh > & field)

Definition at line 327 of file ITHACAnorm.C.

◆ LinfNormOnPatch()

double ITHACAutilities::LinfNormOnPatch ( fvMesh & mesh,
volScalarField & field,
word patch )

Evaluate the Linf norm of a field on a boundary patch.

Parameters
[in]meshThe mesh.
[in]fieldThe field.
[in]patchName of the patch.
Returns
Linf norm of the field on the patch.

Definition at line 406 of file ITHACAnorm.C.

◆ meshNonOrtho()

volScalarField ITHACAutilities::meshNonOrtho ( fvMesh & mesh,
volScalarField & NonOrtho )

Returns a scalarField that containes the non-orthogonality value of a given mesh.

Parameters
meshThe mesh for which you want to compute the non-orthogonality value
NonOrthoThe scalarField containing the non-orthogonality
Returns
The scalarField containing the non-orthogonality

Definition at line 400 of file ITHACAgeometry.C.

◆ multField() [1/3]

template<typename T>
void ITHACAutilities::multField ( PtrList< T > & f1,
const Eigen::VectorXd alphaVec )

Multiplication between a list of field of type vol[Scalar|Vector|Tensor]Field.

Parameters
f1PtrList of field
f2vector filled with double

Definition at line 88 of file ITHACAfieldsOperations.C.

◆ multField() [2/3]

template<typename T>
void ITHACAutilities::multField ( T & f1,
const Eigen::VectorXd alphaVec )

Multiplication between field of type vol[Scalar|Vector|Tensor]Field and a vector.

Parameters
f1field
alphaVecvector filled with double

Definition at line 69 of file ITHACAfieldsOperations.C.

◆ multField() [3/3]

template<typename T>
void ITHACAutilities::multField ( T & f1,
double alpha )

Multiplication between a field of type vol[Scalar|Vector|Tensor]Field and a double.

Parameters
f1field
alphadouble value

Definition at line 41 of file ITHACAfieldsOperations.C.

◆ norm_L2wBC()

template<typename T>
double ITHACAutilities::norm_L2wBC ( const T & v,
const double & weightBC,
const word & patchBC = "inlet" )

Compute the norm using the L2 dot product of v at the boundaries.

Template Parameters
Ttype of v & w, can be vol[Scalar|Vector|Tensor]Field
Parameters
vfield of type T
wfield of type T
weightBCset the weight of the dot product at the boundary
patchBCselect which boundary patch to apply the dot product on pathBC
Returns
result of the dot product

Definition at line 281 of file ITHACAnorm.C.

◆ norm_POD()

template<typename T>
double ITHACAutilities::norm_POD ( const T & v,
const word & hilbertSpacePOD,
const double & weightBC = 0.,
const word & patchBC = "inlet",
const double & weightH1 = 1.0 )

Compute the norm of v.

Template Parameters
Ttype of v, vol[Scalar|Vector]Field
Parameters
vfield of type T
hilbertSpacePODhibert space use to compute the dot product, can be L2, L2wBC, H1, wH1
weightBCin the case of L2wBC, set the weight of the dot product at the boundary
patchBCin the case of L2wBC, select which boundary patch to apply the dot product on pathBC
weightH1coefficient in front of the dot product of the gradient
Returns
Norm of v

Definition at line 291 of file ITHACAnorm.C.

◆ normalizeFields()

template<typename Type>
void ITHACAutilities::normalizeFields ( PtrList< GeometricField< Type, fvPatchField, volMesh > > & fields)

Normalize list of Geometric fields.

Parameters
fieldsThe fields to be normalized
Template Parameters
Typetype of the Field can be Scalar or Vector

Definition at line 247 of file ITHACAfieldsOperations.C.

◆ parTimeCombMat()

Eigen::MatrixXd ITHACAutilities::parTimeCombMat ( List< Eigen::VectorXd > acquiredSnapshotsTimes,
Eigen::MatrixXd parameters )

A method to compute the time-parameter combined matrix whose any single element corresponds to a unique snapshot in the snapshots acquired for the offline stage.

Parameters
[in]acquiredSnapshotsTimesThe time instants at which snapshots are acquired
[in]parametersThe parameters for which the simulations are run ordered with respect to vectors acquiredSnapshotsTimes which contain the corresponding time instants at which we acquired snapshots
Returns
A matrix which has in each row the parameters value and the time instants which correspond to a unique snapshot in the offline folder.

Definition at line 505 of file ITHACAcoeffsMass.C.

◆ pinv_eigen_based()

Eigen::MatrixXd ITHACAutilities::pinv_eigen_based ( Eigen::MatrixXd & origin,
const float er = 0 )

Using the Eigen library, using the SVD decomposition method to solve the matrix pseudo-inverse, the default error er is 0.

Parameters
originMatrix to invert
erError
Returns
Inversed matrix

Definition at line 138 of file ITHACAutilities.C.

◆ project_to_POD_basis() [1/2]

template<typename T>
T ITHACAutilities::project_to_POD_basis ( T & field,
PtrList< T > & modes )

Compute the projection of a field in a POD basis.

Template Parameters
Ttype of field, can be vol[Scalar|Vector|Tensor]Field
Parameters
fieldfield of type T to project
modesPtrList<T> containing the POD modes to project onto
Returns
Projected field

Definition at line 471 of file ITHACAcoeffsMass.C.

◆ project_to_POD_basis() [2/2]

template<typename T>
T ITHACAutilities::project_to_POD_basis ( T & field,
PtrList< T > & modes,
const T & meanField )

Compute the projection of a field in a POD basis.

To project field on their own POD basis because removing the mean to project and adding it after projecting

Template Parameters
Ttype of field, can be vol[Scalar|Vector|Tensor]Field
Parameters
fieldfield of type T to project
modesPtrList<T> containing the POD modes to project onto
meanFieldfield of type T, removed from field before projecting and added back at the end (for projecting a field on its own POD basis)
Returns
Projected field

Definition at line 487 of file ITHACAcoeffsMass.C.

◆ rand() [1/2]

Eigen::MatrixXd ITHACAutilities::rand ( label rows,
Eigen::MatrixXd minMax )

Generates random matrix with random values in an interval.

Parameters
[in]rowsNumber of rows
[in]minMaxThe min and max Matrix, it has as many rows as columns of the output matrix.
Returns
Random matrix

Definition at line 56 of file ITHACAutilities.C.

◆ rand() [2/2]

Eigen::MatrixXd ITHACAutilities::rand ( label rows,
label cols,
double min,
double max )

Generates random matrix with random values in an interval.

Parameters
[in]rowsNumber of rows
[in]colsNumber of cols
[in]minMinimum of the interval
[in]maxMaximum of the interval
Returns
the matrix

Definition at line 44 of file ITHACAutilities.C.

◆ reconstructFromCoeff()

template<class Type, template< class > class PatchField, class GeoMesh>
PtrList< GeometricField< Type, PatchField, GeoMesh > > ITHACAutilities::reconstructFromCoeff ( PtrList< GeometricField< Type, PatchField, GeoMesh > > & modes,
Eigen::MatrixXd & coeff_matrix,
label Nmodes )

Exact reconstruction using a certain number of modes for a list of fields and the projection coefficients.

Parameters
[in]modesThe modes used for reconstruction as PtrList.
[in]NmodesThe number of modes you want to use.
[in]coeff_matrixThe matrix of coefficients.
Template Parameters
Typevector or scalar.
PatchFieldfvPatchField or fvsPatchField.
GeoMeshvolMesh or surfaceMesh.
Returns
rec_field The reconstructed field as PtrList.

Definition at line 31 of file ITHACAcoeffsMass.C.

◆ rotateMesh()

Field< vector > ITHACAutilities::rotateMesh ( fvMesh & mesh,
double r1,
double r2,
vector axis,
double alpha,
labelList movingPointsIDs,
List< double > radii,
word angleVariationMethod = "Linear",
double v = 3 )

A function that rotates the mesh rigidly, by a fixed specified angle for the points lying within a disc of radius r1, and by a an angle which diminishes from the former angle to zero either linearly or following a Sinusoidal relation or Sigmoid function in a disc of radius r2 larger than r1.

Parameters
meshThe mesh which you want to rotate rigidly
[in]r1The inner disc radius
[in]r2The outer disc radius
[in]axisThe axis of rotation
[in]alphaThe angle of rotation in degrees
[in]movingPointsIDsThe list of id's of the points to be rotated
[in]radiiThe distances of the points to be rotated to the origin of the rotation
[in]angleVariationMethodThe angle variation method either Linear or Sinusoidal or Sigmoid functions
[in]vThe tuning parameter in case of using the Sigmoid function
Returns
The vector field of the newly rotated points

Definition at line 224 of file ITHACAgeometry.C.

◆ rotatePoints()

List< vector > ITHACAutilities::rotatePoints ( const List< vector > & originalPoints,
vector AxisOfRotation,
double AngleOfRotation )

Rotate a list of points in clockwise direction given an axis of rotation and an angle in degrees.

Parameters
[in]originalPointsThe original points
[in]CentreOfRotationThe Axis Of Rotation
[in]AngleOfRotationThe angle of rotation in degrees
Returns
The Rotated Points

Definition at line 437 of file ITHACAgeometry.C.

◆ rotationMatrix()

Eigen::MatrixXd ITHACAutilities::rotationMatrix ( vector AxisOfRotation,
double AngleOfRotation )

Functions that return a Rotation Matrix given an axis of rotation and an angle in degrees.

Parameters
[in]AxisOfRotationThe axis of rotation
[in]AngleOfRotationThe angle of rotation in degrees
Returns
The rotation matrix in Eigen format

Definition at line 274 of file ITHACAgeometry.C.

◆ setBoxToValue()

template<typename Type>
void ITHACAutilities::setBoxToValue ( GeometricField< Type, fvPatchField, volMesh > & field,
Eigen::MatrixXd Box,
Type value )

Set value of a volScalarField to a constant inside a given box.

the Box must be defined with a 2*3 Eigen::MatrixXd in the following way

\[ Box=\begin{bmatrix} x_1 & y_1 & z_1 \ \ \ x_2 & y_2 & z_2 \ \ \end{bmatrix} \]

where \( x_1, y_1, z_1 \) and \( x_2, y_2, z_2 \) are the coordinates of the two corners defining the box.

Parameters
[in]fieldThe field.
[in]BoxThe box.
[in]valueThe value you want to give to the volScalarField
Template Parameters
TypeType of field can be scalar or vector

Definition at line 683 of file ITHACAassign.C.

◆ setIndices2Value()

template<typename Type>
void ITHACAutilities::setIndices2Value ( labelList & ind2set,
List< Type > & value2set,
labelList & movingIDS,
List< Type > & originalList )

Sets some given Indices of a list of objects to given values.

Parameters
ind2setThe indices of the list that you want to assign
value2setThe values you want to set
movingIDSThe index of the list in the original list that you want to assign
originalListThe original list
Template Parameters
TypeType of list (scalar or vector)

Definition at line 730 of file ITHACAassign.C.

◆ setToZero()

template<typename T>
void ITHACAutilities::setToZero ( T & f1)

Set a field of type vol[Scalar|Vector|Tensor]Field to 0.

Parameters
f1field to set to 0

Definition at line 809 of file ITHACAassign.C.

◆ str_format_io()

void ITHACAutilities::str_format_io ( std::string const & s,
unsigned int Nmax )

Format a string.

Parameters
sstring
Nmaxmax length of the string

Definition at line 49 of file ITHACAstring.C.

◆ str_trim()

std::string ITHACAutilities::str_trim ( std::string const & s)

Trim a string cf.

https://stackoverflow.com/questions/25829143/trim-whitespace-from-a-string

Parameters
Strings

Definition at line 40 of file ITHACAstring.C.

◆ subtractFields()

template<typename T>
void ITHACAutilities::subtractFields ( T & f1,
const T & f2 )

Perform the substraction (f1 - f2) between two fields of type vol[Scalar|Vector|Tensor]Field and alpha a double.

Parameters
f1field
f2field

Definition at line 143 of file ITHACAfieldsOperations.C.

◆ tensorFieldProduct() [1/2]

volTensorField ITHACAutilities::tensorFieldProduct ( const volScalarField & coef,
const volTensorField & S )

Tensor field product between a volScalarField and a volTensorField.

Parameters
coeffield
f1field

Definition at line 152 of file ITHACAfieldsOperations.C.

◆ tensorFieldProduct() [2/2]

volTensorField ITHACAutilities::tensorFieldProduct ( const volTensorField & coef,
const volTensorField & S )

Tensor field product between two volTensorFields.

Parameters
coeffield
Sfield

Definition at line 157 of file ITHACAfieldsOperations.C.