Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
38template<class Type>
40Foam::isoSurfacePoint::adaptPatchFields
41(
43) const
44{
46 (
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
63 const polyBoundaryMesh& patches = mesh.boundaryMesh();
64
65 auto& sliceFldBf = sliceFld.boundaryFieldRef();
66
67 forAll(patches, patchi)
68 {
69 const polyPatch& pp = patches[patchi];
70
71 if
72 (
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());
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
139template<class Type>
140Type 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
181template<class Type>
182void 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
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 }
427 break;
428 }
429}
430
431
432template<class Type>
433Foam::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 UList<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
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
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
515template<class Type>
516void 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 UList<Type>& snappedPoints,
525 const labelList& snappedCc,
526 const labelList& snappedPoint,
527
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
629 {
630 const processorPolyPatch& cpp =
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
732template<class Type>
734Foam::isoSurfacePoint::interpolate
735(
736 const label nPoints,
737 const labelList& triPointMergeMap,
738 const labelList& interpolatedPoints,
739 const List<FixedList<label, 3>>& interpolatedOldPoints,
741 const UList<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 }
791 return tvalues;
792}
793
794
795template<class Type>
797Foam::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_,
839 );
840}
841
842
843// ************************************************************************* //
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
DynamicList< T, SizeMin > & shrink()
Calls shrink_to_fit() and returns a reference to the DynamicList.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
A 1D vector of objects of type <T> with a fixed length <N>.
Definition FixedList.H:73
static constexpr label size() noexcept
Return the number of elements in the FixedList.
Definition FixedList.H:619
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
void append(const T &val)
Append an element at the end of the list.
Definition List.H:497
void setSize(label n)
Alias for resize().
Definition List.H:536
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
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:99
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
Smooth ATC in cells next to a set of patches supplied by type.
Definition faceCells.H:55
A face is a list of labels corresponding to mesh vertices.
Definition face.H:71
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
Abstract base class for interpolating in 1D.
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 scalarField & pVals_
Point values.
const polyMesh & mesh() const noexcept
The mesh for which the iso-surface is associated.
const polyMesh & mesh_
Reference to mesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
Neighbour processor patch.
static void swapBoundaryFaceList(const polyMesh &mesh, UList< T > &faceValues, const bool parRun=UPstream::parRun())
Swap coupled boundary face values. Uses eqOp.
Definition syncTools.H:524
A class for managing temporary objects.
Definition tmp.H:75
Triangle point storage. Default constructable (triangle is not).
Definition triangle.H:77
const volScalarField & p0
Definition EEqn.H:36
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
const pointField & points
label nPoints
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))
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
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.
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
List< label > labelList
A List of labels.
Definition List.H:62
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Definition typeInfo.H:87
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
Definition errorManip.H:139
List< bool > boolList
A List of bools.
Definition List.H:60
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Definition curveTools.C:75
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
UList< label > labelUList
A UList of labels.
Definition UList.H:75
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
labelList f(nPoints)
const pointField & pts
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299
Foam::surfaceFields.