sampledThresholdCellFacesTemplates.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 "sampledThresholdCellFaces.H"
00028
00029 #include "thresholdCellFaces.H"
00030 #include "volFieldsFwd.H"
00031 #include "pointFields.H"
00032 #include "volPointInterpolation.H"
00033
00034
00035
00036 template <class Type>
00037 Foam::tmp<Foam::Field<Type> >
00038 Foam::sampledThresholdCellFaces::sampleField
00039 (
00040 const GeometricField<Type, fvPatchField, volMesh>& vField
00041 ) const
00042 {
00043
00044 updateGeometry();
00045
00046 return tmp<Field<Type> >(new Field<Type>(vField, meshCells_));
00047 }
00048
00049
00050 template <class Type>
00051 Foam::tmp<Foam::Field<Type> >
00052 Foam::sampledThresholdCellFaces::interpolateField
00053 (
00054 const interpolation<Type>& interpolator
00055 ) const
00056 {
00057
00058 updateGeometry();
00059
00060
00061 tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
00062 Field<Type>& values = tvalues();
00063
00064 boolList pointDone(points().size(), false);
00065
00066 forAll(faces(), cutFaceI)
00067 {
00068 const face& f = faces()[cutFaceI];
00069
00070 forAll(f, faceVertI)
00071 {
00072 label pointI = f[faceVertI];
00073
00074 if (!pointDone[pointI])
00075 {
00076 values[pointI] = interpolator.interpolate
00077 (
00078 points()[pointI],
00079 meshCells_[cutFaceI]
00080 );
00081 pointDone[pointI] = true;
00082 }
00083 }
00084 }
00085
00086 return tvalues;
00087 }
00088
00089
00090
Copyright © 2000-2009 OpenCFD Ltd