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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::mapDistributeLagrangian
28 
29 Description
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 
41 namespace Foam
42 {
43 
44 class mapPolyMesh;
45 
46 /*---------------------------------------------------------------------------*\
47  Class mapDistributeLagrangian Declaration
48 \*---------------------------------------------------------------------------*/
49 
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 
61 public:
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
95  const labelListList& constructCellLabels() const
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 // ************************************************************************* //
Foam::mapDistributeLagrangian
Mesh-to-mesh mapping information for particles.
Definition: mapDistributeLagrangian.H:49
Foam::mapDistributeLagrangian::distributeLagrangianData
void distributeLagrangianData(List< T > &lst) const
Distribute list of lagrangian data.
Definition: mapDistributeLagrangian.H:104
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
Foam::mapDistribute::distribute
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
Definition: mapDistributeTemplates.C:152
Foam::mapDistributeLagrangian::particleMap
const mapDistribute & particleMap() const
Distribution map.
Definition: mapDistributeLagrangian.H:88
Foam::mapDistributeLagrangian::updateMesh
void updateMesh(const mapPolyMesh &)
Correct for topo change.
Definition: mapDistributeLagrangian.H:110
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mapDistribute.H
Foam::mapDistributeLagrangian::mapDistributeLagrangian
mapDistributeLagrangian(const label nNewParticles, labelListList &&subParticleMap, labelListList &&constructParticleMap, labelListList &&constructCellLabels)
Move construct from components.
Definition: mapDistributeLagrangian.H:66
Foam::mapDistributeLagrangian::constructCellLabels
const labelListList & constructCellLabels() const
Per received particle the destination cell label.
Definition: mapDistributeLagrangian.H:94
Foam::List< labelList >
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161