mapClouds.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 InNamespace
28  Foam::mapClouds
29 
30 Description
31  Generic Geometric field mapper. For "real" mapping, add template
32  specialisations for mapping of internal fields depending on mesh
33  type.
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef Foam_mapClouds_H
38 #define Foam_mapClouds_H
39 
40 #include "cloud.H"
41 #include "objectRegistry.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 //- Generic Geometric field mapper.
49 // For "real" mapping, add template specialisations for mapping of internal
50 // fields depending on mesh type.
51 inline void mapClouds(const objectRegistry& db, const mapPolyMesh& mapper)
52 {
53  for (const cloud& c : db.csorted<cloud>())
54  {
55  if (polyMesh::debug)
56  {
57  Info<< "Mapping cloud " << c.name() << endl;
58  }
59 
60  const_cast<cloud&>(c).autoMap(mapper);
61  }
62 }
63 
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 } // End namespace Foam
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 #endif
72 
73 // ************************************************************************* //
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
Definition: mapClouds.H:48
UPtrList< const Type > csorted() const
Return sorted list of objects with a class satisfying isA<Type> or isType<Type> (with Strict) ...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:53
int debug
Static debugging option.
const word & name() const noexcept
Return const reference to name.
const dimensionedScalar c
Speed of light in a vacuum.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Registry of regIOobjects.
Namespace for OpenFOAM.