2Info <<
"*********************************************************" << endl;
3Info <<
"Performing test for the CG inverse solver" << endl;
4Info <<
"Changint the position of the thermocouples on y" << endl;
6word outputFolder =
"./ITHACAoutput/thermocouplesLocationTest_CG/";
7volScalarField gTrueField = example_CG.list2Field(example_paramBC.gTrue);
11example_CG.saveSolInLists = 1;
15Eigen::VectorXd TCplane_Y = Eigen::VectorXd::LinSpaced(testSize, 0.1, 0.9);
19for (
int i = 0;
i < testSize;
i++)
21 Info <<
"\n**************************************************** " << endl;
22 Info <<
"\nTest " <<
i << endl;
23 Info <<
"\n**************************************************** " << endl;
24 forAll(example_CG.thermocouplesPos, TCi)
26 example_CG.thermocouplesPos[TCi][1] = TCplane_Y(
i);
30 if ( remove(
"./thermocouplesCellsID_mat.txt" ) != 0 )
32 perror(
"\nError deleting thermocouples file\n" );
36 puts(
"\nThermocouples file successfully deleted\n" );
39 example_CG.thermocouplesRead = 0;
40 example_CG.readThermocouples();
41 example_CG.Tmeas = example_CG.fieldValueAtThermocouples(T_true);
43 if (example_CG.conjugateGradient())
45 Info <<
"\nCG converged" << endl;
47 example_CG.gList[example_CG.gList.size() - 1]);
49 std::to_string(
i + 1), outputFolder,
51 Info <<
"************************************" << endl;
56 Info <<
"CG did not converged" << endl;
57 Info <<
"************************************" << endl;
62example_CG.postProcess(outputFolder,
"g");
65if ( remove(
"./thermocouplesCellsID_mat.txt" ) != 0 )
67 perror(
"\nError deleting thermocouples file\n" );
71 puts(
"\nThermocouples file successfully deleted\n" );
forAll(example_CG.gList, solutionI)
std::cout<< "Duration = "<< duration<< " seconds"<< std::endl;Info<< "CG converged"<< endl;PtrList< volScalarField > heatFluxField
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 ...