mapNearestAMI.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-2014 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 template<class SourcePatch, class TargetPatch>
50 class mapNearestAMI
51 :
52  public AMIMethod<SourcePatch, TargetPatch>
53 {
54 
55 private:
56 
57  // Private Member Functions
58 
59  //- Disallow default bitwise copy construct
61 
62  //- Disallow default bitwise assignment
63  void operator=(const mapNearestAMI&);
64 
65  // Marching front
66 
67  //- Find nearest target face for source face srcFaceI
68  void findNearestFace
69  (
70  const SourcePatch& srcPatch,
71  const TargetPatch& tgtPatch,
72  const label& srcFaceI,
73  label& tgtFaceI
74  ) const;
75 
76  //- Determine next source-target face pair
78  (
79  boolList& mapFlag,
80  label& startSeedI,
81  label& srcFaceI,
82  label& tgtFaceI
83  ) const;
84 
85  //- Find mapped source face
87  (
88  const label tgtFaceI,
89  const List<DynamicList<label> >& tgtToSrc
90  ) const;
91 
92 
93  // Evaluation
94 
95  //- Area of intersection between source and target faces
96  scalar interArea
97  (
98  const label srcFaceI,
99  const label tgtFaceI
100  ) const;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("mapNearestAMI");
107 
108 
109  // Constructors
110 
111  //- Construct from components
113  (
114  const SourcePatch& srcPatch,
115  const TargetPatch& tgtPatch,
116  const scalarField& srcMagSf,
117  const scalarField& tgtMagSf,
119  const bool reverseTarget = false,
120  const bool requireMatch = true
121  );
122 
123 
124  //- Destructor
125  virtual ~mapNearestAMI();
126 
127 
128  // Member Functions
129 
130  // Manipulation
131 
132  //- Update addressing and weights
133  virtual void calculate
134  (
135  labelListList& srcAddress,
136  scalarListList& srcWeights,
137  labelListList& tgtAddress,
138  scalarListList& tgtWeights,
139  label srcFaceI = -1,
140  label tgtFaceI = -1
141  );
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #ifdef NoRepository
152 # include "mapNearestAMI.C"
153 #endif
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Foam::mapNearestAMI::interArea
scalar interArea(const label srcFaceI, const label tgtFaceI) const
Area of intersection between source and target faces.
Foam::faceAreaIntersect::triangulationMode
triangulationMode
Definition: faceAreaIntersect.H:59
Foam::DynamicList< label >
Foam::mapNearestAMI::mapNearestAMI
mapNearestAMI(const mapNearestAMI &)
Disallow default bitwise copy construct.
mapNearestAMI.C
Foam::mapNearestAMI
Nearest-mapping Arbitrary Mesh Interface (AMI) method.
Definition: mapNearestAMI.H:49
Foam::AMIMethod
Base class for Arbitrary Mesh Interface (AMI) methods.
Definition: AMIMethod.H:55
Foam::mapNearestAMI::~mapNearestAMI
virtual ~mapNearestAMI()
Destructor.
Definition: mapNearestAMI.C:198
Foam::mapNearestAMI::calculate
virtual void calculate(labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFaceI=-1, label tgtFaceI=-1)
Update addressing and weights.
Definition: mapNearestAMI.C:206
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:59
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::mapNearestAMI::findNearestFace
void findNearestFace(const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const label &srcFaceI, label &tgtFaceI) const
Find nearest target face for source face srcFaceI.
Definition: mapNearestAMI.C:32
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::mapNearestAMI::setNextNearestFaces
void setNextNearestFaces(boolList &mapFlag, label &startSeedI, label &srcFaceI, label &tgtFaceI) const
Determine next source-target face pair.
Definition: mapNearestAMI.C:77
Foam::List
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
AMIMethod.H
Foam::mapNearestAMI::operator=
void operator=(const mapNearestAMI &)
Disallow default bitwise assignment.
Foam::mapNearestAMI::TypeName
TypeName("mapNearestAMI")
Runtime type information.
Foam::mapNearestAMI::findMappedSrcFace
label findMappedSrcFace(const label tgtFaceI, const List< DynamicList< label > > &tgtToSrc) const
Find mapped source face.
Definition: mapNearestAMI.C:125