30 cellFld[cellI] =
max(cellFld[cellI], faceData[cFaces[i]]);
60 cellFld[cellI] =
min(cellFld[cellI], faceData[cFaces[i]]);
91 cellFld[own[facei]] =
min(cellFld[own[facei]], faceData[facei]);
92 cellFld[nei[facei]] =
min(cellFld[nei[facei]], faceData[facei]);
103 cellFld[fc[i]] =
min(cellFld[fc[i]], fvp[i]);
120void writeSurfaceField
134 mesh.time().timeName(),
137 IOobject::AUTO_WRITE,
142 calculatedFvsPatchScalarField::typeName
144 fld.primitiveFieldRef() = faceData;
146 Info<<
" Writing face data to " << fName <<
endl;
155 const bool writeFaceFields
158 if (selectedFields.
empty())
163 Info<<
"Writing fields with mesh quality parameters" <<
endl;
165 if (selectedFields.
found(
"nonOrthoAngle"))
170 polyMeshTools::faceOrthogonality
193 mesh.time().timeName(),
196 IOobject::AUTO_WRITE,
201 calculatedFvPatchScalarField::typeName
204 maxFaceToCell(nonOrthoAngle, cellNonOrthoAngle);
205 Info<<
" Writing non-orthogonality (angle) to "
206 << cellNonOrthoAngle.name() <<
endl;
207 cellNonOrthoAngle.
write();
214 "face_nonOrthoAngle",
220 if (selectedFields.
found(
"faceWeight"))
227 mesh.time().timeName(),
230 IOobject::AUTO_WRITE,
237 mesh.boundary().size(),
238 calculatedFvPatchScalarField::typeName
240 mesh.weights().boundaryField().types()
243 minFaceToCell(
mesh.weights(), cellWeights,
false);
244 Info<<
" Writing face interpolation weights (0..0.5) to "
245 << cellWeights.name() <<
endl;
250 writeSurfaceField(
mesh,
"face_faceWeight",
mesh.weights());
258 if (selectedFields.
found(
"skewness"))
263 polyMeshTools::faceSkewness
279 mesh.time().timeName(),
282 IOobject::AUTO_WRITE,
287 calculatedFvPatchScalarField::typeName
290 maxFaceToCell(faceSkewness, cellSkewness);
291 Info<<
" Writing face skewness to " << cellSkewness.name() <<
endl;
292 cellSkewness.
write();
309 if (selectedFields.
found(
"cellDeterminant"))
316 mesh.time().timeName(),
319 IOobject::AUTO_WRITE,
326 cellDeterminant.primitiveFieldRef() =
327 primitiveMeshTools::cellDeterminant
332 syncTools::getInternalOrCoupledFaces(
mesh)
334 cellDeterminant.correctBoundaryConditions();
335 Info<<
" Writing cell determinant to "
336 << cellDeterminant.name() <<
endl;
337 cellDeterminant.
write();
344 if (selectedFields.
found(
"aspectRatio"))
351 mesh.time().timeName(),
354 IOobject::AUTO_WRITE,
364 polyMeshTools::cellClosedness
374 aspectRatio.correctBoundaryConditions();
375 Info<<
" Writing aspect ratio to " << aspectRatio.name() <<
endl;
379 if (selectedFields.
found(
"cellAspectRatio"))
386 mesh.time().timeName(),
389 IOobject::AUTO_WRITE,
399 aspectRatio.correctBoundaryConditions();
400 Info<<
" Writing approximate aspect ratio to "
401 << aspectRatio.name() <<
endl;
409 if (selectedFields.
found(
"cellShapes"))
416 mesh.time().timeName(),
419 IOobject::AUTO_WRITE,
430 shape[cellI] = model.
index();
432 shape.correctBoundaryConditions();
433 Info<<
" Writing cell shape (hex, tet etc.) to " << shape.name()
438 if (selectedFields.
found(
"cellVolume"))
445 mesh.time().timeName(),
448 IOobject::AUTO_WRITE,
453 calculatedFvPatchScalarField::typeName
456 Info<<
" Writing cell volume to " << V.name() <<
endl;
460 if (selectedFields.
found(
"cellVolumeRatio"))
464 polyMeshTools::volRatio
476 mesh.time().timeName(),
479 IOobject::AUTO_WRITE,
484 calculatedFvPatchScalarField::typeName
487 minFaceToCell(faceVolumeRatio, cellVolumeRatio);
488 Info<<
" Writing cell volume ratio to "
489 << cellVolumeRatio.name() <<
endl;
490 cellVolumeRatio.
write();
497 "face_cellVolumeRatio",
504 if (selectedFields.
found(
"minTetVolume"))
511 mesh.time().timeName(),
514 IOobject::AUTO_WRITE,
529 const point& fc =
mesh.faceCentres()[facei];
532 const point& ownCc =
mesh.cellCentres()[own[facei]];
533 scalar& ownVol = minTetVolume[own[facei]];
543 ownVol =
min(ownVol, tetQual);
546 if (
mesh.isInternalFace(facei))
548 const point& neiCc =
mesh.cellCentres()[nei[facei]];
549 scalar& neiVol = minTetVolume[nei[facei]];
559 neiVol =
min(neiVol, tetQual);
564 minTetVolume.correctBoundaryConditions();
565 Info<<
" Writing minTetVolume to " << minTetVolume.name() <<
endl;
566 minTetVolume.
write();
570 if (selectedFields.
found(
"minPyrVolume"))
577 mesh.time().timeName(),
580 IOobject::AUTO_WRITE,
591 primitiveMeshTools::facePyramidVolume
611 cellFld[own[facei]] =
min(cellFld[own[facei]], ownPyrVol[facei]);
612 cellFld[nei[facei]] =
min(cellFld[nei[facei]], neiPyrVol[facei]);
616 for (
const auto& fvp : minPyrVolume.boundaryField())
623 cellFld[fc[i]] =
min(cellFld[fc[i]], ownPyrVol[meshFacei]);
627 minPyrVolume.correctBoundaryConditions();
628 Info<<
" Writing minPyrVolume to " << minPyrVolume.name() <<
endl;
629 minPyrVolume.
write();
639 writeSurfaceField(
mesh,
"face_minPyrVolume", minFacePyrVol);
643 if (selectedFields.
found(
"cellRegion"))
650 mesh.time().timeName(),
653 IOobject::AUTO_WRITE,
658 calculatedFvPatchScalarField::typeName
664 cellRegion[celli] = rs[celli];
666 cellRegion.correctBoundaryConditions();
667 Info<<
" Writing cell region to " << cellRegion.name() <<
endl;
671 if (selectedFields.
found(
"wallDistance"))
677 if (schemesDict.
found(
"wallDist"))
683 Info<<
" Writing wall distance to " <<
y.name() <<
endl;
694 if (selectedFields.
found(
"cellZone"))
701 mesh.time().timeName(),
704 IOobject::AUTO_WRITE,
709 calculatedFvPatchScalarField::typeName
713 for (
const auto&
zone : czs)
718 cellZone.correctBoundaryConditions();
722 if (selectedFields.
found(
"faceZone"))
728 for (
const auto&
zone : czs)
740 mesh.time().timeName(),
743 IOobject::AUTO_WRITE,
748 calculatedFvsPatchScalarField::typeName
754 for (
auto& pfld : bfld)
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
const Mesh & mesh() const
Return mesh.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
bool empty() const noexcept
True if the hash table is empty.
bool found(const Key &key) const
Return true if hashed entry is found in table.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
SubField is a Field obtained as a section of another Field, without its own allocation....
A List with indirect addressing. Like IndirectList but does not store addressing.
(Rough approximation of) cell aspect ratio
Maps a geometry to a set of cell primitives.
label index() const noexcept
Return index of model in the model list.
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
A subset of mesh faces organised as a primitive patch.
virtual void write(Ostream &os) const
Write.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
Mesh data needed to do the Finite Volume discretisation.
const fvPatch & patch() const
Return patch.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Return size.
virtual label start() const
Return start label of this patch in the polyMesh face list.
const List< T >::subList patchSlice(const List< T > &l) const
Slice list to patch.
virtual const labelUList & faceCells() const
Return faceCells.
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
const fvPatch & patch() const
Return patch.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
scalar quality() const
Return quality: Ratio of tetrahedron and circum-sphere.
label index() const noexcept
The index of this zone in the zone list.
const word & name() const noexcept
The zone name.
Base class for mesh zones.
virtual void write(Ostream &os) const
Write.
const labelIOList & zoneID
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
dimensionedScalar acos(const dimensionedScalar &ds)
cellMask correctBoundaryConditions()
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.