All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cellVolumeWeightMethod.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 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::cellVolumeWeightMethod
26 
27 Description
28  Cell-volume-weighted mesh-to-mesh interpolation class
29 
30  Volume conservative.
31 
32 SourceFiles
33  cellVolumeWeightMethod.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cellVolumeWeightMethod_H
38 #define cellVolumeWeightMethod_H
39 
40 #include "meshToMeshMethod.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cellVolumeWeightMethod Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public meshToMeshMethod
54 {
55 protected:
56 
57  // Protected Member Functions
58 
59  //- Find indices of overlapping cells in src and tgt meshes - returns
60  // true if found a matching pair
61  bool findInitialSeeds
62  (
63  const labelList& srcCellIDs,
64  const boolList& mapFlag,
65  const label startSeedI,
66  label& srcSeedI,
67  label& tgtSeedI
68  ) const;
69 
70  //- Calculate the mesh-to-mesh addressing and weights
72  (
73  labelListList& srcToTgtCellAddr,
74  scalarListList& srcToTgtCellWght,
75  labelListList& tgtToSrcCellAddr,
76  scalarListList& tgtToSrcCellWght,
77  const label srcSeedI,
78  const label tgtSeedI,
79  const labelList& srcCellIDs,
80  boolList& mapFlag,
81  label& startSeedI
82  );
83 
84  //- Set the next cells in the advancing front algorithm
85  void setNextCells
86  (
87  label& startSeedI,
88  label& srcCelli,
89  label& tgtCelli,
90  const labelList& srcCellIDs,
91  const boolList& mapFlag,
92  const DynamicList<label>& visitedCells,
93  labelList& seedCells
94  ) const;
95 
96 
97 public:
98 
99  //- Run-time type information
100  TypeName("cellVolumeWeight");
101 
102  // Constructors
103 
104  //- Construct from source and target meshes
106 
107  //- Disallow default bitwise copy construction
109 
110 
111  //- Destructor
112  virtual ~cellVolumeWeightMethod();
113 
114 
115  // Member Functions
116 
117  // Evaluate
118 
119  //- Calculate addressing and weights
120  virtual void calculate
121  (
122  labelListList& srcToTgtAddr,
123  scalarListList& srcToTgtWght,
124  labelListList& tgtToTgtAddr,
125  scalarListList& tgtToTgtWght
126  );
127 
128 
129  // Member Operators
130 
131  //- Disallow default bitwise assignment
132  void operator=(const cellVolumeWeightMethod&) = delete;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
cellVolumeWeightMethod(const polyMesh &src, const polyMesh &tgt)
Construct from source and target meshes.
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
virtual ~cellVolumeWeightMethod()
Destructor.
Cell-volume-weighted mesh-to-mesh interpolation class.
void calculateAddressing(labelListList &srcToTgtCellAddr, scalarListList &srcToTgtCellWght, labelListList &tgtToSrcCellAddr, scalarListList &tgtToSrcCellWght, const label srcSeedI, const label tgtSeedI, const labelList &srcCellIDs, boolList &mapFlag, label &startSeedI)
Calculate the mesh-to-mesh addressing and weights.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)
Calculate addressing and weights.
const polyMesh & src() const
Return const access to the source mesh.
const polyMesh & tgt() const
Return const access to the target mesh.
Base class for mesh-to-mesh calculation methods.
void setNextCells(label &startSeedI, label &srcCelli, label &tgtCelli, const labelList &srcCellIDs, const boolList &mapFlag, const DynamicList< label > &visitedCells, labelList &seedCells) const
Set the next cells in the advancing front algorithm.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
void operator=(const cellVolumeWeightMethod &)=delete
Disallow default bitwise assignment.
TypeName("cellVolumeWeight")
Run-time type information.
bool findInitialSeeds(const labelList &srcCellIDs, const boolList &mapFlag, const label startSeedI, label &srcSeedI, label &tgtSeedI) const
Find indices of overlapping cells in src and tgt meshes - returns.
Namespace for OpenFOAM.