61 <<
"Unexpected sourceType: " << int(setType) <<
nl
66 const auto& selected = tselected();
68 auto&
fld = tresult.ref().primitiveFieldRef();
95 tselected = getTopoSetLabels(
name, setType);
102 <<
"Unexpected sourceType: " << int(setType) <<
nl
107 const auto& selected = tselected();
109 const auto& bmesh =
mesh().boundaryMesh();
111 auto& result = tresult.ref();
112 auto&
fld = result.primitiveFieldRef();
113 auto& bfld = result.boundaryFieldRef();
117 for (
const label facei : selected)
119 if (facei <
mesh().nInternalFaces())
121 fld[facei] = scalar(1);
125 const label patchi = bmesh.whichPatch(facei);
133 bfld[patchi][facei-bmesh[patchi].start()] = scalar(1);
141 <<
"The faceSet/faceZone " <<
name <<
" contained "
142 << nErrors <<
" faces outside of the addressing range" <<
nl
171 tselected = getTopoSetLabels(
name, setType);
178 <<
"Unexpected sourceType: " << int(setType) <<
nl
183 const auto& selected = tselected();
185 auto&
fld = tresult.ref().primitiveFieldRef();
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
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))
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
static FOAM_NO_DANGLING_REFERENCE const pointMesh & New(const polyMesh &mesh, Args &&... args)
A List with indirect addressing. Like IndirectList but does not store addressing.
void fill_random(scalarField &field, label seed=0, const bool gaussian=false) const
Fill a random field.
const exprResult & result() const noexcept
Const access to expression result.
refPtr< labelList > getTopoSetLabels(const word &name, enum topoSetSource::sourceType setType) const
Get the labels associated with the topo set.
tmp< volScalarField > field_cellVolume() const
The cell volumes - (swak = vol).
tmp< surfaceScalarField > field_faceArea() const
The face area magnitudes [magSf] - (swak = area).
tmp< pointVectorField > field_pointField() const
The mesh point locations - (swak = pts).
tmp< surfaceScalarField > field_faceSelection(const word &name, enum topoSetSource::sourceType setType) const
Face selections (as logical).
tmp< surfaceVectorField > field_areaNormal() const
The face areas with their vector direction [Sf] - (swak = face).
tmp< surfaceVectorField > field_faceCentre() const
The face centres - (swak = fpos).
tmp< volScalarField > field_cellSelection(const word &name, enum topoSetSource::sourceType setType) const
Cell selections (as logical).
tmp< volScalarField > field_rand(label seed=0, bool gaussian=false) const
A uniform random field.
tmp< volVectorField > field_cellCentre() const
The cell centres - (swak = pos).
virtual const fvMesh & mesh() const
The mesh we are attached to.
tmp< pointScalarField > field_pointSelection(const word &name, enum topoSetSource::sourceType setType) const
Point selections (as logical).
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
sourceType
Enumeration defining the types of sources.
@ POINTSET_SOURCE
Points as set.
@ FACESET_SOURCE
Faces as set.
@ FACEZONE_SOURCE
Faces as zone.
@ POINTZONE_SOURCE
Points as zone.
@ CELLSET_SOURCE
Cells as set.
@ CELLZONE_SOURCE
Cells as zone.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionSet dimless
Dimensionless.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
constexpr char nl
The newline '\n' character (0x0a).