faceAreaWeightAMI.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::faceAreaWeightAMI
26 
27 Description
28  Face area weighted Arbitrary Mesh Interface (AMI) method
29 
30 SourceFiles
31  faceAreaWeightAMI.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef faceAreaWeightAMI_H
36 #define faceAreaWeightAMI_H
37 
38 #include "AMIMethod.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class faceAreaWeightAMI Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 :
51  public AMIMethod
52 {
53  // Private Data
54 
55  //- Flag to restart uncovered source faces
56  const bool restartUncoveredSourceFace_;
57 
58 
59 protected:
60 
61  // Protected Member Functions
62 
63  // Marching front
64 
65  //- Calculate addressing and weights using temporary storage
66  virtual void calcAddressing
67  (
68  List<DynamicList<label>>& srcAddress,
69  List<DynamicList<scalar>>& srcWeights,
70  List<DynamicList<label>>& tgtAddress,
71  List<DynamicList<scalar>>& tgtWeights,
72  label srcFacei,
73  label tgtFacei
74  );
75 
76  //- Determine overlap contributions for source face srcFacei
77  virtual bool processSourceFace
78  (
79  const label srcFacei,
80  const label tgtStartFacei,
81  DynamicList<label>& nbrFaces,
82  DynamicList<label>& visitedFaces,
83  List<DynamicList<label>>& srcAddr,
84  List<DynamicList<scalar>>& srcWght,
85  List<DynamicList<label>>& tgtAddr,
86  List<DynamicList<scalar>>& tgtWght
87  );
88 
89  //- Attempt to re-evaluate source faces that have not been included
90  virtual void restartUncoveredSourceFace
91  (
92  List<DynamicList<label>>& srcAddr,
93  List<DynamicList<scalar>>& srcWght,
94  List<DynamicList<label>>& tgtAddr,
95  List<DynamicList<scalar>>& tgtWght
96  );
97 
98  //- Set the source and target seed faces
99  virtual void setNextFaces
100  (
101  label& startSeedI,
102  label& srcFacei,
103  label& tgtFacei,
104  const boolList& mapFlag,
105  labelList& seedFaces,
106  const DynamicList<label>& visitedFaces,
107  bool errorOnNotFound = true
108  ) const;
109 
110 
111  // Evaluation
112 
113  //- The minimum weight below which connections are discarded
114  virtual scalar minWeight() const;
115 
116  //- Area of intersection between source and target faces
117  virtual scalar interArea
118  (
119  const label srcFacei,
120  const label tgtFacei
121  ) const;
122 
123 
124 public:
125 
126  //- Runtime type information
127  TypeName("faceAreaWeightAMI");
128 
129 
130  // Constructors
131 
132  //- Construct from components
134  (
135  const primitivePatch& srcPatch,
136  const primitivePatch& tgtPatch,
137  const scalarField& srcMagSf,
138  const scalarField& tgtMagSf,
140  const bool reverseTarget = false,
141  const bool requireMatch = true,
142  const bool restartUncoveredSourceFace = true
143  );
144 
145  //- Disallow default bitwise copy construction
146  faceAreaWeightAMI(const faceAreaWeightAMI&) = delete;
147 
148 
149  //- Destructor
150  virtual ~faceAreaWeightAMI();
151 
152 
153  // Member Functions
154 
155  // Manipulation
156 
157  //- Update addressing and weights
158  virtual void calculate
159  (
160  labelListList& srcAddress,
161  scalarListList& srcWeights,
162  labelListList& tgtAddress,
163  scalarListList& tgtWeights,
164  label srcFacei = -1,
165  label tgtFacei = -1
166  );
167 
168 
169  // Member Operators
170 
171  //- Disallow default bitwise assignment
172  void operator=(const faceAreaWeightAMI&) = delete;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
virtual void calcAddressing(List< DynamicList< label >> &srcAddress, List< DynamicList< scalar >> &srcWeights, List< DynamicList< label >> &tgtAddress, List< DynamicList< scalar >> &tgtWeights, label srcFacei, label tgtFacei)
Calculate addressing and weights using temporary storage.
virtual scalar interArea(const label srcFacei, const label tgtFacei) const
Area of intersection between source and target faces.
virtual bool processSourceFace(const label srcFacei, const label tgtStartFacei, DynamicList< label > &nbrFaces, DynamicList< label > &visitedFaces, List< DynamicList< label >> &srcAddr, List< DynamicList< scalar >> &srcWght, List< DynamicList< label >> &tgtAddr, List< DynamicList< scalar >> &tgtWght)
Determine overlap contributions for source face srcFacei.
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
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
virtual ~faceAreaWeightAMI()
Destructor.
virtual void calculate(labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFacei=-1, label tgtFacei=-1)
Update addressing and weights.
TypeName("faceAreaWeightAMI")
Runtime type information.
Face area weighted Arbitrary Mesh Interface (AMI) method.
virtual scalar minWeight() const
The minimum weight below which connections are discarded.
A list of faces which address into the list of points.
void operator=(const faceAreaWeightAMI &)=delete
Disallow default bitwise assignment.
virtual void setNextFaces(label &startSeedI, label &srcFacei, label &tgtFacei, const boolList &mapFlag, labelList &seedFaces, const DynamicList< label > &visitedFaces, bool errorOnNotFound=true) const
Set the source and target seed faces.
Base class for Arbitrary Mesh Interface (AMI) methods.
Definition: AMIMethod.H:55
virtual void restartUncoveredSourceFace(List< DynamicList< label >> &srcAddr, List< DynamicList< scalar >> &srcWght, List< DynamicList< label >> &tgtAddr, List< DynamicList< scalar >> &tgtWght)
Attempt to re-evaluate source faces that have not been included.
faceAreaWeightAMI(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget=false, const bool requireMatch=true, const bool restartUncoveredSourceFace=true)
Construct from components.
Namespace for OpenFOAM.