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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 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::cellVolumeWeightMethod
28 
29 Description
30  Cell-volume-weighted mesh-to-mesh interpolation class
31 
32  Volume conservative.
33 
34 SourceFiles
35  cellVolumeWeightMethod.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef cellVolumeWeightMethod_H
40 #define cellVolumeWeightMethod_H
41 
42 #include "meshToMeshMethod.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class cellVolumeWeightMethod Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public meshToMeshMethod
56 {
57 protected:
58 
59  // Protected Member Functions
60 
61  //- Find indices of overlapping cells in src and tgt meshes - returns
62  // true if found a matching pair
63  bool findInitialSeeds
64  (
65  const labelList& srcCellIDs,
66  const boolList& mapFlag,
67  const label startSeedI,
68  label& srcSeedI,
69  label& tgtSeedI
70  ) const;
71 
72  //- Calculate the mesh-to-mesh addressing and weights
74  (
75  labelListList& srcToTgtCellAddr,
76  scalarListList& srcToTgtCellWght,
77  labelListList& tgtToSrcCellAddr,
78  scalarListList& tgtToSrcCellWght,
79  const label srcSeedI,
80  const label tgtSeedI,
81  const labelList& srcCellIDs,
82  boolList& mapFlag,
83  label& startSeedI
84  );
85 
86  //- Set the next cells in the advancing front algorithm
87  void setNextCells
88  (
89  label& startSeedI,
90  label& srcCelli,
91  label& tgtCelli,
92  const labelList& srcCellIDs,
93  const boolList& mapFlag,
94  const DynamicList<label>& visitedCells,
95  labelList& seedCells
96  ) const;
97 
98 
99 private:
100 
101  // Private member functions
102 
103  //- No copy construct
105 
106  //- No copy assignment
107  void operator=(const cellVolumeWeightMethod&) = delete;
108 
109 
110 public:
111 
112  //- Run-time type information
113  TypeName("cellVolumeWeight");
114 
115  //- Construct from source and target meshes
117 
118  //- Destructor
119  virtual ~cellVolumeWeightMethod();
120 
121 
122  // Member Functions
123 
124  // Evaluate
125 
126  //- Calculate addressing and weights and optionally offset vectors
127  virtual void calculate
128  (
129  labelListList& srcToTgtAddr,
130  scalarListList& srcToTgtWght,
131  pointListList& srcToTgtVec,
132  labelListList& tgtToSrcAddr,
133  scalarListList& tgtToSrcWght,
134  pointListList& tgtToSrcVec
135  );
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
Foam::cellVolumeWeightMethod::~cellVolumeWeightMethod
virtual ~cellVolumeWeightMethod()
Destructor.
Definition: cellVolumeWeightMethod.C:347
Foam::DynamicList< label >
Foam::cellVolumeWeightMethod::TypeName
TypeName("cellVolumeWeight")
Run-time type information.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::meshToMeshMethod
Base class for mesh-to-mesh calculation methods.
Definition: meshToMeshMethod.H:51
Foam::meshToMeshMethod::src
const polyMesh & src() const
Return const access to the source mesh.
Definition: meshToMeshMethodI.H:28
Foam::cellVolumeWeightMethod::findInitialSeeds
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.
Definition: cellVolumeWeightMethod.C:50
Foam::meshToMeshMethod::tgt
const polyMesh & tgt() const
Return const access to the target mesh.
Definition: meshToMeshMethodI.H:34
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
meshToMeshMethod.H
Foam::cellVolumeWeightMethod::setNextCells
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.
Definition: cellVolumeWeightMethod.C:232
Foam::cellVolumeWeightMethod::calculate
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, pointListList &srcToTgtVec, labelListList &tgtToSrcAddr, scalarListList &tgtToSrcWght, pointListList &tgtToSrcVec)
Calculate addressing and weights and optionally offset vectors.
Definition: cellVolumeWeightMethod.C:354
Foam::List< label >
Foam::cellVolumeWeightMethod
Cell-volume-weighted mesh-to-mesh interpolation class.
Definition: cellVolumeWeightMethod.H:52
Foam::cellVolumeWeightMethod::calculateAddressing
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.
Definition: cellVolumeWeightMethod.C:95