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-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 \*---------------------------------------------------------------------------*/
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 {
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 // ************************************************************************* //
Foam::partialFaceAreaWeightAMI::conformal
virtual bool conformal() const
Flag to indicate that interpolation patches are conformal.
Definition: partialFaceAreaWeightAMI.C:94
Foam::partialFaceAreaWeightAMI::~partialFaceAreaWeightAMI
virtual ~partialFaceAreaWeightAMI()
Destructor.
Definition: partialFaceAreaWeightAMI.C:87
Foam::partialFaceAreaWeightAMI::partialFaceAreaWeightAMI
partialFaceAreaWeightAMI(const partialFaceAreaWeightAMI &)
Disallow default bitwise copy construct.
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::faceAreaIntersect::triangulationMode
triangulationMode
Definition: faceAreaIntersect.H:59
Foam::DynamicList< label >
Foam::List::transfer
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Foam::partialFaceAreaWeightAMI::calculate
virtual void calculate(labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFaceI=-1, label tgtFaceI=-1)
Update addressing and weights.
Definition: partialFaceAreaWeightAMI.C:102
Foam::faceAreaWeightAMI
Face area weighted Arbitrary Mesh Interface (AMI) method.
Definition: faceAreaWeightAMI.H:49
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::partialFaceAreaWeightAMI::setNextFaces
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.
Definition: partialFaceAreaWeightAMI.C:32
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
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
partialFaceAreaWeightAMI.H