Loading...
Searching...
No Matches
CGtest.H
Go to the documentation of this file.
1Info << endl;
2Info << "*********************************************************" << endl;
3Info << "Performing test for the CG inverse solver" << endl;
4Info << endl;
5word outputFolder = "./ITHACAoutput/CGtest/";
6volScalarField gTrueField = example_CG.list2Field(example_CG.gTrue);
8 "1", outputFolder,
9 "gTrue");
10example_CG.saveSolInLists = 1;
11auto t1 = std::chrono::high_resolution_clock::now();
12
13if (example_CG.conjugateGradient())
14{
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)
22 {
23 heatFluxField.append(example_CG.list2Field(
24 example_CG.gList[solutionI]).clone());
26 std::to_string(solutionI + 1), outputFolder,
27 "g_CG");
28 }
29 example_CG.postProcess(outputFolder, "g_CG");
30}
31else
32{
33 Info << "CG did not converged" << endl;
34}
35
36Info << "*********************************************************" << endl;
37Info << endl;
forAll(example_CG.gList, solutionI)
Definition CGtest.H:21
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.
auto duration