43 Foam::isoSurface::adaptPatchFields
73 FieldType& sliceFld = tsliceFld.
ref();
79 typename FieldType::Boundary& sliceFldBf =
80 sliceFld.boundaryFieldRef();
88 isA<emptyPolyPatch>(pp)
89 && pp.size() != sliceFldBf[
patchi].size()
115 pfld[i] = sliceFld[faceCells[i]];
118 else if (isA<cyclicPolyPatch>(pp))
122 else if (isA<processorPolyPatch>(pp))
137 collocatedFaces(refCast<const processorPolyPatch>(pp))
142 if (!isCollocated[i])
154 Type Foam::isoSurface::generatePoint
171 scalar
s = (iso_-s0)/d;
173 if (hasSnap1 && s >= 0.5 && s <= 1)
177 else if (hasSnap0 && s >= 0.0 && s <= 0.5)
183 return s*p1 + (1.0-
s)*p0;
190 return s*p1 + (1.0-
s)*p0;
196 void Foam::isoSurface::generateTriPoints
250 generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1)
254 generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
258 generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
260 if (triIndex == 0x0E)
264 Swap(points[sz-2], points[sz-1]);
272 generatePoint(s1,p1,hasSnap1,snapP1,s0,p0,hasSnap0,snapP0)
276 generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
280 generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
282 if (triIndex == 0x0D)
286 Swap(points[sz-2], points[sz-1]);
294 generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2);
296 generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3);
300 generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
308 generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
312 if (triIndex == 0x0C)
316 Swap(points[sz-5], points[sz-4]);
317 Swap(points[sz-2], points[sz-1]);
326 generatePoint(s2,p2,hasSnap2,snapP2,s0,p0,hasSnap0,snapP0)
330 generatePoint(s2,p2,hasSnap2,snapP2,s1,p1,hasSnap1,snapP1)
334 generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3)
337 if (triIndex == 0x0B)
341 Swap(points[sz-2], points[sz-1]);
349 generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
351 generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
357 generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
363 generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
367 if (triIndex == 0x0A)
371 Swap(points[sz-5], points[sz-4]);
372 Swap(points[sz-2], points[sz-1]);
380 generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
382 generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
387 generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
395 generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
398 if (triIndex == 0x09)
402 Swap(points[sz-5], points[sz-4]);
403 Swap(points[sz-2], points[sz-1]);
411 generatePoint(s3,p3,hasSnap3,snapP3,s0,p0,hasSnap0,snapP0)
415 generatePoint(s3,p3,hasSnap3,snapP3,s2,p2,hasSnap2,snapP2)
419 generatePoint(s3,p3,hasSnap3,snapP3,s1,p1,hasSnap1,snapP1)
421 if (triIndex == 0x07)
425 Swap(points[sz-2], points[sz-1]);
433 Foam::label Foam::isoSurface::generateFaceTriPoints
448 const bool hasNeiSnap,
449 const Type& neiSnapPt,
463 label pointi = f[fp];
470 snappedPoint[pointi] != -1,
472 snappedPoint[pointi] != -1
473 ? snappedPoints[snappedPoint[pointi]]
479 snappedPoint[nextPointi] != -1,
481 snappedPoint[nextPointi] != -1
482 ? snappedPoints[snappedPoint[nextPointi]]
488 snappedCc[own] != -1,
491 ? snappedPoints[snappedCc[own]]
505 label nTris = (triPoints.
size()-oldNPoints)/3;
506 for (
label i = 0; i < nTris; i++)
516 void Foam::isoSurface::generateTriPoints
547 <<
"Incorrect size." <<
endl 548 <<
"mesh: nCells:" << mesh_.
nCells()
551 <<
"cCoords:" << cCoords.
size() <<
endl 552 <<
"snappedCc:" << snappedCc.
size() <<
endl 554 <<
"pCoords:" << pCoords.
size() <<
endl 555 <<
"snappedPoint:" << snappedPoint.
size() <<
endl 563 triMeshCells.
clear();
567 if (faceCutType_[facei] != NOTCUT)
569 generateFaceTriPoints
584 snappedCc[nei[facei]] != -1,
586 snappedCc[nei[facei]] != -1
587 ? snappedPoints[snappedCc[nei[facei]]]
611 label snappedIndex = snappedCc[own[facei]];
613 if (snappedIndex != -1)
615 neiSnapped[bFacei] =
true;
616 neiSnappedPoint[bFacei] = snappedPoints[snappedIndex];
631 if (isA<processorPolyPatch>(pp))
634 refCast<const processorPolyPatch>(pp);
642 if (faceCutType_[facei] != NOTCUT)
646 generateFaceTriPoints
670 generateFaceTriPoints
701 if (faceCutType_[facei] != NOTCUT)
703 generateFaceTriPoints
737 Foam::isoSurface::interpolate
751 label mergedPointi = triPointMergeMap[i];
753 if (mergedPointi >= 0)
755 values[mergedPointi] += unmergedValues[i];
756 nValues[mergedPointi]++;
764 values[i] /= scalar(nValues[i]);
774 Foam::isoSurface::interpolate
787 >>
c2(adaptPatchFields(cCoords));
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Specialization of fvPatchField which creates the underlying fvPatchField as a slice of the given comp...
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
bool set(const label) const
Is element set.
A face is a list of labels corresponding to mesh vertices.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
T & ref() const
Return non-const reference or generate a fatal error.
void size(const label)
Override size to be inconsistent with allocated storage.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Generic GeometricField class.
Neighbour processor patch.
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))
Mesh data needed to do the Finite Volume discretisation.
const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Pre-declare SubField and related Field type.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
virtual const labelList & faceOwner() const
Return face owner.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const Field< point > & points() const
Return reference to global points.
virtual const faceList & faces() const
Return raw faces.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
const Mesh & mesh() const
Return mesh.
void setSize(const label)
Reset size of List.
const geometricSurfacePatchList & patches() const
const fileName & instance() const
Mesh data needed to do the Finite Volume discretisation.
label start() const
Return start label of this patch in the polyMesh face list.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
const objectRegistry & db() const
Return the local objectRegistry.
label size() const
Return the number of elements in the UList.
void clear()
Clear the addressed list, i.e. set the size to zero.
Specialization of GeometricField which holds slices of given complete fields in a form that they act ...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label size() const
Return the number of elements in the UList.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.