Loading...
Searching...
No Matches
EnKF_1DinverseHeatTransfer Class Reference

Class where the UQ tutorial number 2 is implemented. More...

#include <02enKF_1DinverseHeatTransfer.H>

Inheritance diagram for EnKF_1DinverseHeatTransfer:
laplacianProblem reductionProblem

Public Member Functions

 EnKF_1DinverseHeatTransfer (int argc, char *argv[], int Nseeds_)
 
double updateBC (bool reconstruction=0)
 Updates the boundary conditions according to runTime.
 
void resetSamplingCounters ()
 Set all the sampling counters to 0.
 
Eigen::VectorXd observe (volScalarField field)
 Returns the input field values at the measurement points defined in the measurementsDict.
 
Eigen::MatrixXd solve (volScalarField &T, word outputFolder, word outputFieldName, bool reconstruction=0)
 Solve the heat transfer problem.
 
void solveDirect ()
 Preforming a true solution.
 
void reconstruct ()
 Reconstruction phase.
 
Eigen::MatrixXd forecastStep (double startTime_, int startIndex_, double endTime_)
 Forecasting step.
 
void assignIF (volScalarField &field_, Eigen::VectorXd internalField_)
 Assign internalField given an Eigen Vector.
 
Eigen::VectorXd sampleField (volScalarField field_, Foam::vector probeLocation_)
 Samples a field in a given point.
 
void restart ()
 Restart before a now solution.
 
void resetRunTime (double startTime_, int startIndex_, double endTime_)
 Reset runTime to given values.
 
void priorSetup (double mean, double cov)
 Setup of the prior distribution.
 
void priorSampling ()
 Samples the prior density.
 
void modelErrorSetup (double mean, double cov)
 Setup of the model error distribution.
 
void measNoiseSetup (double mean, double cov)
 Setup of the measurement noise distribution.
 
- Public Member Functions inherited from laplacianProblem
 laplacianProblem ()
 
 laplacianProblem (int argc, char *argv[])
 Construct with argc and argv.
 
 ~laplacianProblem ()
 
void truthSolve (List< scalar > mu_now, word folder="./ITHACAoutput/Offline/")
 Perform a truthsolve.
 
void project (label Nmodes)
 Perform a projection onto the POD modes.
 
- Public Member Functions inherited from reductionProblem
 reductionProblem ()
 Construct Null.
 
 ~reductionProblem ()
 
void setParameters ()
 Set Parameters Problems.
 
void genRandPar ()
 Generate Random Numbers.
 
void genRandPar (label tsize)
 Generate Random Numbers given the dimension of the training set.
 
void genEquiPar ()
 Generate Equidistributed Numbers.
 
void truthSolve ()
 Perform a TruthSolve.
 
void assignBC (volVectorField &s, label BC_ind, Vector< double > &value)
 Assign Boundary Condition to a volVectorField.
 
void assignBC (volScalarField &s, label BC_ind, double &value)
 Assign Boundary Condition to a volScalarField.
 
void reconstructFromMatrix (PtrList< volVectorField > &rec_field2, PtrList< volVectorField > &modes, label Nmodes, Eigen::MatrixXd coeff_matrix)
 Exact reconstruction using a certain number of modes for vector list of fields and the projection coefficients (volVectorField)
 
void reconstructFromMatrix (PtrList< volScalarField > &rec_field2, PtrList< volScalarField > &modes, label Nmodes, Eigen::MatrixXd coeff_matrix)
 Exact reconstruction using a certain number of modes for vector list of fields and the projection coefficients (volScalarField)
 
template<typename T , typename G >
void assignIF (T &s, G &value)
 Assign internal field condition.
 
template<typename T >
void computeLift (T &Lfield, T &liftfield, T &omfield)
 Homogenize the snapshot matrix, it works with PtrList of volVectorField and volScalarField.
 
template<typename T >
void computeLiftT (T &Lfield, T &liftfield, T &omfield)
 Virtual function to compute the lifting function.
 
