43 Foam::isoSurface::adaptPatchFields
73 FieldType& sliceFld = tsliceFld();
85 isA<emptyPolyPatch>(pp)
86 && pp.size() != sliceFld.boundaryField()[patchI].size()
90 sliceFld.boundaryField().set(patchI, NULL);
93 sliceFld.boundaryField().set
106 mesh.
boundary()[patchI].patch().faceCells();
108 Field<Type>& pfld = sliceFld.boundaryField()[patchI];
112 pfld[i] = sliceFld[faceCells[i]];
115 else if (isA<cyclicPolyPatch>(pp))
119 else if (isA<processorPolyPatch>(pp))
134 collocatedFaces(refCast<const processorPolyPatch>(pp))
139 if (!isCollocated[i])
151 Type Foam::isoSurface::generatePoint
168 scalar
s = (iso_-s0)/d;
170 if (hasSnap1 && s >= 0.5 && s <= 1)
174 else if (hasSnap0 && s >= 0.0 && s <= 0.5)
180 return s*p1 + (1.0-
s)*p0;
187 return s*p1 + (1.0-
s)*p0;
193 void Foam::isoSurface::generateTriPoints
247 generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1)
251 generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
255 generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
263 generatePoint(s1,p1,hasSnap1,snapP1,s0,p0,hasSnap0,snapP0)
267 generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
271 generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
279 generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2);
281 generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3);
285 generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
292 generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
303 generatePoint(s2,p2,hasSnap2,snapP2,s0,p0,hasSnap0,snapP0)
307 generatePoint(s2,p2,hasSnap2,snapP2,s1,p1,hasSnap1,snapP1)
311 generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3)
320 generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
322 generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
328 generatePoint(s0,p0,hasSnap0,snapP0,s3,p3,hasSnap3,snapP3)
333 generatePoint(s1,p1,hasSnap1,snapP1,s2,p2,hasSnap2,snapP2)
343 generatePoint(s0,p0,hasSnap0,snapP0,s1,p1,hasSnap1,snapP1);
345 generatePoint(s2,p2,hasSnap2,snapP2,s3,p3,hasSnap3,snapP3);
350 generatePoint(s1,p1,hasSnap1,snapP1,s3,p3,hasSnap3,snapP3)
356 generatePoint(s0,p0,hasSnap0,snapP0,s2,p2,hasSnap2,snapP2)
366 generatePoint(s3,p3,hasSnap3,snapP3,s0,p0,hasSnap0,snapP0)
370 generatePoint(s3,p3,hasSnap3,snapP3,s2,p2,hasSnap2,snapP2)
374 generatePoint(s3,p3,hasSnap3,snapP3,s1,p1,hasSnap1,snapP1)
382 Foam::label Foam::isoSurface::generateFaceTriPoints
397 const bool hasNeiSnap,
398 const Type& neiSnapPt,
412 label pointI = f[fp];
419 snappedPoint[pointI] != -1,
421 snappedPoint[pointI] != -1
422 ? snappedPoints[snappedPoint[pointI]]
428 snappedPoint[nextPointI] != -1,
430 snappedPoint[nextPointI] != -1
431 ? snappedPoints[snappedPoint[nextPointI]]
432 : pTraits<Type>::zero
437 snappedCc[own] != -1,
440 ? snappedPoints[snappedCc[own]]
441 : pTraits<Type>::zero
454 label nTris = (triPoints.
size()-oldNPoints)/3;
455 for (
label i = 0; i < nTris; i++)
465 void Foam::isoSurface::generateTriPoints
496 <<
"Incorrect size." <<
endl 497 <<
"mesh: nCells:" << mesh_.
nCells()
500 <<
"cCoords:" << cCoords.
size() <<
endl 501 <<
"snappedCc:" << snappedCc.
size() <<
endl 503 <<
"pCoords:" << pCoords.
size() <<
endl 504 <<
"snappedPoint:" << snappedPoint.
size() <<
endl 512 triMeshCells.
clear();
516 if (faceCutType_[faceI] != NOTCUT)
518 generateFaceTriPoints
533 snappedCc[nei[faceI]] != -1,
535 snappedCc[nei[faceI]] != -1
536 ? snappedPoints[snappedCc[nei[faceI]]]
560 label snappedIndex = snappedCc[own[faceI]];
562 if (snappedIndex != -1)
564 neiSnapped[bFaceI] =
true;
565 neiSnappedPoint[bFaceI] = snappedPoints[snappedIndex];
580 if (isA<processorPolyPatch>(pp))
583 refCast<const processorPolyPatch>(pp);
591 if (faceCutType_[faceI] != NOTCUT)
595 generateFaceTriPoints
619 generateFaceTriPoints
650 if (faceCutType_[faceI] != NOTCUT)
652 generateFaceTriPoints
707 > >
c2(adaptPatchFields(cCoords));
745 label mergedPointI = triPointMergeMap_[i];
747 if (mergedPointI >= 0)
749 values[mergedPointI] += triPoints[i];
750 nValues[mergedPointI]++;
763 <<
"point:" << i <<
" nValues:" << nValues[i]
766 else if (nValues[i] > 1)
771 Pout<<
"Of which mult:" << nMult <<
endl;
776 values[i] /= scalar(nValues[i]);
Mesh data needed to do the Finite Volume discretisation.
const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
Mesh data needed to do the Finite Volume discretisation.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
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 ))
dimensioned< scalar > mag(const dimensioned< Type > &)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Specialization of GeometricField which holds slices of given complete fields in a form that they act ...
Specialization of fvPatchField which creates the underlying fvPatchField as a slice of the given comp...
void clear()
Clear the addressed list, i.e. set the size to zero.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
const fileName & instance() const
const Mesh & mesh() const
Return mesh.
A patch is a list of labels that address the faces in the global face list.
A face is a list of labels corresponding to mesh vertices.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const geometricSurfacePatchList & patches() const
Neighbour processor patch.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
static void swapBoundaryFaceList(const polyMesh &mesh, UList< T > &l)
Swap coupled boundary face values.
label size() const
Return the number of elements in the UList.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Pre-declare SubField and related Field type.
errorManip< error > abort(error &err)
const word & name() const
Return name.
virtual const labelList & faceOwner() const
Return face owner.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
label start() const
Return start label of this patch in the polyMesh face list.
label nInternalFaces() const
Generic GeometricField class.
Traits class for primitives.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
tmp< Field< Type > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &cCoords, const Field< Type > &pCoords) const
Interpolates cCoords,pCoords. Uses the references to the original.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const objectRegistry & db() const
Return the local objectRegistry.
A class for managing temporary objects.
const Field< point > & points() const
Return reference to global points.
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
prefixOSstream Pout(cout,"Pout")
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.