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 "distanceSurface.H"
00027 #include <sampling/isoSurface.H>
00028 #include <finiteVolume/volFieldsFwd.H>
00029 #include <OpenFOAM/pointFields.H>
00030 #include <finiteVolume/volPointInterpolation.H>
00031 
00032 
00033 
00034 template <class Type>
00035 Foam::tmp<Foam::Field<Type> >
00036 Foam::distanceSurface::sampleField
00037 (
00038     const GeometricField<Type, fvPatchField, volMesh>& vField
00039 ) const
00040 {
00041     return tmp<Field<Type> >(new Field<Type>(vField, surface().meshCells()));
00042 }
00043 
00044 
00045 template <class Type>
00046 Foam::tmp<Foam::Field<Type> >
00047 Foam::distanceSurface::interpolateField
00048 (
00049     const interpolation<Type>& interpolator
00050 ) const
00051 {
00052     const fvMesh& fvm = static_cast<const fvMesh&>(mesh());
00053 
00054     
00055     const GeometricField<Type, fvPatchField, volMesh>& volFld =
00056         interpolator.psi();
00057 
00058     tmp<GeometricField<Type, pointPatchField, pointMesh> > pointFld
00059     (
00060         volPointInterpolation::New(fvm).interpolate(volFld)
00061     );
00062 
00063     
00064     return surface().interpolate(volFld, pointFld());
00065 }
00066 
00067 
00068