void liftSolve ()
 Virtual function to compute the lifting function for scalar field.
 
void liftSolveT ()
 
void project ()
 General projection operation.
 
void writeMu (List< scalar > mu_now)
 Write out a list of scalar corresponding to the parameters used in the truthSolve.
 
std::vector< SPLINTER::RBFSpline > getCoeffManifoldRBF (PtrList< volVectorField > snapshots, PtrList< volVectorField > &modes, word rbfBasis="GAUSSIAN")
 Constructs the parameters-coefficients manifold for vector fields, based on RBF-spline model.
 
std::vector< SPLINTER::RBFSpline > getCoeffManifoldRBF (PtrList< volScalarField > snapshots, PtrList< volScalarField > &modes, word rbfBasis="GAUSSIAN")
 Constructs the parameters-coefficients manifold for scalar fields, based on RBF-spline model.
 
std::vector< SPLINTER::BSpline > getCoeffManifoldSPL (PtrList< volVectorField > snapshots, PtrList< volVectorField > &modes, label splDeg=3)
 Constructs the parameters-coefficients manifold for vector fields, based on the B-spline model.
 
std::vector< SPLINTER::BSpline > getCoeffManifoldSPL (PtrList< volScalarField > snapshots, PtrList< volScalarField > &modes, label splDeg=3)
 Constructs the parameters-coefficients manifold for scalar fields, based on the B-spline model.
 

Public Attributes

autoPtr< simpleControl > _simple
 [tutorial02]
 
autoPtr< fv::options > _fvOptions
 
double k
 Diffusivity.
 
double rho
 Density.
 
double Cp
 Heat capacity.
 
label left_ind
 Index of the left patch.
 
Eigen::MatrixXd measurements
 
int NtimeStepsBetweenSamps = 3
 Number of timesteps between each sampling.
 
int Nseeds
 Number of seeds in the ensemble.
 
PtrList< volScalarField > Tensemble
 Ensemble.
 
PtrList< volScalarField > Tmean
 Mean field of the ensemble.
 
int stateSize
 
std::shared_ptr< muq::Modeling::Gaussian > priorDensity
 
std::shared_ptr< muq::Modeling::Gaussian > modelErrorDensity
 
std::shared_ptr< muq::Modeling::Gaussian > measNoiseDensity
 
double meas_cov
 
Eigen::MatrixXd priorSamples
 
Eigen::MatrixXd posteriorSamples
 
double startTime
 
double deltaTime
 
double endTime
 
int Ntimes
 
Eigen::VectorXd timeVector
 Timesteps vector.
 
int Nprobes = 1
 Number of probes.
 
Foam::vector probePosition = Foam::vector(0.5, 0.1, 0.005)
 Probles position, probes are used only for visualization and postprocessing.
 
Eigen::MatrixXd probe_true
 
Eigen::MatrixXd probe_mean
 
Eigen::MatrixXd probe_MaxConfidence
 
Eigen::MatrixXd probe_minConfidence
 
int samplingTimeI = 0
 
int sampleI = 0
 
int sampleFlag = 0
 
- Public Attributes inherited from laplacianProblem
PtrList< volScalarField > Tfield
 List of snapshots for the solution.
 
PtrList< volScalarField > Tonline
 List of snapshots for the solution.
 
volScalarModes Tmodes
 List of POD modes.
 
PtrList< fvScalarMatrix > operator_list
 List of operators.
 
List< scalar > theta
 Theta (coefficients of the affine expansion)
 
PtrList< volScalarField > nu_list
 Nu (diffusivity)
 
label NTmodes
 Number of modes reduced problem.
 
List< Eigen::MatrixXd > A_matrices
 A matrices.
 
Eigen::MatrixXd source
 Source vector.
 
autoPtr< volScalarField > _T
 Temperature field.
 
autoPtr< volScalarField > _S
 Source Term.
 
autoPtr< volScalarField > _nu
 Diffusivity.
 
