All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
directMethod.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::directMethod
26 
27 Description
28  Direct (one-to-one cell correspondence) mesh-to-mesh interpolation class
29 
30  Volume conservative.
31 
32 SourceFiles
33  directMethod.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef directMethod_H
38 #define directMethod_H
39 
40 #include "meshToMeshMethod.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class directMethod Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class directMethod
52 :
53  public meshToMeshMethod
54 {
55 protected:
56 
57  // Protected Member Functions
58 
59  //- Return the true if cells intersect
60  virtual bool intersect
61  (
62  const label srcCelli,
63  const label tgtCelli
64  ) const;
65 
66  //- Find indices of overlapping cells in src and tgt meshes - returns
67  // true if found a matching pair
68  virtual bool findInitialSeeds
69  (
70  const labelList& srcCellIDs,
71  const boolList& mapFlag,
72  const label startSeedI,
73  label& srcSeedI,
74  label& tgtSeedI
75  ) const;
76 
77  //- Calculate the mesh-to-mesh addressing and weights
78  virtual void calculateAddressing
79  (
80  labelListList& srcToTgtCellAddr,
81  scalarListList& srcToTgtCellWght,
82  labelListList& tgtToSrcCellAddr,
83  scalarListList& tgtToSrcCellWght,
84  const label srcSeedI,
85  const label tgtSeedI,
86  const labelList& srcCellIDs,
87  boolList& mapFlag,
88  label& startSeedI
89  );
90 
91  //- Append to list of src mesh seed indices
92  virtual void appendToDirectSeeds
93  (
94  boolList& mapFlag,
95  labelList& srcTgtSeed,
96  DynamicList<label>& srcSeeds,
97  label& srcSeedI,
98  label& tgtSeedI
99  ) const;
100 
101 
102 public:
103 
104  //- Run-time type information
105  TypeName("direct");
106 
107  // Constructors
108 
109  //- Construct from source and target meshes
110  directMethod(const polyMesh& src, const polyMesh& tgt);
111 
112  //- Disallow default bitwise copy construction
113  directMethod(const directMethod&) = delete;
114 
115 
116  //- Destructor
117  virtual ~directMethod();
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  // Member Operators
135 
136  //- Disallow default bitwise assignment
137  void operator=(const directMethod&) = delete;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
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 void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)
Calculate addressing and weights.
Definition: directMethod.C:241
directMethod(const polyMesh &src, const polyMesh &tgt)
Construct from source and target meshes.
Definition: directMethod.C:224
const polyMesh & src() const
Return const access to the source mesh.
virtual bool intersect(const label srcCelli, const label tgtCelli) const
Return the true if cells intersect.
Definition: directMethod.C:42
virtual 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: directMethod.C:57
TypeName("direct")
Run-time type information.
const polyMesh & tgt() const
Return const access to the target mesh.
virtual 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: directMethod.C:98
virtual void appendToDirectSeeds(boolList &mapFlag, labelList &srcTgtSeed, DynamicList< label > &srcSeeds, label &srcSeedI, label &tgtSeedI) const
Append to list of src mesh seed indices.
Definition: directMethod.C:164
virtual ~directMethod()
Destructor.
Definition: directMethod.C:235
Base class for mesh-to-mesh calculation methods.
Direct (one-to-one cell correspondence) mesh-to-mesh interpolation class.
Definition: directMethod.H:50
void operator=(const directMethod &)=delete
Disallow default bitwise assignment.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.