initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / lduMesh / lduPrimitiveMesh.H
blobbca2e1b1b941808eeeb309de72f6c32f50138151
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::lduPrimitiveMesh
28 Description
29     Simplest contrete lduMesh which stores the addressing needed bu lduMatrix.
31 \*---------------------------------------------------------------------------*/
33 #ifndef lduPrimitiveMesh_H
34 #define lduPrimitiveMesh_H
36 #include "lduMesh.H"
37 #include "labelList.H"
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 namespace Foam
44 /*---------------------------------------------------------------------------*\
45                        Class lduPrimitiveMesh Declaration
46 \*---------------------------------------------------------------------------*/
48 class lduPrimitiveMesh
50     public lduMesh,
51     public lduAddressing
53     // Private data
55         //- Lower addressing
56         labelList lowerAddr_;
58         //- Upper addressing
59         labelList upperAddr_;
61         //- Patch to internal addressing
62         labelListList patchAddr_;
64         //- List of pointers for each patch
65         //  with only those pointing to interfaces being set
66         lduInterfacePtrsList interfaces_;
68         //- Patch field evaluation schedule.
69         //  Note this does not need to be held as a copy because it is invariant
70         const lduSchedule& patchSchedule_;
73     // Private Member Functions
75         //- Disallow default bitwise copy construct
76         lduPrimitiveMesh(const lduPrimitiveMesh&);
78         //- Disallow default bitwise assignment
79         void operator=(const lduPrimitiveMesh&);
82 public:
84     // Constructors
86         //- Construct from components as copies
87         lduPrimitiveMesh
88         (
89             const label nCells,
90             const unallocLabelList& l,
91             const unallocLabelList& u,
92             const labelListList& pa,
93             lduInterfacePtrsList interfaces,
94             const lduSchedule& ps
95         )
96         :
97             lduAddressing(nCells),
98             lowerAddr_(l),
99             upperAddr_(u),
100             patchAddr_(pa),
101             interfaces_(interfaces),
102             patchSchedule_(ps)
103         {}
106         //- Construct from components and  re-use storage as specified.
107         lduPrimitiveMesh
108         (
109             const label nCells,
110             labelList& l,
111             labelList& u,
112             labelListList& pa,
113             lduInterfacePtrsList interfaces,
114             const lduSchedule& ps,
115             bool reUse
116         )
117         :
118             lduAddressing(nCells),
119             lowerAddr_(l, reUse),
120             upperAddr_(u, reUse),
121             patchAddr_(pa, reUse),
122             interfaces_(interfaces, reUse),
123             patchSchedule_(ps)
124         {}
127     // Destructor
129         virtual ~lduPrimitiveMesh()
130         {}
133     // Member Functions
135         // Access
137             //- Return ldu addressing
138             virtual const lduAddressing& lduAddr() const
139             {
140                 return *this;
141             }
143             //- Return a list of pointers for each patch
144             //  with only those pointing to interfaces being set
145             virtual lduInterfacePtrsList interfaces() const
146             {
147                 return interfaces_;
148             }
150             //- Return Lower addressing
151             virtual const unallocLabelList& lowerAddr() const
152             {
153                 return lowerAddr_;
154             }
156             //- Return Upper addressing
157             virtual const unallocLabelList& upperAddr() const
158             {
159                 return upperAddr_;
160             }
162             //- Return patch addressing
163             virtual const unallocLabelList& patchAddr(const label i) const
164             {
165                 return patchAddr_[i];
166             }
168             //- Return patch evaluation schedule
169             virtual const lduSchedule& patchSchedule() const
170             {
171                 return patchSchedule_;
172             }
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 } // End namespace Foam
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 #endif
184 // ************************************************************************* //