CentredFitData.C
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
00027 #include "CentredFitData.H"
00028 #include "surfaceFields.H"
00029 #include "volFields.H"
00030 #include "SVD.H"
00031 #include "syncTools.H"
00032 #include "extendedCentredCellToFaceStencil.H"
00033
00034
00035
00036 template<class Polynomial>
00037 Foam::CentredFitData<Polynomial>::CentredFitData
00038 (
00039 const fvMesh& mesh,
00040 const extendedCentredCellToFaceStencil& stencil,
00041 const scalar linearLimitFactor,
00042 const scalar centralWeight
00043 )
00044 :
00045 FitData
00046 <
00047 CentredFitData<Polynomial>,
00048 extendedCentredCellToFaceStencil,
00049 Polynomial
00050 >
00051 (
00052 mesh, stencil, true, linearLimitFactor, centralWeight
00053 ),
00054 coeffs_(mesh.nFaces())
00055 {
00056 if (debug)
00057 {
00058 Info<< "Contructing CentredFitData<Polynomial>" << endl;
00059 }
00060
00061 calcFit();
00062
00063 if (debug)
00064 {
00065 Info<< "CentredFitData<Polynomial>::CentredFitData() :"
00066 << "Finished constructing polynomialFit data"
00067 << endl;
00068 }
00069 }
00070
00071
00072
00073
00074 template<class Polynomial>
00075 void Foam::CentredFitData<Polynomial>::calcFit()
00076 {
00077 const fvMesh& mesh = this->mesh();
00078
00079
00080
00081
00082 List<List<point> > stencilPoints(mesh.nFaces());
00083 this->stencil().collectData(mesh.C(), stencilPoints);
00084
00085
00086
00087 const surfaceScalarField& w = mesh.surfaceInterpolation::weights();
00088
00089 for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
00090 {
00091 FitData
00092 <
00093 CentredFitData<Polynomial>,
00094 extendedCentredCellToFaceStencil,
00095 Polynomial
00096 >::calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei);
00097 }
00098
00099 const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
00100
00101 forAll(bw, patchi)
00102 {
00103 const fvsPatchScalarField& pw = bw[patchi];
00104
00105 if (pw.coupled())
00106 {
00107 label facei = pw.patch().patch().start();
00108
00109 forAll(pw, i)
00110 {
00111 FitData
00112 <
00113 CentredFitData<Polynomial>,
00114 extendedCentredCellToFaceStencil,
00115 Polynomial
00116 >::calcFit(coeffs_[facei], stencilPoints[facei], pw[i], facei);
00117 facei++;
00118 }
00119 }
00120 }
00121 }
00122
00123
00124
Copyright © 2000-2009 OpenCFD Ltd