1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
26 Foam::lduPrimitiveMesh
29 Simplest contrete lduMesh which stores the addressing needed bu lduMatrix.
31 \*---------------------------------------------------------------------------*/
33 #ifndef lduPrimitiveMesh_H
34 #define lduPrimitiveMesh_H
37 #include "labelList.H"
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 /*---------------------------------------------------------------------------*\
45 Class lduPrimitiveMesh Declaration
46 \*---------------------------------------------------------------------------*/
48 class lduPrimitiveMesh
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 must be held as a copy. HJ, 20/Feb/2009
70 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&);
86 //- Construct from components as copies
87 // Interfaces are added upon construction. HJ, 20/Feb/2009
91 const unallocLabelList& l,
92 const unallocLabelList& u
95 lduAddressing(nCells),
101 //- Construct from components and re-use storage as specified.
110 lduAddressing(nCells),
111 lowerAddr_(l, reUse),
118 virtual ~lduPrimitiveMesh()
124 //- Add interfaces. Constructor helper
127 const lduInterfacePtrsList& interfaces,
128 const labelListList& pa,
129 const lduSchedule& ps
132 interfaces_ = interfaces;
137 //- Return number of interfaces
138 virtual label nPatches() const
140 return patchAddr_.size();
146 //- Return ldu addressing
147 virtual const lduAddressing& lduAddr() const
152 //- Return a list of pointers for each patch
153 // with only those pointing to interfaces being set
154 virtual lduInterfacePtrsList interfaces() const
159 //- Return Lower addressing
160 virtual const unallocLabelList& lowerAddr() const
165 //- Return Upper addressing
166 virtual const unallocLabelList& upperAddr() const
171 //- Return patch addressing
172 virtual const unallocLabelList& patchAddr(const label i) const
174 return patchAddr_[i];
177 //- Return patch evaluation schedule
178 virtual const lduSchedule& patchSchedule() const
180 return patchSchedule_;
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 } // End namespace Foam
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 // ************************************************************************* //