1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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
29 Adds two fvMeshes without using any polyMesh morphing.
34 fvMeshAdderTemplates.C
36 \*---------------------------------------------------------------------------*/
41 #include "polyMeshAdder.H"
42 #include "fvPatchFieldsFwd.H"
43 #include "fvsPatchFieldsFwd.H"
44 #include "fvPatchFieldMapper.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // Forward declaration of classes
58 class mapAddedPolyMesh;
60 /*---------------------------------------------------------------------------*\
61 Class fvMeshAdder Declaration
62 \*---------------------------------------------------------------------------*/
74 class directFvPatchFieldMapper
76 public fvPatchFieldMapper
80 const labelList& directAddressing_;
86 //- Construct from components
87 directFvPatchFieldMapper(const labelList& directAddressing)
90 directAddressing_(directAddressing)
96 virtual ~directFvPatchFieldMapper()
104 return directAddressing_.size();
112 const unallocLabelList& directAddressing() const
114 return directAddressing_;
119 // Private Member Functions
121 //- Calculate map from new patch faces to old patch faces. -1 where
123 static labelList calcPatchMap
125 const label oldStart,
127 const labelList& oldToNew,
128 const polyPatch& newPatch,
129 const label unmappedIndex
132 //- Map from old to new according to map. Handles map = -1.
137 const labelList& map,
141 //- Update single volField.
143 static void MapVolField
145 const mapAddedPolyMesh& meshMap,
147 GeometricField<Type, fvPatchField, volMesh>& fld,
148 const GeometricField<Type, fvPatchField, volMesh>& fldToAdd
151 //- Update single surfaceField.
153 static void MapSurfaceField
155 const mapAddedPolyMesh& meshMap,
157 GeometricField<Type, fvsPatchField, surfaceMesh>& fld,
158 const GeometricField<Type, fvsPatchField, surfaceMesh>& fldToAdd
165 //- Inplace add mesh to fvMesh. Maps all stored fields. Returns map.
166 static autoPtr<mapAddedPolyMesh> add
170 const faceCoupleInfo& coupleInfo,
171 const bool validBoundary = true
174 //- Map all volFields of Type
176 static void MapVolFields
178 const mapAddedPolyMesh&,
180 const fvMesh& meshToAdd
183 //- Map all surfaceFields of Type
185 static void MapSurfaceFields
187 const mapAddedPolyMesh&,
189 const fvMesh& meshToAdd
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 } // End namespace Foam
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 # include "fvMeshAdderTemplates.C"
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 // ************************************************************************* //