87 doCells_ =
dict.getOrDefault(
"calculateCells",
true);
89 geomPtr_.reset(
nullptr);
97 mesh_.time().constant(),
103 dict.subDict(
"geometry"),
124 const pointField& fc = mesh_.C().boundaryField()[patchi];
128 geomPtr_().findNearest
139 dist[i] = nearestInfo[i].hitPoint().dist(fc[i]);
141 bfld[patchi] == dist;
147 const pointField& cc = mesh_.C().internalField();
151 geomPtr_().findNearest
159 forAll(nearestInfo, celli)
161 distance[celli] = nearestInfo[celli].hitPoint().dist(cc[celli]);
164 distance.correctBoundaryConditions();
172 Log <<
" functionObjects::" <<
type() <<
" " <<
name()
173 <<
" writing distance-to-surface field" <<
endl;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Computes the distance to the nearest surface from a given geometry.
autoPtr< searchableSurfaces > geomPtr_
Geometry.
surfaceDistance(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Switch doCells_
Switch to calculate distance-to-cells.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
const Time & time() const
Return the top-level database.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
bool store()
Register object with its registry and transfer ownership to the registry.
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
scalar distance(const vector &p1, const vector &p2)
List< label > labelList
A List of labels.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
#define forAll(list, i)
Loop across all elements in list.