Loading...
Searching...
No Matches
CGnoiseTest.H
Go to the documentation of this file.
1Info << endl;
2Info << "*********************************************************" << endl;
3Info << "Testing CG inverse solver with NOISY data" << endl;
4Info << "Performing " << Ntests << " tests." << endl;
5Info << endl;
6word outputFolder = "./ITHACAoutput/CGnoiseTest/";
7volScalarField gTrueField = example_CG.list2Field(example_CG.gTrue);
9 "1", outputFolder,
10 "gTrue");
11example_CG.saveSolInLists = 1;
12Eigen::VectorXd TmeasOrig = example_CG.Tmeas;
13
14for (label i = 0; i < Ntests; i++)
15{
16 Info << "Test " << i << endl;
17 example_CG.addNoise(noiseLevel);
18 Info << "Stopping for J < " << example_CG.Jtol << endl;
19
20 if (example_CG.conjugateGradient())
21 {
22 Info << "CG converged" << endl;
23 volScalarField heatFluxField = example_CG.list2Field(
24 example_CG.gList[example_CG.gList.size() - 1]);
26 std::to_string(i + 1), outputFolder,
27 "g_CG");
28 Info << "************************************" << endl;
29 Info << endl << endl;
30 }
31 else
32 {
33 Info << "CG did not converged" << endl;
34 Info << "************************************" << endl;
35 Info << endl << endl;
36 }
37
38 example_CG.Tmeas = TmeasOrig;
39}
40
41example_CG.postProcess(outputFolder, "g_CG");
42Info << "*********************************************************" << endl;
43Info << endl;
std::cout<< "Duration = "<< duration<< " seconds"<< std::endl;Info<< "CG converged"<< endl;PtrList< volScalarField > heatFluxField
Definition CGtest.H:20
void exportSolution(GeometricField< Type, PatchField, GeoMesh > &s, fileName subfolder, fileName folder, word fieldName)
Export a field to file in a certain folder and subfolder.
label i
Definition pEqn.H:46