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