Loading...
Searching...
No Matches
parameterizedBCtest_RBFwidth.H File Reference

Go to the source code of this file.

Functions

Info<< endl;Info<< "*********************************************************"<< endl;Info<< "Performing test for the parameterized BC inverse solver"<< endl;Info<< endl;word outputFolder="./ITHACAoutput/parameterizedBCtest_RBFparameter/";volScalarField gTrueField=example_paramBC.list2Field(example_paramBC.gTrue);ITHACAstream::exportSolution(gTrueField, "1", outputFolder, "gTrue");Eigen::VectorXd rbfWidth=EigenFunctions::ExpSpaced(0.001, 100, rbfWidthTest_size);ITHACAstream::exportMatrix(rbfWidth, "rbfShapeParameters", "eigen", outputFolder);Eigen::VectorXd residualNorms;residualNorms.resize(rbfWidthTest_size);Eigen::VectorXd heatFluxL2norm(rbfWidthTest_size);Eigen::VectorXd heatFluxLinfNorm=heatFluxL2norm;Eigen::VectorXd condNumber=heatFluxL2norm;Eigen::MatrixXd singVal;for(int i=0;i< rbfWidthTest_size;i++){ Info<< "*********************************************************"<< endl;Info<< "RBF parameter "<< rbfWidth(i)<< endl;Info<< "Test "<< i+1<< endl;Info<< endl;example_paramBC.set_gParametrized("rbf", rbfWidth(i));example_paramBC.parameterizedBCoffline(1);example_paramBC.parameterizedBC("fullPivLU");volScalarField gParametrizedField=example_paramBC.list2Field(example_paramBC.g);ITHACAstream::exportSolution(gParametrizedField, std::to_string(i+1), outputFolder, "gParametrized");volScalarField &T(example_paramBC._T());ITHACAstream::exportSolution(T, std::to_string(i+1), outputFolder, "T");residualNorms(i)=Foam::sqrt(example_paramBC.residual.squaredNorm());Eigen::MatrixXd A=example_paramBC.Theta.transpose() *example_paramBC.Theta;Eigen::JacobiSVD< Eigen::MatrixXd > svd (A, Eigen::ComputeThinU|Eigen::ComputeThinV)
 
singVal conservativeResize (singularValues.rows(), singVal.cols()+1)
 
singVal col (i)
 
 if (singularValues.minCoeff() > 0)
 

Variables

Eigen::MatrixXd singularValues = svd.singularValues()
 
double conditionNumber
 
 else
 

Function Documentation

◆ col()

singVal col ( i )

◆ conservativeResize()

singVal conservativeResize ( singularValues. rows(),
singVal.cols()+ 1 )

◆ if()

if ( singularValues. minCoeff(),
0  )

Definition at line 53 of file parameterizedBCtest_RBFwidth.H.

◆ svd()

Info<< endl;Info<< "*********************************************************"<< endl;Info<< "Performing test for the parameterized BC inverse solver"<< endl;Info<< endl;word outputFolder="./ITHACAoutput/parameterizedBCtest_RBFparameter/";volScalarField gTrueField=example_paramBC.list2Field(example_paramBC.gTrue);ITHACAstream::exportSolution(gTrueField, "1", outputFolder, "gTrue");Eigen::VectorXd rbfWidth=EigenFunctions::ExpSpaced(0.001, 100, rbfWidthTest_size);ITHACAstream::exportMatrix(rbfWidth, "rbfShapeParameters", "eigen", outputFolder);Eigen::VectorXd residualNorms;residualNorms.resize(rbfWidthTest_size);Eigen::VectorXd heatFluxL2norm(rbfWidthTest_size);Eigen::VectorXd heatFluxLinfNorm=heatFluxL2norm;Eigen::VectorXd condNumber=heatFluxL2norm;Eigen::MatrixXd singVal;for(int i=0;i< rbfWidthTest_size;i++){ Info<< "*********************************************************"<< endl; Info<< "RBF parameter "<< rbfWidth(i)<< endl; Info<< "Test "<< i+1<< endl; Info<< endl; example_paramBC.set_gParametrized("rbf", rbfWidth(i)); example_paramBC.parameterizedBCoffline(1); example_paramBC.parameterizedBC("fullPivLU"); volScalarField gParametrizedField=example_paramBC.list2Field( example_paramBC.g); ITHACAstream::exportSolution(gParametrizedField, std::to_string(i+1), outputFolder, "gParametrized"); volScalarField &T(example_paramBC._T()); ITHACAstream::exportSolution(T, std::to_string(i+1), outputFolder, "T"); residualNorms(i)=Foam::sqrt( example_paramBC.residual.squaredNorm()); Eigen::MatrixXd A=example_paramBC.Theta.transpose() *example_paramBC.Theta; Eigen::JacobiSVD< Eigen::MatrixXd > svd ( A ,
Eigen::ComputeThinU|Eigen::ComputeThinV  )

Variable Documentation

◆ conditionNumber

double conditionNumber

Definition at line 51 of file parameterizedBCtest_RBFwidth.H.

◆ else

else
Initial value:
{
conditionNumber = DBL_MAX
double conditionNumber

Definition at line 57 of file parameterizedBCtest_RBFwidth.H.

◆ singularValues

Eigen::MatrixXd singularValues = svd.singularValues()

Definition at line 48 of file parameterizedBCtest_RBFwidth.H.