OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

SlicedGeometricField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     SlicedGeometricField
00027 
00028 Description
00029     Special for of GeometricField which holds slices of given complete fields
00030     in a form that they act as a GeometricField.  The destructor is wrapped
00031     to avoid deallocation of the storage of the complete fields when this is
00032     destroyed.
00033 
00034     SlicedGeometricField can only be instantiated with a valid form of 
00035     SlicedPatchField to handle the slicing and storage deallocation of the
00036     boundary field.
00037 
00038 SourceFiles
00039     SlicedGeometricField.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef SlicedGeometricField_H
00044 #define SlicedGeometricField_H
00045 
00046 #include "GeometricField.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 
00053 /*---------------------------------------------------------------------------*\
00054                      Class SlicedGeometricField Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 template
00058 <
00059     class Type,
00060     template<class> class PatchField,
00061     template<class> class SlicedPatchField,
00062     class GeoMesh
00063 >
00064 class SlicedGeometricField
00065 :
00066     public GeometricField<Type, PatchField, GeoMesh>
00067 {
00068 public:
00069 
00070     typedef typename GeoMesh::Mesh Mesh;
00071     typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
00072 
00073     class DimensionedInternalField;
00074 
00075 
00076 private:
00077 
00078     // Private Member Functions
00079 
00080         //- Slice the given field and a create a PtrList of SlicedPatchField
00081         //  from which the boundary field is built
00082         tmp<FieldField<PatchField, Type> >  slicedBoundaryField
00083         (
00084             const Mesh& mesh,
00085             const Field<Type>& completeField
00086         );
00087 
00088         //- Disallow default bitwise copy construct
00089         SlicedGeometricField(const SlicedGeometricField&);
00090 
00091         //- Disallow default bitwise assignment
00092         void operator=(const SlicedGeometricField&);
00093 
00094 
00095 public:
00096 
00097     // Constructors
00098 
00099         //- Construct from components and field to slice
00100         SlicedGeometricField
00101         (
00102             const IOobject&,
00103             const Mesh&,
00104             const dimensionSet&,
00105             const Field<Type>& completeField
00106         );
00107 
00108         //- Construct from components and separate fields to slice for the
00109         //  internal field and boundary field
00110         SlicedGeometricField
00111         (
00112             const IOobject&,
00113             const Mesh&,
00114             const dimensionSet&,
00115             const Field<Type>& completeIField,
00116             const Field<Type>& completeBField
00117         );
00118 
00119 
00120     // Destructor
00121 
00122         ~SlicedGeometricField();
00123 };
00124 
00125 
00126 /*---------------------------------------------------------------------------*\
00127        Class SlicedGeometricField::DimensionedInternalField Declaration
00128 \*---------------------------------------------------------------------------*/
00129 
00130 template
00131 <
00132     class Type,
00133     template<class> class PatchField,
00134     template<class> class SlicedPatchField,
00135     class GeoMesh
00136 >
00137 class SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
00138 DimensionedInternalField
00139 :
00140     public GeometricField<Type, PatchField, GeoMesh>::DimensionedInternalField
00141 {
00142 
00143 public:
00144 
00145     // Constructors
00146 
00147         //- Construct from components and field to slice
00148         DimensionedInternalField
00149         (
00150             const IOobject&,
00151             const Mesh&,
00152             const dimensionSet&,
00153             const Field<Type>& iField
00154         );
00155 
00156 
00157     // Destructor
00158 
00159         ~DimensionedInternalField();
00160 };
00161 
00162 
00163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00164 
00165 } // End namespace Foam
00166 
00167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00168 
00169 #ifdef NoRepository
00170 #   include "SlicedGeometricField.C"
00171 #endif
00172 
00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00174 
00175 #endif
00176 
00177 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd