51 case topoSetSource::sourceType::CELLZONE_SOURCE:
52 case topoSetSource::sourceType::CELLSET_SOURCE:
61 <<
"Unexpected sourceType: " << int(setType) <<
nl 66 const auto& selected = tselected();
68 auto&
fld = tresult.ref().primitiveFieldRef();
92 case topoSetSource::sourceType::FACESET_SOURCE:
93 case topoSetSource::sourceType::FACEZONE_SOURCE:
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 168 case topoSetSource::sourceType::POINTSET_SOURCE:
169 case topoSetSource::sourceType::POINTZONE_SOURCE:
171 tselected = getTopoSetLabels(
name, setType);
178 <<
"Unexpected sourceType: " << int(setType) <<
nl 183 const auto& selected = tselected();
185 auto&
fld = tresult.ref().primitiveFieldRef();
tmp< volScalarField > field_cellVolume() const
The cell volumes - (swak = vol)
void fill_random(scalarField &field, label seed=0, const bool gaussian=false) const
Fill a random field.
tmp< surfaceScalarField > field_faceArea() const
The face area magnitudes [magSf] - (swak = area)
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
refPtr< labelList > getTopoSetLabels(const word &name, enum topoSetSource::sourceType setType) const
Get the labels associated with the topo set.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
constexpr char nl
The newline '\n' character (0x0a)
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
const dimensionSet dimless
Dimensionless.
A class for managing references or pointers (no reference counting)
virtual const fvMesh & mesh() const
The mesh we are attached to.
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)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &ds, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field from name, mesh, dimensions and patch type.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
tmp< surfaceVectorField > field_faceCentre() const
The face centres - (swak = fpos)
A class for handling words, derived from Foam::string.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
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;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< surfaceVectorField > field_areaNormal() const
The face areas with their vector direction [Sf] - (swak = face)
sourceType
Enumeration defining the types of sources.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
tmp< volVectorField > field_cellCentre() const
The cell centres - (swak = pos)
A class for managing temporary objects.
tmp< volScalarField > field_rand(label seed=0, bool gaussian=false) const
A uniform random field.
tmp< pointScalarField > field_pointSelection(const word &name, enum topoSetSource::sourceType setType) const
Point selections (as logical)
tmp< volScalarField > field_cellSelection(const word &name, enum topoSetSource::sourceType setType) const
Cell selections (as logical)
static constexpr const zero Zero
Global zero (0)