directAMI.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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::directAMI
28 
29 Description
30  Direct mapped Arbitrary Mesh Interface (AMI) method
31 
32 SourceFiles
33  directAMI.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef directAMI_H
38 #define directAMI_H
39 
40 #include "AMIMethod.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class directAMI Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class SourcePatch, class TargetPatch>
52 class directAMI
53 :
54  public AMIMethod<SourcePatch, TargetPatch>
55 {
56 
57 private:
58 
59  // Private Member Functions
60 
61  //- No copy construct
62  directAMI(const directAMI&) = delete;
63 
64  //- No copy assignment
65  void operator=(const directAMI&) = delete;
66 
67  // Marching front
68 
69  //- Append to list of src face seed indices
70  void appendToDirectSeeds
71  (
72  labelList& mapFlag,
73  labelList& srcTgtSeed,
74  DynamicList<label>& srcSeeds,
75  DynamicList<label>& nonOverlapFaces,
76  label& srcFacei,
77  label& tgtFacei
78  ) const;
79 
80  //- Restart the advancing front - typically happens for
81  // disconnected regions
82  void restartAdvancingFront
83  (
84  labelList& mapFlag,
85  DynamicList<label>& nonOverlapFaces,
86  label& srcFacei,
87  label& tgtFacei
88  ) const;
89 
90 
91  // Evaluation
92 
93  //- Area of intersection between source and target faces
94  scalar interArea
95  (
96  const label srcFacei,
97  const label tgtFacei
98  ) const;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("directAMI");
105 
106 
107  // Constructors
108 
109  //- Construct from components
110  directAMI
111  (
112  const SourcePatch& srcPatch,
113  const TargetPatch& tgtPatch,
115  const bool reverseTarget = false,
116  const bool requireMatch = true
117  );
118 
119 
120  //- Destructor
121  virtual ~directAMI();
122 
123 
124  // Member Functions
125 
126  // Manipulation
127 
128  //- Update addressing and weights
129  virtual void calculate
130  (
131  labelListList& srcAddress,
132  scalarListList& srcWeights,
133  labelListList& tgtAddress,
134  scalarListList& tgtWeights,
135  label srcFacei = -1,
136  label tgtFacei = -1
137  );
138 
139  //- Set the face areas for parallel runs
140  virtual void setMagSf
141  (
142  const TargetPatch& tgtPatch,
143  const mapDistribute& map,
146  ) const;
147 
148  //- Normalise the weight. Can optionally subset addressing
149  // (e.g. for mapNearest)
150  virtual void normaliseWeights
151  (
152  const bool verbose,
154  );
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #ifdef NoRepository
165  #include "directAMI.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Foam::faceAreaIntersect::triangulationMode
triangulationMode
Definition: faceAreaIntersect.H:62
Foam::DynamicList< label >
Foam::directAMI::normaliseWeights
virtual void normaliseWeights(const bool verbose, AMIInterpolation< SourcePatch, TargetPatch > &inter)
Normalise the weight. Can optionally subset addressing.
Definition: directAMI.C:334
Foam::AMIMethod::tgtMagSf
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
Definition: AMIMethodI.H:46
Foam::directAMI::setMagSf
virtual void setMagSf(const TargetPatch &tgtPatch, const mapDistribute &map, scalarList &srcMagSf, scalarList &tgtMagSf) const
Set the face areas for parallel runs.
Definition: directAMI.C:320
Foam::AMIMethod
Base class for Arbitrary Mesh Interface (AMI) methods.
Definition: AMIMethod.H:60
Foam::directAMI
Direct mapped Arbitrary Mesh Interface (AMI) method.
Definition: directAMI.H:51
Foam::directAMI::~directAMI
virtual ~directAMI()
Destructor.
Definition: directAMI.C:211
Foam::directAMI::TypeName
TypeName("directAMI")
Runtime type information.
Foam::directAMI::calculate
virtual void calculate(labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFacei=-1, label tgtFacei=-1)
Update addressing and weights.
Definition: directAMI.C:219
Foam::label
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:62
Foam::AMIMethod::srcMagSf
const List< scalar > & srcMagSf() const
Return const access to source patch face areas.
Definition: AMIMethodI.H:30
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:81
AMIMethod.H
directAMI.C