directMethod.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::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 private:
103 
104  // Private member functions
105 
106  //- Disallow default bitwise copy construct
107  directMethod(const directMethod&);
108 
109  //- Disallow default bitwise assignment
110  void operator=(const directMethod&);
111 
112 
113 public:
114 
115  //- Run-time type information
116  TypeName("direct");
117 
118  //- Construct from source and target meshes
119  directMethod(const polyMesh& src, const polyMesh& tgt);
120 
121  //- Destructor
122  virtual ~directMethod();
123 
124 
125  // Member Functions
126 
127  // Evaluate
128 
129  //- Calculate addressing and weights
130  virtual void calculate
131  (
132  labelListList& srcToTgtAddr,
133  scalarListList& srcToTgtWght,
134  labelListList& tgtToTgtAddr,
135  scalarListList& tgtToTgtWght
136  );
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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
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
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.