isoSurfacePointTemplates.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2018-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 \*---------------------------------------------------------------------------*/
28 
29 #include "isoSurfacePoint.H"
30 #include "polyMesh.H"
31 #include "syncTools.H"
32 #include "surfaceFields.H"
33 #include "OFstream.H"
34 #include "meshTools.H"
35 
36 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
37 
38 template<class Type>
40 <
41  Type,
45 >>
46 Foam::isoSurfacePoint::adaptPatchFields
47 (
49 ) const
50 {
51  typedef SlicedGeometricField
52  <
53  Type,
56  volMesh
57  > FieldType;
58 
59  auto tslice = tmp<FieldType>::New
60  (
61  IOobject
62  (
63  fld.name(),
64  fld.instance(),
65  fld.db(),
66  IOobject::NO_READ,
67  IOobject::NO_WRITE,
68  false
69  ),
70  fld, // internal field
71  true // preserveCouples
72  );
73  auto& sliceFld = tslice.ref();
74 
75  const fvMesh& mesh = fld.mesh();
76 
77  const polyBoundaryMesh& patches = mesh.boundaryMesh();
78 
79  auto& sliceFldBf = sliceFld.boundaryFieldRef();
80 
81  forAll(patches, patchi)
82  {
83  const polyPatch& pp = patches[patchi];
84 
85  if
86  (
87  isA<emptyPolyPatch>(pp)
88  && pp.size() != sliceFldBf[patchi].size()
89  )
90  {
91  // Clear old value. Cannot resize it since is a slice.
92  sliceFldBf.set(patchi, nullptr);
93 
94  // Set new value we can change
95  sliceFldBf.set
96  (
97  patchi,
99  (
100  mesh.boundary()[patchi],
101  sliceFld
102  )
103  );
104 
105  // Note: cannot use patchInternalField since uses emptyFvPatch::size
106  // Do our own internalField instead.
107  const labelUList& faceCells =
108  mesh.boundary()[patchi].patch().faceCells();
109 
110  Field<Type>& pfld = sliceFldBf[patchi];
111  pfld.setSize(faceCells.size());
112  forAll(faceCells, i)
113  {
114  pfld[i] = sliceFld[faceCells[i]];
115  }
116  }
117  else if (isA<cyclicPolyPatch>(pp))
118  {
119  // Already has interpolate as value
120  }
121  else if (isA<processorPolyPatch>(pp))
122  {
123  fvPatchField<Type>& pfld = const_cast<fvPatchField<Type>&>
124  (
125  sliceFldBf[patchi]
126  );
127 
128  const scalarField& w = mesh.weights().boundaryField()[patchi];
129 
130  tmp<Field<Type>> f =
131  w*pfld.patchInternalField()
132  + (1.0-w)*pfld.patchNeighbourField();
133 
134  bitSet isCollocated
135  (
136  collocatedFaces(refCast<const processorPolyPatch>(pp))
137  );
138 
139  forAll(isCollocated, i)
140  {
141  if (!isCollocated[i])
142  {
143  pfld[i] = f()[i];
144  }
145  }
146  }
147  }
148  return tslice;
149 }
150 
151 
152 template<class Type>
153 Type Foam::isoSurfacePoint::generatePoint
154 (
155  const scalar s0,
156  const Type& p0,
157  const bool hasSnap0,
158  const Type& snapP0,
159 
160  const scalar s1,
161  const Type& p1,
162  const bool hasSnap1,
163  const Type& snapP1
164 ) const
165 {
166  const scalar d = s1-s0;
167 
168  if (mag(d) > VSMALL)
169  {
170  const scalar s = (iso_-s0)/d;
171 
172  if (hasSnap1 && s >= 0.5 && s <= 1)
173  {
174  return snapP1;
175  }
176  else if (hasSnap0 && s >= 0.0 && s <= 0.5)
177  {
178  return snapP0;
179  }
180  else
181  {
182  return s*p1 + (1.0-s)*p0;
183  }
184  }
185  else
186  {
187  constexpr scalar s = 0.4999;
188 
189  return s*p1 + (1.0-s)*p0;
190  }
191 }
192 
193 
194 template<class Type>
195 void Foam::isoSurfacePoint::generateTriPoints
196 (
197  const scalar s0,
198  const Type& p0,
199  const bool hasSnap0,
200  const Type& snapP0,
201 
202  const scalar s1,
203  const Type& p1,
204  const bool hasSnap1,
205  const Type& snapP1,
206 
207  const scalar s2,
208  const Type& p2,
209  const bool hasSnap2,
210  const Type& snapP2,
211 
212  const scalar s3,
213  const Type& p3,
214  const bool hasSnap3,
215  const Type& snapP3,
216 
217  DynamicList<Type>& pts
218 ) const
219 {
220  // Note: cannot use simpler isoSurfaceCell::generateTriPoints since
221  // the need here to sometimes pass in remote 'snappedPoints'
222 
223  int triIndex = 0;
224  if (s0 < iso_)
225  {
226  triIndex |= 1;
227  }
228  if (s1 < iso_)
229  {
230  triIndex |= 2;
231  }
232  if (s2 < iso_)
233  {
234  triIndex |= 4;
235  }
236  if (s3 < iso_)
237  {
238  triIndex |= 8;
239  }
240 
241  // Form the vertices of the triangles for each case
242  switch (triIndex)
243  {
244  case 0x00:
245  case 0x0F:
246  break;
247 
248  case 0x01:
249  case 0x0E:
250  {
251  pts.append
252  (
253  generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1)
254  );
255  pts.append
256  (
257  generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
258  );
259  pts.append
260  (
261  generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
262  );
263  if (triIndex == 0x0E)
264  {
265  // Flip normals
266  const label sz = pts.size();
267  std::swap(pts[sz-2], pts[sz-1]);
268  }
269  }
270  break;
271 
272  case 0x02:
273  case 0x0D:
274  {
275  pts.append
276  (
277  generatePoint(s1,p1,hasSnap1,snapP1,s0,p0,hasSnap0,snapP0)
278  );
279  pts.append
280  (
281  generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
282  );
283  pts.append
284  (
285  generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
286  );
287  if (triIndex == 0x0D)
288  {
289  // Flip normals
290  const label sz = pts.size();
291  std::swap(pts[sz-2], pts[sz-1]);
292  }
293  }
294  break;
295 
296  case 0x03:
297  case 0x0C:
298  {
299  Type p0p2 =
300  generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2);
301  Type p1p3 =
302  generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3);
303 
304  pts.append
305  (
306  generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
307  );
308  pts.append(p1p3);
309  pts.append(p0p2);
310 
311  pts.append(p1p3);
312  pts.append
313  (
314  generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
315  );
316  pts.append(p0p2);
317 
318  if (triIndex == 0x0C)
319  {
320  // Flip normals
321  const label sz = pts.size();
322  std::swap(pts[sz-5], pts[sz-4]);
323  std::swap(pts[sz-2], pts[sz-1]);
324  }
325  }
326  break;
327 
328  case 0x04:
329  case 0x0B:
330  {
331  pts.append
332  (
333  generatePoint(s2,p2,hasSnap2,snapP2,s0,p0,hasSnap0,snapP0)
334  );
335  pts.append
336  (
337  generatePoint(s2,p2,hasSnap2,snapP2,s1,p1,hasSnap1,snapP1)
338  );
339  pts.append
340  (
341  generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3)
342  );
343 
344  if (triIndex == 0x0B)
345  {
346  // Flip normals
347  const label sz = pts.size();
348  std::swap(pts[sz-2], pts[sz-1]);
349  }
350  }
351  break;
352 
353  case 0x05:
354  case 0x0A:
355  {
356  Type p0p1 =
357  generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
358  Type p2p3 =
359  generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
360 
361  pts.append(p0p1);
362  pts.append(p2p3);
363  pts.append
364  (
365  generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
366  );
367 
368  pts.append(p0p1);
369  pts.append
370  (
371  generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
372  );
373  pts.append(p2p3);
374 
375  if (triIndex == 0x0A)
376  {
377  // Flip normals
378  const label sz = pts.size();
379  std::swap(pts[sz-5], pts[sz-4]);
380  std::swap(pts[sz-2], pts[sz-1]);
381  }
382  }
383  break;
384 
385  case 0x06:
386  case 0x09:
387  {
388  Type p0p1 =
389  generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
390  Type p2p3 =
391  generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
392 
393  pts.append(p0p1);
394  pts.append
395  (
396  generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
397  );
398  pts.append(p2p3);
399 
400  pts.append(p0p1);
401  pts.append(p2p3);
402  pts.append
403  (
404  generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
405  );
406 
407  if (triIndex == 0x09)
408  {
409  // Flip normals
410  const label sz = pts.size();
411  std::swap(pts[sz-5], pts[sz-4]);
412  std::swap(pts[sz-2], pts[sz-1]);
413  }
414  }
415  break;
416 
417  case 0x08:
418  case 0x07:
419  {
420  pts.append
421  (
422  generatePoint(s3,p3,hasSnap3,snapP3,s0,p0,hasSnap0,snapP0)
423  );
424  pts.append
425  (
426  generatePoint(s3,p3,hasSnap3,snapP3,s2,p2,hasSnap2,snapP2)
427  );
428  pts.append
429  (
430  generatePoint(s3,p3,hasSnap3,snapP3,s1,p1,hasSnap1,snapP1)
431  );
432 
433  if (triIndex == 0x07)
434  {
435  // Flip normals
436  const label sz = pts.size();
437  std::swap(pts[sz-2], pts[sz-1]);
438  }
439  }
440  break;
441  }
442 }
443 
444 
445 template<class Type>
446 Foam::label Foam::isoSurfacePoint::generateFaceTriPoints
447 (
448  const volScalarField& cVals,
449  const scalarField& pVals,
450 
452  const Field<Type>& pCoords,
453 
454  const DynamicList<Type>& snappedPoints,
455  const labelList& snappedCc,
456  const labelList& snappedPoint,
457  const label facei,
458 
459  const scalar neiVal,
460  const Type& neiPt,
461  const bool hasNeiSnap,
462  const Type& neiSnapPt,
463 
465  DynamicList<label>& triMeshCells
466 ) const
467 {
468  const label own = mesh_.faceOwner()[facei];
469 
470  label oldNPoints = triPoints.size();
471 
472  const face& f = mesh_.faces()[facei];
473 
474  forAll(f, fp)
475  {
476  label pointi = f[fp];
477  label nextPointi = f[f.fcIndex(fp)];
478 
479  generateTriPoints
480  (
481  pVals[pointi],
482  pCoords[pointi],
483  snappedPoint[pointi] != -1,
484  (
485  snappedPoint[pointi] != -1
486  ? snappedPoints[snappedPoint[pointi]]
487  : Type(Zero)
488  ),
489 
490  pVals[nextPointi],
491  pCoords[nextPointi],
492  snappedPoint[nextPointi] != -1,
493  (
494  snappedPoint[nextPointi] != -1
495  ? snappedPoints[snappedPoint[nextPointi]]
496  : Type(Zero)
497  ),
498 
499  cVals[own],
500  cCoords[own],
501  snappedCc[own] != -1,
502  (
503  snappedCc[own] != -1
504  ? snappedPoints[snappedCc[own]]
505  : Type(Zero)
506  ),
507 
508  neiVal,
509  neiPt,
510  hasNeiSnap,
511  neiSnapPt,
512 
513  triPoints
514  );
515  }
516 
517  // Every three triPoints is a triangle
518  label nTris = (triPoints.size()-oldNPoints)/3;
519  for (label i = 0; i < nTris; i++)
520  {
521  triMeshCells.append(own);
522  }
523 
524  return nTris;
525 }
526 
527 
528 template<class Type>
529 void Foam::isoSurfacePoint::generateTriPoints
530 (
531  const volScalarField& cVals,
532  const scalarField& pVals,
533 
535  const Field<Type>& pCoords,
536 
537  const DynamicList<Type>& snappedPoints,
538  const labelList& snappedCc,
539  const labelList& snappedPoint,
540 
542  DynamicList<label>& triMeshCells
543 ) const
544 {
545  const polyBoundaryMesh& patches = mesh_.boundaryMesh();
546  const labelList& own = mesh_.faceOwner();
547  const labelList& nei = mesh_.faceNeighbour();
548 
549  if
550  (
551  (cVals.size() != mesh_.nCells())
552  || (pVals.size() != mesh_.nPoints())
553  || (cCoords.size() != mesh_.nCells())
554  || (pCoords.size() != mesh_.nPoints())
555  || (snappedCc.size() != mesh_.nCells())
556  || (snappedPoint.size() != mesh_.nPoints())
557  )
558  {
560  << "Incorrect size." << endl
561  << "mesh: nCells:" << mesh_.nCells()
562  << " points:" << mesh_.nPoints() << endl
563  << "cVals:" << cVals.size() << endl
564  << "cCoords:" << cCoords.size() << endl
565  << "snappedCc:" << snappedCc.size() << endl
566  << "pVals:" << pVals.size() << endl
567  << "pCoords:" << pCoords.size() << endl
568  << "snappedPoint:" << snappedPoint.size() << endl
569  << abort(FatalError);
570  }
571 
572 
573  // Generate triangle points
574 
575  triPoints.clear();
576  triMeshCells.clear();
577 
578  for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
579  {
580  if ((faceCutType_[facei] & cutType::ANYCUT) != 0)
581  {
582  generateFaceTriPoints
583  (
584  cVals,
585  pVals,
586 
587  cCoords,
588  pCoords,
589 
590  snappedPoints,
591  snappedCc,
592  snappedPoint,
593  facei,
594 
595  cVals[nei[facei]],
596  cCoords[nei[facei]],
597  snappedCc[nei[facei]] != -1,
598  (
599  snappedCc[nei[facei]] != -1
600  ? snappedPoints[snappedCc[nei[facei]]]
601  : Type(Zero)
602  ),
603 
604  triPoints,
605  triMeshCells
606  );
607  }
608  }
609 
610 
611  // Determine neighbouring snap status
612  boolList neiSnapped(mesh_.nBoundaryFaces(), false);
613  List<Type> neiSnappedPoint(neiSnapped.size(), Type(Zero));
614  for (const polyPatch& pp : patches)
615  {
616  if (pp.coupled())
617  {
618  label facei = pp.start();
619  forAll(pp, i)
620  {
621  label bFacei = facei-mesh_.nInternalFaces();
622  label snappedIndex = snappedCc[own[facei]];
623 
624  if (snappedIndex != -1)
625  {
626  neiSnapped[bFacei] = true;
627  neiSnappedPoint[bFacei] = snappedPoints[snappedIndex];
628  }
629  facei++;
630  }
631  }
632  }
633  syncTools::swapBoundaryFaceList(mesh_, neiSnapped);
634  syncTools::swapBoundaryFaceList(mesh_, neiSnappedPoint);
635 
636 
637  forAll(patches, patchi)
638  {
639  const polyPatch& pp = patches[patchi];
640 
641  if (isA<processorPolyPatch>(pp))
642  {
643  const processorPolyPatch& cpp =
644  refCast<const processorPolyPatch>(pp);
645 
646  bitSet isCollocated(collocatedFaces(cpp));
647 
648  forAll(isCollocated, i)
649  {
650  const label facei = pp.start()+i;
651 
652  if ((faceCutType_[facei] & cutType::ANYCUT) != 0)
653  {
654  if (isCollocated[i])
655  {
656  generateFaceTriPoints
657  (
658  cVals,
659  pVals,
660 
661  cCoords,
662  pCoords,
663 
664  snappedPoints,
665  snappedCc,
666  snappedPoint,
667  facei,
668 
669  cVals.boundaryField()[patchi][i],
670  cCoords.boundaryField()[patchi][i],
671  neiSnapped[facei-mesh_.nInternalFaces()],
672  neiSnappedPoint[facei-mesh_.nInternalFaces()],
673 
674  triPoints,
675  triMeshCells
676  );
677  }
678  else
679  {
680  generateFaceTriPoints
681  (
682  cVals,
683  pVals,
684 
685  cCoords,
686  pCoords,
687 
688  snappedPoints,
689  snappedCc,
690  snappedPoint,
691  facei,
692 
693  cVals.boundaryField()[patchi][i],
694  cCoords.boundaryField()[patchi][i],
695  false,
696  Type(Zero),
697 
698  triPoints,
699  triMeshCells
700  );
701  }
702  }
703  }
704  }
705  else
706  {
707  label facei = pp.start();
708 
709  forAll(pp, i)
710  {
711  if ((faceCutType_[facei] & cutType::ANYCUT) != 0)
712  {
713  generateFaceTriPoints
714  (
715  cVals,
716  pVals,
717 
718  cCoords,
719  pCoords,
720 
721  snappedPoints,
722  snappedCc,
723  snappedPoint,
724  facei,
725 
726  cVals.boundaryField()[patchi][i],
727  cCoords.boundaryField()[patchi][i],
728  false, // fc not snapped
729  Type(Zero),
730 
731  triPoints,
732  triMeshCells
733  );
734  }
735  facei++;
736  }
737  }
738  }
739 
740  triPoints.shrink();
741  triMeshCells.shrink();
742 }
743 
744 
745 template<class Type>
747 Foam::isoSurfacePoint::interpolate
748 (
749  const label nPoints,
750  const labelList& triPointMergeMap,
751  const labelList& interpolatedPoints,
752  const List<FixedList<label, 3>>& interpolatedOldPoints,
754  const DynamicList<Type>& unmergedValues
755 )
756 {
757  // One value per point
758  auto tvalues = tmp<Field<Type>>::New(nPoints, Type(Zero));
759  auto& values = tvalues.ref();
760 
761 
762  // Pass1: unweighted average of merged point values
763  {
764  labelList nValues(values.size(), Zero);
765 
766  forAll(unmergedValues, i)
767  {
768  label mergedPointi = triPointMergeMap[i];
769 
770  if (mergedPointi >= 0)
771  {
772  values[mergedPointi] += unmergedValues[i];
773  nValues[mergedPointi]++;
774  }
775  }
776 
777  forAll(values, i)
778  {
779  if (nValues[i] > 0)
780  {
781  values[i] /= scalar(nValues[i]);
782  }
783  }
784  }
785 
786 
787  // Pass2: weighted average for remaining values (from clipped triangles)
788 
789  forAll(interpolatedPoints, i)
790  {
791  label pointi = interpolatedPoints[i];
792  const FixedList<label, 3>& oldPoints = interpolatedOldPoints[i];
794 
795  // Note: zeroing should not be necessary if interpolation only done
796  // for newly introduced points (i.e. not in triPointMergeMap)
797  values[pointi] = Type(Zero);
798  forAll(oldPoints, j)
799  {
800  values[pointi] = w[j]*unmergedValues[oldPoints[j]];
801  }
802  }
803 
804  return tvalues;
805 }
806 
807 
808 template<class Type>
810 Foam::isoSurfacePoint::interpolateTemplate
811 (
813  const Field<Type>& pCoords
814 ) const
815 {
816  // Recalculate boundary values
818  <
819  Type,
820  fvPatchField,
822  volMesh
823  >> c2(adaptPatchFields(cCoords));
824 
825 
826  DynamicList<Type> triPoints(3*nCutCells_);
827  DynamicList<label> triMeshCells(nCutCells_);
828 
829  // Dummy snap data
830  DynamicList<Type> snappedPoints;
831  labelList snappedCc(mesh_.nCells(), -1);
832  labelList snappedPoint(mesh_.nPoints(), -1);
833 
834  generateTriPoints
835  (
836  cValsPtr_(),
837  pVals_,
838 
839  c2(),
840  pCoords,
841 
842  snappedPoints,
843  snappedCc,
844  snappedPoint,
845 
846  triPoints,
847  triMeshCells
848  );
849 
850  return interpolate
851  (
852  this->points().size(),
853  triPointMergeMap_,
854  interpolatedPoints_,
855  interpolatedOldPoints_,
856  interpolationWeights_,
857  triPoints
858  );
859 }
860 
861 
862 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
meshTools.H
s
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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:63
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::DynamicList< Type >
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::volMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:51
Foam::FixedList::size
static constexpr label size() noexcept
Return the number of elements in the FixedList.
Definition: FixedList.H:416
Foam::syncTools::swapBoundaryFaceList
static void swapBoundaryFaceList(const polyMesh &mesh, UList< T > &faceValues)
Swap coupled boundary face values. Uses eqOp.
Definition: syncTools.H:445
Foam::boolList
List< bool > boolList
A List of bools.
Definition: List.H:65
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
surfaceFields.H
Foam::surfaceFields.
polyMesh.H
Foam::DynamicList::shrink
DynamicList< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
Definition: DynamicListI.H:434
syncTools.H
Foam::DynamicList::clear
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
Definition: DynamicListI.H:391
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
OFstream.H
nPoints
label nPoints
Definition: gmvOutputHeader.H:2
Foam::triPoints
Triangle storage. Null constructable (unfortunately triangle<point, point> is not)
Definition: triPoints.H:52
Foam::interpolate
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Definition: curveTools.C:75
Foam::Field
Generic templated field type.
Definition: Field.H:63
isoSurfacePoint.H
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::DynamicList::append
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
Definition: DynamicListI.H:511
Foam::fvPatchField::patchInternalField
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
Definition: fvPatchField.C:233
Foam::isoSurfaceBase::iso_
const scalar iso_
Iso value.
Definition: isoSurfaceBase.H:111
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
Foam::FatalError
error FatalError
Foam::interpolationWeights
Abstract base class for interpolating in 1D.
Definition: interpolationWeights.H:58
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::calculatedFvPatchField
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
Definition: calculatedFvPatchField.H:66
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::constant::physicoChemical::c2
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
Foam::slicedFvPatchField
Specialization of fvPatchField which creates the underlying fvPatchField as a slice of the given comp...
Definition: slicedFvPatchField.H:64
Foam::fvPatchField::patchNeighbourField
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
Definition: fvPatchField.H:448
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
f
labelList f(nPoints)
Foam::List< label >
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::FixedList< label, 3 >
Foam::UList< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::SlicedGeometricField
Specialization of GeometricField which holds slices of given complete fields in a form that they act ...
Definition: slicedSurfaceFieldsFwd.H:58
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:72
p0
const volScalarField & p0
Definition: EEqn.H:36
Foam::GeometricField< Type, fvPatchField, volMesh >
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62