mapDistributeLagrangian.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-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::mapDistributeLagrangian
28
29Description
30 Mesh-to-mesh mapping information for particles
31
32\*---------------------------------------------------------------------------*/
33
34#ifndef mapDistributeLagrangian_H
35#define mapDistributeLagrangian_H
36
37#include "mapDistribute.H"
38
39// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40
41namespace Foam
42{
43
44class mapPolyMesh;
45
46/*---------------------------------------------------------------------------*\
47 Class mapDistributeLagrangian Declaration
48\*---------------------------------------------------------------------------*/
51{
52 // Private Data
53
54 //- Map to distribute particles
55 const mapDistribute particleMap_;
56
57 //- Per element in subsetted mesh the cell label
58 const labelListList constructCellLabels_;
59
60
61public:
62
63 // Constructors
64
65 //- Move construct from components
67 (
68 const label nNewParticles,
69 labelListList&& subParticleMap,
70 labelListList&& constructParticleMap,
72 )
73 :
74 particleMap_
75 (
76 nNewParticles,
77 std::move(subParticleMap),
78 std::move(constructParticleMap)
79 ),
80 constructCellLabels_(std::move(constructCellLabels))
81 {}
82
83
84 // Member Functions
85
86 // Access
87
88 //- Distribution map
89 const mapDistribute& particleMap() const
90 {
91 return particleMap_;
92 }
93
94 //- Per received particle the destination cell label
96 {
97 return constructCellLabels_;
98 }
99
100
101 // Edit
102
103 //- Distribute list of lagrangian data
104 template<class T>
105 void distributeLagrangianData(List<T>& lst) const
106 {
107 particleMap_.distribute(lst);
108 }
109
110 //- Correct for topo change.
111 void updateMesh(const mapPolyMesh&)
112 {
114 }
115};
116
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120} // End namespace Foam
121
122// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123
124#endif
125
126// ************************************************************************* //
Mesh-to-mesh mapping information for particles.
const mapDistribute & particleMap() const
Distribution map.
mapDistributeLagrangian(const label nNewParticles, labelListList &&subParticleMap, labelListList &&constructParticleMap, labelListList &&constructCellLabels)
Move construct from components.
const labelListList & constructCellLabels() const
Per received particle the destination cell label.
void distributeLagrangianData(List< T > &lst) const
Distribute list of lagrangian data.
void updateMesh(const mapPolyMesh &)
Correct for topo change.
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Namespace for OpenFOAM.