fvMeshAdder.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fvMeshAdder
26 
27 Description
28  Adds two fvMeshes without using any polyMesh morphing.
29  Uses polyMeshAdder.
30 
31 SourceFiles
32  fvMeshAdder.C
33  fvMeshAdderTemplates.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef fvMeshAdder_H
38 #define fvMeshAdder_H
39 
40 #include "polyMeshAdder.H"
41 #include "volFieldsFwd.H"
42 #include "fvPatchFieldsFwd.H"
43 #include "fvsPatchFieldsFwd.H"
44 #include "fvPatchFieldMapper.H"
45 #include "DimensionedField.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of classes
53 class IOobject;
54 class faceCoupleInfo;
55 class IOobjectList;
56 class fvMesh;
57 class volMesh;
58 class surfaceMesh;
59 class mapAddedPolyMesh;
60 
61 /*---------------------------------------------------------------------------*\
62  Class fvMeshAdder Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class fvMeshAdder
66 :
67  public polyMeshAdder
68 {
69 
70 private:
71 
72  // Private Member Functions
73 
74  //- Calculate map from new patch faces to old patch faces. -1 where
75  // could not map.
76  static labelList calcPatchMap
77  (
78  const label oldStart,
79  const label oldSize,
80  const labelList& oldToNew,
81  const polyPatch& newPatch,
82  const label unmappedIndex
83  );
84 
85  //- Update single volField.
86  template<class Type>
87  static void MapVolField
88  (
89  const mapAddedPolyMesh& meshMap,
90 
93  );
94 
95  //- Update single surfaceField.
96  template<class Type>
97  static void MapSurfaceField
98  (
99  const mapAddedPolyMesh& meshMap,
100 
103  );
104 
105  //- Update single dimensionedField.
106  template<class Type>
107  static void MapDimField
108  (
109  const mapAddedPolyMesh& meshMap,
110 
112  const DimensionedField<Type, volMesh>& fldToAdd
113  );
114 
115 public:
116 
117  // Declare name of the class and its debug switch
118  ClassName("fvMeshAdder");
119 
120 
121  // Member Functions
122 
123  //- Inplace add mesh to fvMesh. Maps all stored fields. Returns map.
125  (
126  fvMesh& mesh0,
127  const fvMesh& mesh1,
128  const faceCoupleInfo& coupleInfo,
129  const bool validBoundary = true
130  );
131 
132  //- Map all volFields of Type
133  template<class Type>
134  static void MapVolFields
135  (
136  const mapAddedPolyMesh&,
137  const fvMesh& mesh,
138  const fvMesh& meshToAdd
139  );
140 
141  //- Map all surfaceFields of Type
142  template<class Type>
143  static void MapSurfaceFields
144  (
145  const mapAddedPolyMesh&,
146  const fvMesh& mesh,
147  const fvMesh& meshToAdd
148  );
149 
150  //- Map all DimensionedFields of Type
151  template<class Type>
152  static void MapDimFields
153  (
154  const mapAddedPolyMesh&,
155  const fvMesh& mesh,
156  const fvMesh& meshToAdd
157  );
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #ifdef NoRepository
168  #include "fvMeshAdderTemplates.C"
169 #endif
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Adds two fvMeshes without using any polyMesh morphing. Uses polyMeshAdder.
Definition: fvMeshAdder.H:64
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh (&#39;added m...
Generic GeometricField class.
Adds two meshes without using any polyMesh morphing.
Definition: polyMeshAdder.H:59
Container for information needed to couple to meshes. When constructed from two meshes and a geometri...
dynamicFvMesh & mesh
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
static autoPtr< mapAddedPolyMesh > add(fvMesh &mesh0, const fvMesh &mesh1, const faceCoupleInfo &coupleInfo, const bool validBoundary=true)
Inplace add mesh to fvMesh. Maps all stored fields. Returns map.
Definition: fvMeshAdder.C:71
ClassName("fvMeshAdder")
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static void MapSurfaceFields(const mapAddedPolyMesh &, const fvMesh &mesh, const fvMesh &meshToAdd)
Map all surfaceFields of Type.
static void MapDimFields(const mapAddedPolyMesh &, const fvMesh &mesh, const fvMesh &meshToAdd)
Map all DimensionedFields of Type.
static void MapVolFields(const mapAddedPolyMesh &, const fvMesh &mesh, const fvMesh &meshToAdd)
Map all volFields of Type.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Namespace for OpenFOAM.