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-------------------------------------------------------------------------------
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::cellVolumeWeightMethod
28
29Description
30 Cell-volume-weighted mesh-to-mesh interpolation class
31
32 Volume conservative.
33
34SourceFiles
35 cellVolumeWeightMethod.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef cellVolumeWeightMethod_H
40#define cellVolumeWeightMethod_H
41
42#include "meshToMeshMethod.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class cellVolumeWeightMethod Declaration
51\*---------------------------------------------------------------------------*/
54:
55 public meshToMeshMethod
56{
57protected:
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
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
99private:
100
101 // Private member functions
102
103 //- No copy construct
105
106 //- No copy assignment
107 void operator=(const cellVolumeWeightMethod&) = delete;
108
109
110public:
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// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Cell-volume-weighted mesh-to-mesh interpolation class.
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.
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.
TypeName("cellVolumeWeight")
Run-time type information.
virtual ~cellVolumeWeightMethod()
Destructor.
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, pointListList &srcToTgtVec, labelListList &tgtToSrcAddr, scalarListList &tgtToSrcWght, pointListList &tgtToSrcVec)
Calculate addressing and weights and optionally offset vectors.
Base class for mesh-to-mesh calculation methods.
const polyMesh & src() const
Return const access to the source mesh.
const polyMesh & tgt() const
Return const access to the target mesh.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73