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

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