mapNearestAMI.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::mapNearestAMI
26 
27 Description
28  Nearest-mapping Arbitrary Mesh Interface (AMI) method
29 
30 SourceFiles
31  mapNearestAMI.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef mapNearestAMI_H
36 #define mapNearestAMI_H
37 
38 #include "AMIMethod.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class mapNearestAMI Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class mapNearestAMI
50 :
51  public AMIMethod
52 {
53  // Private Member Functions
54 
55  // Marching front
56 
57  //- Find nearest target face for source face srcFacei
58  void findNearestFace
59  (
60  const primitivePatch& srcPatch,
61  const primitivePatch& tgtPatch,
62  const label& srcFacei,
63  label& tgtFacei
64  ) const;
65 
66  //- Determine next source-target face pair
67  void setNextNearestFaces
68  (
69  boolList& mapFlag,
70  label& startSeedI,
71  label& srcFacei,
72  label& tgtFacei
73  ) const;
74 
75  //- Find mapped source face
76  label findMappedSrcFace
77  (
78  const label tgtFacei,
79  const List<DynamicList<label>>& tgtToSrc
80  ) const;
81 
82 
83  // Evaluation
84 
85  //- Area of intersection between source and target faces
86  scalar interArea
87  (
88  const label srcFacei,
89  const label tgtFacei
90  ) const;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("mapNearestAMI");
97 
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const primitivePatch& srcPatch,
105  const primitivePatch& tgtPatch,
106  const scalarField& srcMagSf,
107  const scalarField& tgtMagSf,
109  const bool reverseTarget = false,
110  const bool requireMatch = true
111  );
112 
113  //- Disallow default bitwise copy construction
114  mapNearestAMI(const mapNearestAMI&) = delete;
115 
116 
117  //- Destructor
118  virtual ~mapNearestAMI();
119 
120 
121  // Member Functions
122 
123  // Manipulation
124 
125  //- Update addressing and weights
126  virtual void calculate
127  (
128  labelListList& srcAddress,
129  scalarListList& srcWeights,
130  labelListList& tgtAddress,
131  scalarListList& tgtWeights,
132  label srcFacei = -1,
133  label tgtFacei = -1
134  );
135 
136 
137  // Member Operators
138 
139  //- Disallow default bitwise assignment
140  void operator=(const mapNearestAMI&) = delete;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Nearest-mapping Arbitrary Mesh Interface (AMI) method.
Definition: mapNearestAMI.H:48
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 ~mapNearestAMI()
Destructor.
virtual void calculate(labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFacei=-1, label tgtFacei=-1)
Update addressing and weights.
TypeName("mapNearestAMI")
Runtime type information.
A list of faces which address into the list of points.
Base class for Arbitrary Mesh Interface (AMI) methods.
Definition: AMIMethod.H:55
mapNearestAMI(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget=false, const bool requireMatch=true)
Construct from components.
Namespace for OpenFOAM.
void operator=(const mapNearestAMI &)=delete
Disallow default bitwise assignment.