2Info <<
"*********************************************************" << endl;
3Info <<
"Performing test for the CG inverse solver" << endl;
5word outputFolder =
"./ITHACAoutput/CGtest/";
6volScalarField gTrueField = example_CG.list2Field(example_CG.gTrue);
10example_CG.saveSolInLists = 1;
11auto t1 = std::chrono::high_resolution_clock::now();
13if (example_CG.conjugateGradient())
15 auto t2 = std::chrono::high_resolution_clock::now();
16 auto duration = std::chrono::duration_cast<std::chrono::microseconds>
17 ( t2 - t1 ).count() / 1e6;
18 std::cout <<
"Duration = " << duration <<
" seconds" << std::endl;
19 Info <<
"CG converged" << endl;
20 PtrList<volScalarField> heatFluxField;
21 forAll(example_CG.gList, solutionI)
23 heatFluxField.append(example_CG.list2Field(
24 example_CG.gList[solutionI]).clone());
26 std::to_string(solutionI + 1), outputFolder,
29 example_CG.postProcess(outputFolder,
"g_CG");
33 Info <<
"CG did not converged" << endl;
36Info <<
"*********************************************************" << endl;
void exportSolution(GeometricField< Type, PatchField, GeoMesh > &s, fileName subfolder, fileName folder, word fieldName)
Export a field to file in a certain folder and subfolder.