Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "CentredFitData.H"
00027 #include <finiteVolume/surfaceFields.H>
00028 #include <finiteVolume/volFields.H>
00029 #include <OpenFOAM/SVD.H>
00030 #include <OpenFOAM/syncTools.H>
00031 #include <finiteVolume/extendedCentredCellToFaceStencil.H>
00032
00033
00034
00035 template<class Polynomial>
00036 Foam::CentredFitData<Polynomial>::CentredFitData
00037 (
00038 const fvMesh& mesh,
00039 const extendedCentredCellToFaceStencil& stencil,
00040 const scalar linearLimitFactor,
00041 const scalar centralWeight
00042 )
00043 :
00044 FitData
00045 <
00046 CentredFitData<Polynomial>,
00047 extendedCentredCellToFaceStencil,
00048 Polynomial
00049 >
00050 (
00051 mesh, stencil, true, linearLimitFactor, centralWeight
00052 ),
00053 coeffs_(mesh.nFaces())
00054 {
00055 if (debug)
00056 {
00057 Info<< "Contructing CentredFitData<Polynomial>" << endl;
00058 }
00059
00060 calcFit();
00061
00062 if (debug)
00063 {
00064 Info<< "CentredFitData<Polynomial>::CentredFitData() :"
00065 << "Finished constructing polynomialFit data"
00066 << endl;
00067 }
00068 }
00069
00070
00071
00072
00073 template<class Polynomial>
00074 void Foam::CentredFitData<Polynomial>::calcFit()
00075 {
00076 const fvMesh& mesh = this->mesh();
00077
00078
00079
00080
00081 List<List<point> > stencilPoints(mesh.nFaces());
00082 this->stencil().collectData(mesh.C(), stencilPoints);
00083
00084
00085
00086 const surfaceScalarField& w = mesh.surfaceInterpolation::weights();
00087
00088 for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
00089 {
00090 FitData
00091 <
00092 CentredFitData<Polynomial>,
00093 extendedCentredCellToFaceStencil,
00094 Polynomial
00095 >::calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei);
00096 }
00097
00098 const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
00099
00100 forAll(bw, patchi)
00101 {
00102 const fvsPatchScalarField& pw = bw[patchi];
00103
00104 if (pw.coupled())
00105 {
00106 label facei = pw.patch().patch().start();
00107
00108 forAll(pw, i)
00109 {
00110 FitData
00111 <
00112 CentredFitData<Polynomial>,
00113 extendedCentredCellToFaceStencil,
00114 Polynomial
00115 >::calcFit(coeffs_[facei], stencilPoints[facei], pw[i], facei);
00116 facei++;
00117 }
00118 }
00119 }
00120 }
00121
00122
00123