AMIInterpolation.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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2016-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::AMIInterpolation
29 
30 Description
31  Interpolation class dealing with transfer of data between two
32  primitive patches with an arbitrary mesh interface (AMI).
33 
34  Based on the algorithm given in:
35 
36  Conservative interpolation between volume meshes by local Galerkin
37  projection, Farrell PE and Maddison JR, 2011, Comput. Methods Appl.
38  Mech Engrg, Volume 200, Issues 1-4, pp 89-100
39 
40  Interpolation requires that the two patches should have opposite
41  orientations (opposite normals). The 'reverseTarget' flag can be used to
42  reverse the orientation of the target patch.
43 
44 SourceFiles
45  AMIInterpolation.C
46  AMIInterpolationName.C
47  AMIInterpolationParallelOps.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef AMIInterpolation_H
52 #define AMIInterpolation_H
53 
54 #include "className.H"
55 #include "searchableSurface.H"
56 #include "treeBoundBoxList.H"
57 #include "boolList.H"
58 #include "primitivePatch.H"
59 #include "faceAreaIntersect.H"
60 #include "globalIndex.H"
61 #include "ops.H"
62 #include "refPtr.H"
63 #include "Enum.H"
64 #include "pointList.H"
65 #include "indexedOctree.H"
66 #include "treeDataPrimitivePatch.H"
67 
68 #include "runTimeSelectionTables.H"
69 
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class AMIInterpolation Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class AMIInterpolation
81 {
82 public:
83 
84  // Public data types
85 
86  static bool cacheIntersections_;
87 
88 
89 protected:
90 
91  //- Local typedef to octree tree-type
93 
94  // Protected data
95 
96  //- Flag to indicate that the two patches must be matched/an overlap
97  //- exists between them
98  bool requireMatch_;
99 
100  //- Flag to indicate that the two patches are co-directional and
101  //- that the orientation of the target patch should be reversed
102  const bool reverseTarget_;
103 
104  //- Threshold weight below which interpolation is deactivated
105  const scalar lowWeightCorrection_;
106 
107  //- Index of processor that holds all of both sides. -1 in all other
108  //- cases
109  label singlePatchProc_;
110 
111 
112  // Source patch
113 
114  //- Source face areas
116 
117  //- Addresses of target faces per source face
119 
120  //- Weights of target faces per source face
122 
123  //- Sum of weights of target faces per source face
125 
126  //- Centroid of target faces per source face
128 
129  //- Source patch points if input points are manipulated, e.g.
130  //- projected
132 
133  //- Source patch using manipulated input points
135 
136  //- Source map pointer - parallel running only
138 
139 
140 
141  // Target patch
142 
143  //- Target face areas
145 
146  //- Addresses of source faces per target face
148 
149  //- Weights of source faces per target face
151 
152  //- Sum of weights of source faces per target face
154 
155  //- Centroid of source faces per target face
157 
158  //- Target patch points if input points are manipulated, e.g.
159  //- projected
161 
162  //- Target patch using manipulated input points
164 
165  //- Target map pointer - parallel running only
167 
168  //- Up-to-date flag
169  bool upToDate_;
170 
171 
172  // Protected Member Functions
173 
174  //- No copy assignment
175  void operator=(const AMIInterpolation&) = delete;
176 
177 
178  // Initialisation
179 
180  //- Reset the octree for the patch face search
182  (
183  const primitivePatch& patch
184  ) const;
185 
186  //- Calculate if patches are on multiple processors
187  label calcDistribution
188  (
189  const primitivePatch& srcPatch,
190  const primitivePatch& tgtPatch
191  ) const;
192 
193  //- Project points to surface
195  (
196  const searchableSurface& surf,
197  pointField& pts
198  ) const;
199 
200 
201  // Access
202 
203  //- Return the orginal src patch with optionally updated points
204  inline const primitivePatch& srcPatch0() const;
205 
206  //- Return the orginal tgt patch with optionally updated points
207  inline const primitivePatch& tgtPatch0() const;
208 
209 
210  // Evaluation
211 
212  //- Normalise the (area) weights - suppresses numerical error in
213  //- weights calculation
214  // NOTE: if area weights are incorrect by 'a significant amount'
215  // normalisation may stabilise the solution, but will introduce
216  // numerical error!
217  static void normaliseWeights
218  (
219  const scalarList& patchAreas,
220  const word& patchName,
221  const labelListList& addr,
222  scalarListList& wght,
223  scalarField& wghtSum,
224  const bool conformal,
225  const bool output,
226  const scalar lowWeightTol
227  );
228 
229 
230  // Constructor helpers
231 
232  static void agglomerate
233  (
234  const autoPtr<mapDistribute>& targetMap,
235  const scalarList& fineSrcMagSf,
236  const labelListList& fineSrcAddress,
237  const scalarListList& fineSrcWeights,
238 
239  const labelList& sourceRestrictAddressing,
240  const labelList& targetRestrictAddressing,
241 
247  );
248 
249 
250 public:
251 
252  //- Runtime type information
253  TypeName("AMIInterpolation");
254 
255  // Selection tables
256 
257  //- Selection table for dictionary construction
259  (
260  autoPtr,
262  dict,
263  (
264  const dictionary& dict,
265  const bool reverseTarget
266  ),
267  (
268  dict,
270  )
271  );
272 
273  //- Selection table for component-wise construction
275  (
276  autoPtr,
278  component,
279  (
280  const bool requireMatch,
281  const bool reverseTarget,
282  const scalar lowWeightCorrection
283  ),
284  (
285  requireMatch,
288  )
289  );
290 
291  //- Selector for dictionary
293  (
294  const word& modelName,
295  const dictionary& dict,
296  const bool reverseTarget = false
297  );
298 
299  //- Selector for components
301  (
302  const word& modelName,
303  const bool requireMatch = true,
304  const bool reverseTarget = false,
305  const scalar lowWeightCorrection = -1
306  );
307 
308 
309  // Constructors
310 
311  //- Construct from dictionary
313  (
314  const dictionary& dict,
315  const bool reverseTarget = false
316  );
317 
318  //- Construct from components
320  (
321  const bool requireMatch = true,
322  const bool reverseTarget = false,
323  const scalar lowWeightCorrection = -1
324  );
325 
326  //- Construct from agglomeration of AMIInterpolation. Agglomeration
327  //- passed in as new coarse size and addressing from fine from coarse
329  (
330  const AMIInterpolation& fineAMI,
331  const labelList& sourceRestrictAddressing,
332  const labelList& neighbourRestrictAddressing
333  );
334 
335  //- Construct as copy
337 
338  //- Construct and return a clone
339  virtual autoPtr<AMIInterpolation> clone() const
340  {
341  return autoPtr<AMIInterpolation>::New(*this);
342  }
343 
344 
345  //- Destructor
346  virtual ~AMIInterpolation() = default;
347 
348 
349  // Member Functions
350 
351  // Access
352 
353  //- Access to the up-to-date flag
354  inline bool upToDate() const;
355 
356  //- Access to the up-to-date flag
357  inline bool& upToDate();
358 
359  //- Access to the distributed flag
360  inline bool distributed() const;
361 
362  //- Access to the requireMatch flag
363  inline bool requireMatch() const;
364 
365  //- Access to the requireMatch flag
366  inline bool setRequireMatch(const bool flag);
367 
368  //- Return true if requireMatch and lowWeightCorrectionin active
369  inline bool mustMatchFaces() const;
370 
371  //- Access to the reverseTarget flag
372  inline bool reverseTarget() const;
373 
374  //- Threshold weight below which interpolation is deactivated
375  inline scalar lowWeightCorrection() const;
376 
377  //- Return true if employing a 'lowWeightCorrection'
378  inline bool applyLowWeightCorrection() const;
379 
380  //- Set to -1, or the processor holding all faces (both sides) of
381  //- the AMI
382  inline label singlePatchProc() const;
383 
384 
385  // Source patch
386 
387  //- Return const access to source patch face areas
388  inline const List<scalar>& srcMagSf() const;
389 
390  //- Return access to source patch face areas
391  inline List<scalar>& srcMagSf();
392 
393  //- Return const access to source patch addressing
394  inline const labelListList& srcAddress() const;
395 
396  //- Return access to source patch addressing
397  inline labelListList& srcAddress();
398 
399  //- Return const access to source patch weights
400  inline const scalarListList& srcWeights() const;
401 
402  //- Return access to source patch weights
403  inline scalarListList& srcWeights();
404 
405  //- Return const access to normalisation factor of source
406  //- patch weights (i.e. the sum before normalisation)
407  inline const scalarField& srcWeightsSum() const;
408 
409  //- Return access to normalisation factor of source
410  //- patch weights (i.e. the sum before normalisation)
411  inline scalarField& srcWeightsSum();
412 
413  //- Return const access to source patch face centroids
414  inline const pointListList& srcCentroids() const;
415 
416  //- Return access to source patch face centroids
417  inline pointListList& srcCentroids();
418 
419  //- Source map pointer - valid only if singlePatchProc = -1
420  //- This gets source data into a form to be consumed by
421  //- tgtAddress, tgtWeights
422  inline const mapDistribute& srcMap() const;
423 
424 
425  // Target patch
426 
427  //- Return const access to target patch face areas
428  inline const List<scalar>& tgtMagSf() const;
429 
430  //- Return access to target patch face areas
431  inline List<scalar>& tgtMagSf();
432 
433  //- Return const access to target patch addressing
434  inline const labelListList& tgtAddress() const;
435 
436  //- Return access to target patch addressing
437  inline labelListList& tgtAddress();
438 
439  //- Return const access to target patch weights
440  inline const scalarListList& tgtWeights() const;
441 
442  //- Return access to target patch weights
443  inline scalarListList& tgtWeights();
444 
445  //- Return const access to normalisation factor of target
446  //- patch weights (i.e. the sum before normalisation)
447  inline const scalarField& tgtWeightsSum() const;
448 
449  //- Return access to normalisation factor of target
450  //- patch weights (i.e. the sum before normalisation)
451  inline scalarField& tgtWeightsSum();
452 
453  //- Target map pointer - valid only if singlePatchProc=-1.
454  //- This gets target data into a form to be consumed by
455  //- srcAddress, srcWeights
456  inline const mapDistribute& tgtMap() const;
457 
458 
459  // Manipulation
460 
461  //- Update addressing, weights and (optional) centroids
462  virtual bool calculate
463  (
464  const primitivePatch& srcPatch,
465  const primitivePatch& tgtPatch,
466  const autoPtr<searchableSurface>& surfPtr = nullptr
467  );
468 
469  //- Set the maps, addresses and weights from an external source
470  void reset
471  (
472  autoPtr<mapDistribute>&& srcToTgtMap,
473  autoPtr<mapDistribute>&& tgtToSrcMap,
478  );
479 
480  //- Append additional addressing and weights
481  void append
482  (
483  const primitivePatch& srcPatch,
484  const primitivePatch& tgtPatch
485  );
486 
487  //- Normalise the weights
488  void normaliseWeights(const bool conformal, const bool output);
489 
490 
491  // Evaluation
492 
493  // Low-level
494 
495  //- Interpolate from target to source with supplied op
496  //- to combine existing value with remote value and weight
497  template<class Type, class CombineOp>
499  (
500  const UList<Type>& fld,
501  const CombineOp& cop,
502  List<Type>& result,
503  const UList<Type>& defaultValues = UList<Type>::null()
504  ) const;
505 
506  //- Interpolate from source to target with supplied op
507  //- to combine existing value with remote value and weight
508  template<class Type, class CombineOp>
510  (
511  const UList<Type>& fld,
512  const CombineOp& cop,
513  List<Type>& result,
514  const UList<Type>& defaultValues = UList<Type>::null()
515  ) const;
516 
517 
518  //- Interpolate from target to source with supplied op
519  template<class Type, class CombineOp>
521  (
522  const Field<Type>& fld,
523  const CombineOp& cop,
524  const UList<Type>& defaultValues = UList<Type>::null()
525  ) const;
526 
527  //- Interpolate from target tmp field to source with supplied op
528  template<class Type, class CombineOp>
530  (
531  const tmp<Field<Type>>& tFld,
532  const CombineOp& cop,
533  const UList<Type>& defaultValues = UList<Type>::null()
534  ) const;
535 
536  //- Interpolate from source to target with supplied op
537  template<class Type, class CombineOp>
539  (
540  const Field<Type>& fld,
541  const CombineOp& cop,
542  const UList<Type>& defaultValues = UList<Type>::null()
543  ) const;
544 
545  //- Interpolate from source tmp field to target with supplied op
546  template<class Type, class CombineOp>
548  (
549  const tmp<Field<Type>>& tFld,
550  const CombineOp& cop,
551  const UList<Type>& defaultValues = UList<Type>::null()
552  ) const;
553 
554  //- Interpolate from target to source
555  template<class Type>
557  (
558  const Field<Type>& fld,
559  const UList<Type>& defaultValues = UList<Type>::null()
560  ) const;
561 
562  //- Interpolate from target tmp field
563  template<class Type>
565  (
566  const tmp<Field<Type>>& tFld,
567  const UList<Type>& defaultValues = UList<Type>::null()
568  ) const;
569 
570  //- Interpolate from source to target
571  template<class Type>
573  (
574  const Field<Type>& fld,
575  const UList<Type>& defaultValues = UList<Type>::null()
576  ) const;
577 
578  //- Interpolate from source tmp field
579  template<class Type>
581  (
582  const tmp<Field<Type>>& tFld,
583  const UList<Type>& defaultValues = UList<Type>::null()
584  ) const;
585 
586 
587  // Point intersections
588 
589  //- Return source patch face index of point on target patch face
590  label srcPointFace
591  (
592  const primitivePatch& srcPatch,
593  const primitivePatch& tgtPatch,
594  const vector& n,
595  const label tgtFacei,
596  point& tgtPoint
597  )
598  const;
599 
600  //- Return target patch face index of point on source patch face
601  label tgtPointFace
602  (
603  const primitivePatch& srcPatch,
604  const primitivePatch& tgtPatch,
605  const vector& n,
606  const label srcFacei,
607  point& srcPoint
608  )
609  const;
610 
611 
612  // Checks
613 
614  //- Check if src addresses are present in tgt addresses and
615  //- viceversa
616  bool checkSymmetricWeights(const bool log) const;
617 
618  //- Write face connectivity as OBJ file
620  (
621  const primitivePatch& srcPatch,
622  const primitivePatch& tgtPatch,
624  ) const;
625 
626 
627  // I-O
628 
629  //- Write
630  virtual void write(Ostream& os) const;
631 };
632 
633 
634 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
635 
636 } // End namespace Foam
637 
638 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
639 
640 #include "AMIInterpolationI.H"
641 
642 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
643 
644 #ifdef NoRepository
645  #include "AMIInterpolationTemplates.C"
646 #endif
647 
648 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
649 
650 #endif
651 
652 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::AMIInterpolation::upToDate
bool upToDate() const
Access to the up-to-date flag.
Definition: AMIInterpolationI.H:56
Foam::AMIInterpolation::calculate
virtual bool calculate(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr)
Update addressing, weights and (optional) centroids.
Definition: AMIInterpolation.C:734
AMIInterpolationI.H
Foam::component
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Definition: FieldFieldFunctions.C:44
Foam::AMIInterpolation::tgtMapPtr_
autoPtr< mapDistribute > tgtMapPtr_
Target map pointer - parallel running only.
Definition: AMIInterpolation.H:165
Foam::output
static Ostream & output(Ostream &os, const IntRange< T > &range)
Definition: IntRanges.C:66
boolList.H
Foam::AMIInterpolation::srcWeights_
scalarListList srcWeights_
Weights of target faces per source face.
Definition: AMIInterpolation.H:120
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::AMIInterpolation::operator=
void operator=(const AMIInterpolation &)=delete
No copy assignment.
searchableSurface.H
Foam::AMIInterpolation::srcCentroids
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
Definition: AMIInterpolationI.H:165
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
refPtr.H
Foam::AMIInterpolation::srcPointFace
label srcPointFace(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const vector &n, const label tgtFacei, point &tgtPoint) const
Return source patch face index of point on target patch face.
Definition: AMIInterpolation.C:1050
Foam::AMIInterpolation::tgtWeightsSum
const scalarField & tgtWeightsSum() const
Definition: AMIInterpolationI.H:219
Foam::AMIInterpolation::distributed
bool distributed() const
Access to the distributed flag.
Definition: AMIInterpolationI.H:68
Foam::AMIInterpolation::tsrcPatch0_
refPtr< primitivePatch > tsrcPatch0_
Source patch using manipulated input points.
Definition: AMIInterpolation.H:133
Foam::AMIInterpolation::srcAddress_
labelListList srcAddress_
Addresses of target faces per source face.
Definition: AMIInterpolation.H:117
globalIndex.H
Foam::AMIInterpolation::singlePatchProc_
label singlePatchProc_
Definition: AMIInterpolation.H:108
Foam::AMIInterpolation::tgtWeights_
scalarListList tgtWeights_
Weights of source faces per target face.
Definition: AMIInterpolation.H:149
indexedOctree.H
Foam::AMIInterpolation::writeFaceConnectivity
void writeFaceConnectivity(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const labelListList &srcAddress) const
Write face connectivity as OBJ file.
Definition: AMIInterpolation.C:1212
ops.H
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
Foam::AMIInterpolation::srcWeightsSum
const scalarField & srcWeightsSum() const
Definition: AMIInterpolationI.H:153
Foam::AMIInterpolation::tgtPatchPts_
pointField tgtPatchPts_
Definition: AMIInterpolation.H:159
Foam::AMIInterpolation::srcPatchPts_
pointField srcPatchPts_
Definition: AMIInterpolation.H:130
Foam::AMIInterpolation::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, AMIInterpolation, dict,(const dictionary &dict, const bool reverseTarget),(dict, reverseTarget))
Selection table for dictionary construction.
Foam::AMIInterpolation::New
static autoPtr< AMIInterpolation > New(const word &modelName, const dictionary &dict, const bool reverseTarget=false)
Selector for dictionary.
Definition: AMIInterpolationNew.C:33
Foam::AMIInterpolation::setRequireMatch
bool setRequireMatch(const bool flag)
Access to the requireMatch flag.
Definition: AMIInterpolationI.H:80
Foam::AMIInterpolation::tgtAddress
const labelListList & tgtAddress() const
Return const access to target patch addressing.
Definition: AMIInterpolationI.H:195
Foam::AMIInterpolation::tgtWeights
const scalarListList & tgtWeights() const
Return const access to target patch weights.
Definition: AMIInterpolationI.H:207
Foam::AMIInterpolation::interpolateToTarget
void interpolateToTarget(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
Definition: AMIInterpolationTemplates.C:36
Foam::AMIInterpolation::lowWeightCorrection_
const scalar lowWeightCorrection_
Threshold weight below which interpolation is deactivated.
Definition: AMIInterpolation.H:104
faceAreaIntersect.H
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::AMIInterpolation::tgtMap
const mapDistribute & tgtMap() const
Definition: AMIInterpolationI.H:231
Foam::AMIInterpolation::calcDistribution
label calcDistribution(const primitivePatch &srcPatch, const primitivePatch &tgtPatch) const
Calculate if patches are on multiple processors.
Definition: AMIInterpolation.C:77
Foam::AMIInterpolation::interpolateToSource
void interpolateToSource(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
Definition: AMIInterpolationTemplates.C:122
Foam::Field< scalar >
Foam::AMIInterpolation::srcWeightsSum_
scalarField srcWeightsSum_
Sum of weights of target faces per source face.
Definition: AMIInterpolation.H:123
Foam::AMIInterpolation::cacheIntersections_
static bool cacheIntersections_
Definition: AMIInterpolation.H:85
Foam::AMIInterpolation::requireMatch_
bool requireMatch_
Definition: AMIInterpolation.H:97
Foam::AMIInterpolation::srcPatch0
const primitivePatch & srcPatch0() const
Return the orginal src patch with optionally updated points.
Definition: AMIInterpolationI.H:29
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:69
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Foam::AMIInterpolation::AMIInterpolation
AMIInterpolation(const dictionary &dict, const bool reverseTarget=false)
Construct from dictionary.
Definition: AMIInterpolation.C:550
pointList.H
AMIInterpolationTemplates.C
Foam::AMIInterpolation::write
virtual void write(Ostream &os) const
Write.
Definition: AMIInterpolation.C:1243
treeDataPrimitivePatch.H
Foam::AMIInterpolation::srcMapPtr_
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
Definition: AMIInterpolation.H:136
Foam::AMIInterpolation::requireMatch
bool requireMatch() const
Access to the requireMatch flag.
Definition: AMIInterpolationI.H:74
Foam::AMIInterpolation::clone
virtual autoPtr< AMIInterpolation > clone() const
Construct and return a clone.
Definition: AMIInterpolation.H:338
Foam::AMIInterpolation::~AMIInterpolation
virtual ~AMIInterpolation()=default
Destructor.
Foam::AMIInterpolation::append
void append(const primitivePatch &srcPatch, const primitivePatch &tgtPatch)
Append additional addressing and weights.
Definition: AMIInterpolation.C:839
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::AMIInterpolation::singlePatchProc
label singlePatchProc() const
Definition: AMIInterpolationI.H:111
Foam::AMIInterpolation::normaliseWeights
static void normaliseWeights(const scalarList &patchAreas, const word &patchName, const labelListList &addr, scalarListList &wght, scalarField &wghtSum, const bool conformal, const bool output, const scalar lowWeightTol)
Definition: AMIInterpolation.C:168
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::AMIInterpolation::tgtPatch0
const primitivePatch & tgtPatch0() const
Return the orginal tgt patch with optionally updated points.
Definition: AMIInterpolationI.H:42
Foam::AMIInterpolation::mustMatchFaces
bool mustMatchFaces() const
Return true if requireMatch and lowWeightCorrectionin active.
Definition: AMIInterpolationI.H:87
Foam::log
dimensionedScalar log(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:262
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::AMIInterpolation::srcMagSf
const List< scalar > & srcMagSf() const
Return const access to source patch face areas.
Definition: AMIInterpolationI.H:117
Foam::AMIInterpolation::TypeName
TypeName("AMIInterpolation")
Runtime type information.
Foam::AMIInterpolation::tgtCentroids_
pointListList tgtCentroids_
Centroid of source faces per target face.
Definition: AMIInterpolation.H:155
treeBoundBoxList.H
Foam::AMIInterpolation::srcCentroids_
pointListList srcCentroids_
Centroid of target faces per source face.
Definition: AMIInterpolation.H:126
Foam::AMIInterpolation::ttgtPatch0_
refPtr< primitivePatch > ttgtPatch0_
Target patch using manipulated input points.
Definition: AMIInterpolation.H:162
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::AMIInterpolation::lowWeightCorrection
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
Definition: AMIInterpolationI.H:99
Foam::AMIInterpolation::reset
void reset(autoPtr< mapDistribute > &&srcToTgtMap, autoPtr< mapDistribute > &&tgtToSrcMap, labelListList &&srcAddress, scalarListList &&srcWeights, labelListList &&tgtAddress, scalarListList &&tgtWeights)
Set the maps, addresses and weights from an external source.
Definition: AMIInterpolation.C:802
Foam::AMIInterpolation::srcMap
const mapDistribute & srcMap() const
Definition: AMIInterpolationI.H:177
Foam::AMIInterpolation::tgtAddress_
labelListList tgtAddress_
Addresses of source faces per target face.
Definition: AMIInterpolation.H:146
Foam::AMIInterpolation::applyLowWeightCorrection
bool applyLowWeightCorrection() const
Return true if employing a 'lowWeightCorrection'.
Definition: AMIInterpolationI.H:105
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::Vector< scalar >
Foam::AMIInterpolation::treeType
treeDataPrimitivePatch< primitivePatch > treeType
Local typedef to octree tree-type.
Definition: AMIInterpolation.H:91
Foam::AMIInterpolation::agglomerate
static void agglomerate(const autoPtr< mapDistribute > &targetMap, const scalarList &fineSrcMagSf, const labelListList &fineSrcAddress, const scalarListList &fineSrcWeights, const labelList &sourceRestrictAddressing, const labelList &targetRestrictAddressing, scalarList &srcMagSf, labelListList &srcAddress, scalarListList &srcWeights, scalarField &srcWeightsSum, autoPtr< mapDistribute > &tgtMap)
Definition: AMIInterpolation.C:246
Foam::AMIInterpolation::tgtWeightsSum_
scalarField tgtWeightsSum_
Sum of weights of source faces per target face.
Definition: AMIInterpolation.H:152
Foam::treeDataPrimitivePatch
Encapsulation of data needed to search on PrimitivePatches.
Definition: treeDataPrimitivePatch.H:63
Foam::List< scalar >
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:79
Foam::UList< Type >
Foam::AMIInterpolation::srcMagSf_
scalarList srcMagSf_
Source face areas.
Definition: AMIInterpolation.H:114
Foam::AMIInterpolation::checkSymmetricWeights
bool checkSymmetricWeights(const bool log) const
Definition: AMIInterpolation.C:1148
Foam::AMIInterpolation::upToDate_
bool upToDate_
Up-to-date flag.
Definition: AMIInterpolation.H:168
Foam::AMIInterpolation::reverseTarget_
const bool reverseTarget_
Definition: AMIInterpolation.H:101
Foam::AMIInterpolation::reverseTarget
bool reverseTarget() const
Access to the reverseTarget flag.
Definition: AMIInterpolationI.H:93
Foam::AMIInterpolation::projectPointsToSurface
void projectPointsToSurface(const searchableSurface &surf, pointField &pts) const
Project points to surface.
Definition: AMIInterpolation.C:128
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::AMIInterpolation::tgtMagSf
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
Definition: AMIInterpolationI.H:183
Foam::AMIInterpolation::tgtMagSf_
scalarList tgtMagSf_
Target face areas.
Definition: AMIInterpolation.H:143
primitivePatch.H
Foam::AMIInterpolation::tgtPointFace
label tgtPointFace(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const vector &n, const label srcFacei, point &srcPoint) const
Return target patch face index of point on source patch face.
Definition: AMIInterpolation.C:1099
Foam::AMIInterpolation::createTree
autoPtr< indexedOctree< treeType > > createTree(const primitivePatch &patch) const
Reset the octree for the patch face search.
Definition: AMIInterpolation.C:53
Foam::AMIInterpolation::srcAddress
const labelListList & srcAddress() const
Return const access to source patch addressing.
Definition: AMIInterpolationI.H:129
Foam::AMIInterpolation::srcWeights
const scalarListList & srcWeights() const
Return const access to source patch weights.
Definition: AMIInterpolationI.H:141
Foam::refPtr
A class for managing references or pointers (no reference counting)
Definition: PtrList.H:60
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79
Enum.H