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