2Info <<
"*********************************************************" << endl;
3Info <<
"Performing test for the parameterized BC inverse solver" << endl;
4Info <<
"Changing the position of the thermocouples on y" << endl;
6word outputFolder =
"./ITHACAoutput/thermocouplesLocationTest_paramBC/";
7volScalarField gTrueField = example_paramBC.list2Field(example_paramBC.gTrue);
14Eigen::VectorXd TCplane_Y = Eigen::VectorXd::LinSpaced(testSize, 0.1, 0.9);
18for (
int i = 0;
i < testSize;
i++)
20 Info <<
"\n**************************************************** " << endl;
21 Info <<
"\nTest " <<
i << endl;
22 Info <<
"\n**************************************************** " << endl;
23 forAll(example_paramBC.thermocouplesPos, TCi)
25 example_paramBC.thermocouplesPos[TCi][1] = TCplane_Y(
i);
29 if ( remove(
"./thermocouplesCellsID_mat.txt" ) != 0 )
31 perror(
"\nError deleting thermocouples file\n" );
35 puts(
"\nThermocouples file successfully deleted\n" );
38 volScalarField Ttrue(example_paramBC._T());
40 for (label
i = 0;
i < Ttrue.internalField().size();
i++)
42 auto cx = Ttrue.mesh().C()[
i].component(vector::X);
43 auto cy = Ttrue.mesh().C()[
i].component(vector::Y);
44 auto cz = Ttrue.mesh().C()[
i].component(vector::Z);
45 Ttrue.ref()[
i] = a * cx * cx + b * cx * cy + c * cy - a * cz * cz + c;
48 example_paramBC.thermocouplesRead = 0;
49 example_paramBC.readThermocouples();
50 example_paramBC.Tmeas = example_paramBC.fieldValueAtThermocouples(Ttrue);
51 example_paramBC.set_gParametrized(
"rbf", rbfShapePar);
52 example_paramBC.parameterizedBCoffline(1);
53 example_paramBC.parameterizedBC(
"fullPivLU");
54 volScalarField gParametrizedField = example_paramBC.list2Field(
57 std::to_string(
i + 1),
60 volScalarField&
T(example_paramBC._T());
62 std::to_string(
i + 1),
67example_paramBC.postProcess(outputFolder,
"g");
70if ( remove(
"./thermocouplesCellsID_mat.txt" ) != 0 )
72 perror(
"\nError deleting thermocouples file\n" );
76 puts(
"\nThermocouples file successfully deleted\n" );
forAll(example_CG.gList, solutionI)
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 ...