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