fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / OpenFOAM / meshes / pointMesh / pointMeshMapper / pointPatchMapper.H
blob7fc91cc0a631134017dafb10ea2a9768c5d934db
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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::pointPatchMapper
28 Description
29     Mapping class for a pointPatchField.
31 SourceFiles
32     pointPatchMapper.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef pointPatchMapper_H
37 #define pointPatchMapper_H
39 #include "pointMapper.H"
40 #include "PointPatchFieldMapper.H"
41 #include "pointPatch.H"
42 #include "primitiveFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Forward declaration of classes
50 class pointPatch;
51 class mapPolyMesh;
53 /*---------------------------------------------------------------------------*\
54                        Class pointPatchMapper Declaration
55 \*---------------------------------------------------------------------------*/
57 class pointPatchMapper
59     public PointPatchFieldMapper
61     // Private data
63         //- Reference to patch
64         const pointPatch& patch_;
66         //- Reference to point mapper for internal field
67         const morphFieldMapper& pointMapper_;
69         //- Reference to mapping data
70         const mapPolyMesh& mpm_;
72         //- Size before mapping
73         const label sizeBeforeMapping_;
76     // Demand-driven private data
78         //- Direct addressing (only one for of addressing is used)
79         mutable labelList* directAddrPtr_;
81         //- Interpolated addressing (only one for of addressing is used)
82         mutable labelListList* interpolationAddrPtr_;
84         //- Interpolation weights
85         mutable scalarListList* weightsPtr_;
88     // Private Member Functions
90         //- Disallow default bitwise copy construct
91         pointPatchMapper
92         (
93             const pointPatchMapper&
94         );
96         //- Disallow default bitwise assignment
97         void operator=(const pointPatchMapper&);
100         //- Calculate addressing for mapping with inserted cells
101         void calcAddressing() const;
103         //- Clear out local storage
104         void clearOut();
107 public:
109     // Static data members
111     // Constructors
113         //- Construct from mappers
114         pointPatchMapper
115         (
116             const pointPatch& patch,
117             const pointMapper& pointMap,
118             const mapPolyMesh& mpm
119         );
122     // Destructor
124         virtual ~pointPatchMapper();
127     // Member Functions
129         //- Return size
130         virtual label size() const
131         {
132             return patch_.size();
133         }
135         //- Return size of field before mapping
136         virtual label sizeBeforeMapping() const
137         {
138             return sizeBeforeMapping_;
139         }
141         //- Is the mapping direct
142         virtual bool direct() const
143         {
144             return pointMapper_.direct();
145         }
147         //- Return direct addressing
148         virtual const unallocLabelList& directAddressing() const;
150         //- Return interpolated addressing
151         virtual const labelListList& addressing() const;
153         //- Return interpolaion weights
154         virtual const scalarListList& weights() const;
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 #endif
167 // ************************************************************************* //