autoPtr< fvMesh > _mesh
 Mesh.
 
autoPtr< Time > _runTime
 Time.
 
- Public Attributes inherited from reductionProblem
label Pnumber
 Number of parameters.
 
label Tnumber
 Dimension of the training set (used only when gerating parameters without input)
 
Eigen::MatrixXd mu
 Row matrix of parameters.
 
Eigen::MatrixXd mu_range
 Range of the parameter spaces.
 
Eigen::MatrixXd mu_samples
 Matrix of parameters to be used for PODI, where each row corresponds to a sample point. In this matrix the time dimension is regarded as a parameter for unsteady problems.
 
double mu_cur
 Current value of the parameter.
 
bool podex
 Boolean variable, it is 1 if the POD has already been computed, else 0.
 
bool offline
 Boolean variable, it is 1 if the Offline phase has already been computed, else 0.
 
IOdictionary * ITHACAdict
 dictionary to store input output infos
 
autoPtr< argList > _args
 argList
 
ITHACAparallelparal
 parallel handling
 
label folderN = 1
 Counter to save intermediate steps in the correct folder, for unsteady and some stationary cases.
 
label counter = 1
 Counter used for the output of the full order solutions.
 
Eigen::MatrixXi inletIndex
 Matrix that contains informations about the inlet boundaries.
 
Eigen::MatrixXi inletPatch
 Matrix that contains informations about the inlet boundaries without specifing the direction Rows = Number of parametrized boundary conditions
Cols = 1
Example:
example.inletIndex.resize(2, 1);
example.inletIndex(0, 0) = 0;
example.inletIndex(1, 0) = 1;
Means that there are two parametrized boundary conditions of which the first row is of patch 0 and the second row of patch 1.
 
Eigen::MatrixXi inletIndexT
 

Detailed Description

Class where the UQ tutorial number 2 is implemented.

It is a child of the laplacianProblem class and some of its functions are overridden to be adapted to the specific case.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 10 of file 02enKF_1DinverseHeatTransfer.H.

Constructor & Destructor Documentation

◆ EnKF_1DinverseHeatTransfer()

EnKF_1DinverseHeatTransfer::EnKF_1DinverseHeatTransfer ( int argc,
char * argv[],
int Nseeds_ )
inlineexplicit

Definition at line 13 of file 02enKF_1DinverseHeatTransfer.H.

Member Function Documentation

◆ assignIF()

void EnKF_1DinverseHeatTransfer::assignIF ( volScalarField & field_,
Eigen::VectorXd internalField_ )
inline

Assign internalField given an Eigen Vector.

Definition at line 388 of file 02enKF_1DinverseHeatTransfer.H.

◆ forecastStep()

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::forecastStep ( double startTime_,
int startIndex_,
double endTime_ )
inline

Forecasting step.

Definition at line 339 of file 02enKF_1DinverseHeatTransfer.H.

◆ measNoiseSetup()

void EnKF_1DinverseHeatTransfer::measNoiseSetup ( double mean,
double cov )
inline

Setup of the measurement noise distribution.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 491 of file 02enKF_1DinverseHeatTransfer.H.

◆ modelErrorSetup()

void EnKF_1DinverseHeatTransfer::modelErrorSetup ( double mean,
double cov )
inline

Setup of the model error distribution.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 479 of file 02enKF_1DinverseHeatTransfer.H.

◆ observe()

Eigen::VectorXd EnKF_1DinverseHeatTransfer::observe ( volScalarField field)
inline

Returns the input field values at the measurement points defined in the measurementsDict.

Definition at line 126 of file 02enKF_1DinverseHeatTransfer.H.

◆ priorSampling()

void EnKF_1DinverseHeatTransfer::priorSampling ( )
inline

Samples the prior density.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 468 of file 02enKF_1DinverseHeatTransfer.H.

◆ priorSetup()

void EnKF_1DinverseHeatTransfer::priorSetup ( double mean,
double cov )
inline

Setup of the prior distribution.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 457 of file 02enKF_1DinverseHeatTransfer.H.

◆ reconstruct()

void EnKF_1DinverseHeatTransfer::reconstruct ( )
inline

Reconstruction phase.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 256 of file 02enKF_1DinverseHeatTransfer.H.

◆ resetRunTime()

void EnKF_1DinverseHeatTransfer::resetRunTime ( double startTime_,
int startIndex_,
double endTime_ )
inline

Reset runTime to given values.

Definition at line 439 of file 02enKF_1DinverseHeatTransfer.H.

◆ resetSamplingCounters()

void EnKF_1DinverseHeatTransfer::resetSamplingCounters ( )
inline

Set all the sampling counters to 0.

Definition at line 118 of file 02enKF_1DinverseHeatTransfer.H.

◆ restart()

void EnKF_1DinverseHeatTransfer::restart ( )
inline

Restart before a now solution.

Definition at line 406 of file 02enKF_1DinverseHeatTransfer.H.

◆ sampleField()

Eigen::VectorXd EnKF_1DinverseHeatTransfer::sampleField ( volScalarField field_,
Foam::vector probeLocation_ )
inline

Samples a field in a given point.

Definition at line 397 of file 02enKF_1DinverseHeatTransfer.H.

◆ solve()

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::solve ( volScalarField & T,
word outputFolder,
word outputFieldName,
bool reconstruction = 0 )
inline

Solve the heat transfer problem.

Definition at line 153 of file 02enKF_1DinverseHeatTransfer.H.

◆ solveDirect()

void EnKF_1DinverseHeatTransfer::solveDirect ( )
inline

Preforming a true solution.

The measurements are obtained as observation of the true solution

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 236 of file 02enKF_1DinverseHeatTransfer.H.

◆ updateBC()

double EnKF_1DinverseHeatTransfer::updateBC ( bool reconstruction = 0)
inline

Updates the boundary conditions according to runTime.

In the reconstruction phase is uses a "wrong" BC model

Definition at line 103 of file 02enKF_1DinverseHeatTransfer.H.

Member Data Documentation

◆ _fvOptions

autoPtr<fv::options> EnKF_1DinverseHeatTransfer::_fvOptions

Definition at line 52 of file 02enKF_1DinverseHeatTransfer.H.

◆ _simple

autoPtr<simpleControl> EnKF_1DinverseHeatTransfer::_simple

[tutorial02]

Definition at line 51 of file 02enKF_1DinverseHeatTransfer.H.

◆ Cp

double EnKF_1DinverseHeatTransfer::Cp

Heat capacity.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 58 of file 02enKF_1DinverseHeatTransfer.H.

◆ deltaTime

double EnKF_1DinverseHeatTransfer::deltaTime

Definition at line 82 of file 02enKF_1DinverseHeatTransfer.H.

◆ endTime

double EnKF_1DinverseHeatTransfer::endTime

Definition at line 83 of file 02enKF_1DinverseHeatTransfer.H.

◆ k

double EnKF_1DinverseHeatTransfer::k

Diffusivity.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 54 of file 02enKF_1DinverseHeatTransfer.H.

◆ left_ind

label EnKF_1DinverseHeatTransfer::left_ind

Index of the left patch.

Definition at line 60 of file 02enKF_1DinverseHeatTransfer.H.

◆ meas_cov

double EnKF_1DinverseHeatTransfer::meas_cov

Definition at line 76 of file 02enKF_1DinverseHeatTransfer.H.

◆ measNoiseDensity

std::shared_ptr<muq::Modeling::Gaussian> EnKF_1DinverseHeatTransfer::measNoiseDensity

Definition at line 75 of file 02enKF_1DinverseHeatTransfer.H.

◆ measurements

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::measurements

Definition at line 61 of file 02enKF_1DinverseHeatTransfer.H.

◆ modelErrorDensity

std::shared_ptr<muq::Modeling::Gaussian> EnKF_1DinverseHeatTransfer::modelErrorDensity

Definition at line 74 of file 02enKF_1DinverseHeatTransfer.H.

◆ Nprobes

int EnKF_1DinverseHeatTransfer::Nprobes = 1

Number of probes.

Definition at line 89 of file 02enKF_1DinverseHeatTransfer.H.

◆ Nseeds

int EnKF_1DinverseHeatTransfer::Nseeds

Number of seeds in the ensemble.

Definition at line 65 of file 02enKF_1DinverseHeatTransfer.H.

◆ Ntimes

int EnKF_1DinverseHeatTransfer::Ntimes

◆ NtimeStepsBetweenSamps

int EnKF_1DinverseHeatTransfer::NtimeStepsBetweenSamps = 3

Number of timesteps between each sampling.

Definition at line 63 of file 02enKF_1DinverseHeatTransfer.H.

◆ posteriorSamples

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::posteriorSamples

Definition at line 79 of file 02enKF_1DinverseHeatTransfer.H.

◆ priorDensity

std::shared_ptr<muq::Modeling::Gaussian> EnKF_1DinverseHeatTransfer::priorDensity

Definition at line 73 of file 02enKF_1DinverseHeatTransfer.H.

◆ priorSamples

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::priorSamples

Definition at line 78 of file 02enKF_1DinverseHeatTransfer.H.

◆ probe_MaxConfidence

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::probe_MaxConfidence

Definition at line 94 of file 02enKF_1DinverseHeatTransfer.H.

◆ probe_mean

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::probe_mean

Definition at line 93 of file 02enKF_1DinverseHeatTransfer.H.

◆ probe_minConfidence

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::probe_minConfidence

Definition at line 95 of file 02enKF_1DinverseHeatTransfer.H.

◆ probe_true

Eigen::MatrixXd EnKF_1DinverseHeatTransfer::probe_true

Definition at line 92 of file 02enKF_1DinverseHeatTransfer.H.

◆ probePosition

Foam::vector EnKF_1DinverseHeatTransfer::probePosition = Foam::vector(0.5, 0.1, 0.005)

Probles position, probes are used only for visualization and postprocessing.

Definition at line 91 of file 02enKF_1DinverseHeatTransfer.H.

◆ rho

double EnKF_1DinverseHeatTransfer::rho

Density.

Examples
02enKF_1DinverseHeatTransfer.C.

Definition at line 56 of file 02enKF_1DinverseHeatTransfer.H.

◆ sampleFlag

int EnKF_1DinverseHeatTransfer::sampleFlag = 0

Definition at line 99 of file 02enKF_1DinverseHeatTransfer.H.

◆ sampleI

int EnKF_1DinverseHeatTransfer::sampleI = 0

Definition at line 98 of file 02enKF_1DinverseHeatTransfer.H.

◆ samplingTimeI

int EnKF_1DinverseHeatTransfer::samplingTimeI = 0

Definition at line 97 of file 02enKF_1DinverseHeatTransfer.H.

◆ startTime

double EnKF_1DinverseHeatTransfer::startTime

Definition at line 81 of file 02enKF_1DinverseHeatTransfer.H.

◆ stateSize

int EnKF_1DinverseHeatTransfer::stateSize

Definition at line 71 of file 02enKF_1DinverseHeatTransfer.H.

◆ Tensemble

PtrList<volScalarField> EnKF_1DinverseHeatTransfer::Tensemble

Ensemble.

Definition at line 68 of file 02enKF_1DinverseHeatTransfer.H.

◆ timeVector

Eigen::VectorXd EnKF_1DinverseHeatTransfer::timeVector

Timesteps vector.

Definition at line 87 of file 02enKF_1DinverseHeatTransfer.H.

◆ Tmean

PtrList<volScalarField> EnKF_1DinverseHeatTransfer::Tmean

Mean field of the ensemble.

Definition at line 70 of file 02enKF_1DinverseHeatTransfer.H.


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