partialFaceAreaWeightAMI.C
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 \*---------------------------------------------------------------------------*/
25 
27 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 template<class SourcePatch, class TargetPatch>
32 (
33  label& startSeedI,
34  label& srcFacei,
35  label& tgtFacei,
36  const boolList& mapFlag,
37  labelList& seedFaces,
38  const DynamicList<label>& visitedFaces,
39  const bool errorOnNotFound
40 ) const
41 {
42  faceAreaWeightAMI<SourcePatch, TargetPatch>::setNextFaces
43  (
44  startSeedI,
45  srcFacei,
46  tgtFacei,
47  mapFlag,
48  seedFaces,
49  visitedFaces,
50  false // no error on not found
51  );
52 }
53 
54 
55 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 
57 template<class SourcePatch, class TargetPatch>
60 (
61  const SourcePatch& srcPatch,
62  const TargetPatch& tgtPatch,
63  const scalarField& srcMagSf,
64  const scalarField& tgtMagSf,
66  const bool reverseTarget,
67  const bool requireMatch
68 )
69 :
71  (
72  srcPatch,
73  tgtPatch,
74  srcMagSf,
75  tgtMagSf,
76  triMode,
77  reverseTarget,
78  requireMatch
79  )
80 {}
81 
82 
83 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
84 
85 template<class SourcePatch, class TargetPatch>
88 {}
89 
90 
91 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
92 
93 template<class SourcePatch, class TargetPatch>
95 {
96  return false;
97 }
98 
99 
100 template<class SourcePatch, class TargetPatch>
102 (
103  labelListList& srcAddress,
104  scalarListList& srcWeights,
105  labelListList& tgtAddress,
106  scalarListList& tgtWeights,
107  label srcFacei,
108  label tgtFacei
109 )
110 {
111  bool ok =
112  this->initialise
113  (
114  srcAddress,
115  srcWeights,
116  tgtAddress,
117  tgtWeights,
118  srcFacei,
119  tgtFacei
120  );
121 
122  if (!ok)
123  {
124  return;
125  }
126 
127  // temporary storage for addressing and weights
128  List<DynamicList<label>> srcAddr(this->srcPatch_.size());
129  List<DynamicList<scalar>> srcWght(srcAddr.size());
130  List<DynamicList<label>> tgtAddr(this->tgtPatch_.size());
131  List<DynamicList<scalar>> tgtWght(tgtAddr.size());
132 
134  (
135  srcAddr,
136  srcWght,
137  tgtAddr,
138  tgtWght,
139  srcFacei,
140  tgtFacei
141  );
142 
143  // transfer data to persistent storage
144  forAll(srcAddr, i)
145  {
146  srcAddress[i].transfer(srcAddr[i]);
147  srcWeights[i].transfer(srcWght[i]);
148  }
149  forAll(tgtAddr, i)
150  {
151  tgtAddress[i].transfer(tgtAddr[i]);
152  tgtWeights[i].transfer(tgtWght[i]);
153  }
154 }
155 
156 
157 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
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 bool conformal() const
Flag to indicate that interpolation patches are conformal.
virtual ~partialFaceAreaWeightAMI()
Destructor.
List< bool > boolList
Bool container classes.
Definition: boolList.H:50
Face area weighted Arbitrary Mesh Interface (AMI) method.
virtual void calculate(labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFacei=-1, label tgtFacei=-1)
Update addressing and weights.
Partial face area weighted Arbitrary Mesh Interface (AMI) method.
List< label > labelList
A List of labels.
Definition: labelList.H:56
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Definition: List.C:342