OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

lduPrimitiveMesh.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-2009 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     Foam::lduPrimitiveMesh
00027 
00028 Description
00029     Simplest contrete lduMesh which stores the addressing needed bu lduMatrix.
00030 
00031 \*---------------------------------------------------------------------------*/
00032 
00033 #ifndef lduPrimitiveMesh_H
00034 #define lduPrimitiveMesh_H
00035 
00036 #include "lduMesh.H"
00037 #include "labelList.H"
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 namespace Foam
00042 {
00043 
00044 /*---------------------------------------------------------------------------*\
00045                        Class lduPrimitiveMesh Declaration
00046 \*---------------------------------------------------------------------------*/
00047 
00048 class lduPrimitiveMesh
00049 :
00050     public lduMesh,
00051     public lduAddressing
00052 {
00053     // Private data
00054 
00055         //- Lower addressing
00056         labelList lowerAddr_;
00057 
00058         //- Upper addressing
00059         labelList upperAddr_;
00060 
00061         //- Patch to internal addressing
00062         labelListList patchAddr_;
00063 
00064         //- List of pointers for each patch
00065         //  with only those pointing to interfaces being set
00066         lduInterfacePtrsList interfaces_;
00067 
00068         //- Patch field evaluation schedule.
00069         //  Note this does not need to be held as a copy because it is invariant
00070         const lduSchedule& patchSchedule_;
00071 
00072 
00073     // Private Member Functions
00074 
00075         //- Disallow default bitwise copy construct
00076         lduPrimitiveMesh(const lduPrimitiveMesh&);
00077 
00078         //- Disallow default bitwise assignment
00079         void operator=(const lduPrimitiveMesh&);
00080 
00081 
00082 public:
00083 
00084     // Constructors
00085 
00086         //- Construct from components as copies
00087         lduPrimitiveMesh
00088         (
00089             const label nCells,
00090             const unallocLabelList& l,
00091             const unallocLabelList& u,
00092             const labelListList& pa,
00093             lduInterfacePtrsList interfaces,
00094             const lduSchedule& ps
00095         )
00096         :
00097             lduAddressing(nCells),
00098             lowerAddr_(l),
00099             upperAddr_(u),
00100             patchAddr_(pa),
00101             interfaces_(interfaces),
00102             patchSchedule_(ps)
00103         {}
00104 
00105 
00106         //- Construct from components and  re-use storage as specified.
00107         lduPrimitiveMesh
00108         (
00109             const label nCells,
00110             labelList& l,
00111             labelList& u,
00112             labelListList& pa,
00113             lduInterfacePtrsList interfaces,
00114             const lduSchedule& ps,
00115             bool reUse
00116         )
00117         :
00118             lduAddressing(nCells),
00119             lowerAddr_(l, reUse),
00120             upperAddr_(u, reUse),
00121             patchAddr_(pa, reUse),
00122             interfaces_(interfaces, reUse),
00123             patchSchedule_(ps)
00124         {}
00125 
00126 
00127     // Destructor
00128 
00129         virtual ~lduPrimitiveMesh()
00130         {}
00131 
00132 
00133     // Member Functions
00134 
00135         // Access
00136 
00137             //- Return ldu addressing
00138             virtual const lduAddressing& lduAddr() const
00139             {
00140                 return *this;
00141             }
00142 
00143             //- Return a list of pointers for each patch
00144             //  with only those pointing to interfaces being set
00145             virtual lduInterfacePtrsList interfaces() const
00146             {
00147                 return interfaces_;
00148             }
00149 
00150             //- Return Lower addressing
00151             virtual const unallocLabelList& lowerAddr() const
00152             {
00153                 return lowerAddr_;
00154             }
00155 
00156             //- Return Upper addressing
00157             virtual const unallocLabelList& upperAddr() const
00158             {
00159                 return upperAddr_;
00160             }
00161 
00162             //- Return patch addressing
00163             virtual const unallocLabelList& patchAddr(const label i) const
00164             {
00165                 return patchAddr_[i];
00166             }
00167 
00168             //- Return patch evaluation schedule
00169             virtual const lduSchedule& patchSchedule() const
00170             {
00171                 return patchSchedule_;
00172             }
00173 };
00174 
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 } // End namespace Foam
00179 
00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00181 
00182 #endif
00183 
00184 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd