40laplacianProblem::laplacianProblem() {}
42laplacianProblem::laplacianProblem(
int argc,
char* argv[])
44 _args = autoPtr<argList>
46 new argList(argc, argv)
49 if (!
_args->checkRootCase())
51 Foam::FatalError.exit();
54 argList& args =
_args();
55#include "createTime.H"
56#include "createMesh.H"
57#include "createFields.H"
67 volScalarField& T =
_T();
68 volScalarField& S =
_S();
84 for (label i = 0; i < mu_now.size(); i++)
108 volScalarField& S =
_S();
114 for (label j = 0; j < Nmodes; j++)
118 source(j, 0) = fvc::domainIntegrate(
Tmodes[j] * S).value();
121 for (label k = 0; k < Nmodes; k++)
128 if (Pstream::parRun())
130 reduce(
A_matrices[i], sumOp<Eigen::MatrixXd>());
134 if (Pstream::parRun())
136 reduce(
source, sumOp<Eigen::MatrixXd>());
141 "./ITHACAoutput/Matrices/");
143 "./ITHACAoutput/Matrices/");
145 "./ITHACAoutput/Matrices/A_matrices");
PtrList< volScalarField > nu_list
Nu (diffusivity).
List< scalar > theta
Theta (coefficients of the affine expansion).
PtrList< fvScalarMatrix > operator_list
List of operators.
autoPtr< volScalarField > _T
Temperature field.
List< Eigen::MatrixXd > A_matrices
A matrices.
volScalarModes Tmodes
List of POD modes.
Eigen::MatrixXd source
Source vector.
autoPtr< volScalarField > _S
Source Term.
PtrList< volScalarField > Tfield
List of snapshots for the solution.
label NTmodes
Number of modes reduced problem.
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.
Eigen::MatrixXd mu_samples
Matrix of parameters to be used for PODI, where each row corresponds to a sample point....
label counter
Counter used for the output of the full order solutions.
bool offline
Boolean variable, it is 1 if the Offline phase has already been computed, else 0.
Eigen::MatrixXd mu
Row matrix of parameters.
autoPtr< argList > _args
argList
bool podex
Boolean variable, it is 1 if the POD has already been computed, else 0.
void truthSolve()
Perform a TruthSolve.
Header file of the laplacianProblem class.
void exportSolution(GeometricField< Type, PatchField, GeoMesh > &s, fileName subfolder, fileName folder, word fieldName)
Export a field to file in a certain folder and subfolder.
void exportMatrix(Eigen::Matrix< T, -1, dim > &matrix, word Name, word type, word folder)
Export the reduced matrices in numpy (type=python), matlab (type=matlab) and txt (type=eigen) format ...
bool check_pod()
Check if the POD data folder "./ITHACAoutput/POD" exists.
bool check_off()
Check if the offline data folder "./ITHACAoutput/Offline" exists.