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::pointPatchMapper
29 Mapping class for a pointPatchField.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54 Class pointPatchMapper Declaration
55 \*---------------------------------------------------------------------------*/
57 class pointPatchMapper
59 public PointPatchFieldMapper
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
93 const pointPatchMapper&
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
109 // Static data members
113 //- Construct from mappers
116 const pointPatch& patch,
117 const pointMapper& pointMap,
118 const mapPolyMesh& mpm
124 virtual ~pointPatchMapper();
130 virtual label size() const
132 return patch_.size();
135 //- Return size of field before mapping
136 virtual label sizeBeforeMapping() const
138 return sizeBeforeMapping_;
141 //- Is the mapping direct
142 virtual bool direct() const
144 return pointMapper_.direct();
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 // ************************************************************************* //