FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

directMappedPolyPatch.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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::directMappedPolyPatch
00026 
00027 Description
00028     Determines a mapping between patch face centres and mesh cell or face
00029     centres and processors they're on.
00030 
00031 Note
00032     Storage is not optimal. It stores all face centres and cells on all
00033     processors to keep the addressing calculation simple.
00034 
00035 SourceFiles
00036     directMappedPolyPatch.C
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #ifndef directMappedPolyPatch_H
00041 #define directMappedPolyPatch_H
00042 
00043 #include <OpenFOAM/polyPatch.H>
00044 #include "directMappedPatchBase.H"
00045 
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 class polyMesh;
00053 
00054 /*---------------------------------------------------------------------------*\
00055                       Class directMappedPolyPatch Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class directMappedPolyPatch
00059 :
00060     public polyPatch,
00061     public directMappedPatchBase
00062 {
00063 
00064 protected:
00065 
00066         //- Initialise the calculation of the patch geometry
00067         virtual void initGeometry();
00068 
00069         //- Calculate the patch geometry
00070         virtual void calcGeometry();
00071 
00072         //- Initialise the patches for moving points
00073         virtual void initMovePoints(const pointField&);
00074 
00075         //- Correct patches after moving points
00076         virtual void movePoints(const pointField&);
00077 
00078         //- Initialise the update of the patch topology
00079         virtual void initUpdateMesh();
00080 
00081         //- Update of the patch topology
00082         virtual void updateMesh();
00083 
00084 
00085 public:
00086 
00087     //- Runtime type information
00088     TypeName("directMappedPatch");
00089 
00090 
00091     // Constructors
00092 
00093         //- Construct from components
00094         directMappedPolyPatch
00095         (
00096             const word& name,
00097             const label size,
00098             const label start,
00099             const label index,
00100             const polyBoundaryMesh& bm
00101         );
00102 
00103         //- Construct from components
00104         directMappedPolyPatch
00105         (
00106             const word& name,
00107             const label size,
00108             const label start,
00109             const label index,
00110             const word& sampleRegion,
00111             const directMappedPatchBase::sampleMode mode,
00112             const word& samplePatch,
00113             const vectorField& offset,
00114             const polyBoundaryMesh& bm
00115         );
00116 
00117         //- Construct from components. Uniform offset.
00118         directMappedPolyPatch
00119         (
00120             const word& name,
00121             const label size,
00122             const label start,
00123             const label index,
00124             const word& sampleRegion,
00125             const directMappedPatchBase::sampleMode mode,
00126             const word& samplePatch,
00127             const vector& offset,
00128             const polyBoundaryMesh& bm
00129         );
00130 
00131         //- Construct from dictionary
00132         directMappedPolyPatch
00133         (
00134             const word& name,
00135             const dictionary& dict,
00136             const label index,
00137             const polyBoundaryMesh& bm
00138         );
00139 
00140         //- Construct as copy, resetting the boundary mesh
00141         directMappedPolyPatch
00142         (
00143             const directMappedPolyPatch&,
00144             const polyBoundaryMesh&
00145         );
00146 
00147         //- Construct given the original patch and resetting the
00148         //  face list and boundary mesh information
00149         directMappedPolyPatch
00150         (
00151             const directMappedPolyPatch& pp,
00152             const polyBoundaryMesh& bm,
00153             const label index,
00154             const label newSize,
00155             const label newStart
00156         );
00157 
00158         //- Construct and return a clone, resetting the boundary mesh
00159         virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
00160         {
00161             return autoPtr<polyPatch>(new directMappedPolyPatch(*this, bm));
00162         }
00163 
00164         //- Construct and return a clone, resetting the face list
00165         //  and boundary mesh
00166         virtual autoPtr<polyPatch> clone
00167         (
00168             const polyBoundaryMesh& bm,
00169             const label index,
00170             const label newSize,
00171             const label newStart
00172         ) const
00173         {
00174             return autoPtr<polyPatch>
00175             (
00176                 new directMappedPolyPatch(*this, bm, index, newSize, newStart)
00177             );
00178         }
00179 
00180 
00181     //- Destructor
00182     virtual ~directMappedPolyPatch();
00183 
00184 
00185     // Member functions
00186 
00187         //- Write the polyPatch data as a dictionary
00188         virtual void write(Ostream&) const;
00189 };
00190 
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 } // End namespace Foam
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 #endif
00199 
00200 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines