cellVolumeWeightMethod.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) 2013-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::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 private:
98 
99  // Private member functions
100 
101  //- Disallow default bitwise copy construct
103 
104  //- Disallow default bitwise assignment
105  void operator=(const cellVolumeWeightMethod&);
106 
107 
108 public:
109 
110  //- Run-time type information
111  TypeName("cellVolumeWeight");
112 
113  //- Construct from source and target meshes
115 
116  //- Destructor
117  virtual ~cellVolumeWeightMethod();
118 
119 
120  // Member Functions
121 
122  // Evaluate
123 
124  //- Calculate addressing and weights
125  virtual void calculate
126  (
127  labelListList& srcToTgtAddr,
128  scalarListList& srcToTgtWght,
129  labelListList& tgtToTgtAddr,
130  scalarListList& tgtToTgtWght
131  );
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
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.
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.
const polyMesh & src() const
Return const access to the source mesh.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)
Calculate addressing and weights.
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
TypeName("cellVolumeWeight")
Run-time type information.
Namespace for OpenFOAM.