36void Foam::Function1Types::Sample<Type>::setSampleCell()
const
42 if (pointEventNo_ <
points.eventNo())
44 pointEventNo_ =
points.eventNo();
46 celli_ =
mesh.findCell(position_);
51 <<
"Sample cell could not be found at position "
58 Pout<<
"Position: " << position_
59 <<
" celli:" << celli_
60 <<
" eventNo:" << pointEventNo_
61 <<
" points eventNo:" <<
points.eventNo()
73 const word& entryName,
83 dict.getOrDefault<
word>(
"interpolationScheme",
"cell")
94 fieldName_(
s.fieldName_),
95 position_(
s.position_),
96 interpolationScheme_(
s.interpolationScheme_),
98 pointEventNo_(
s.pointEventNo_)
109 const auto* fieldPtr =
110 mesh.template cfindObject<VolumeField<Type>>(fieldName_);
115 <<
"Unable to find field " << fieldName_ <<
" on the mesh database"
117 <<
mesh.template sortedNames<VolumeField<Type>>()
135 result = interpolator().interpolate(position_, celli_, -1);
138 reduce(result, maxOp<Type>());
162 os.writeEntry(
"field", fieldName_);
163 os.writeEntry(
"position", position_);
165 os.writeEntryIfDifferent<
word>
167 "interpolationScheme",
"cell", interpolationScheme_
static const char *const typeName
Typename for Field.
virtual void writeData(Ostream &os) const
Write as primitive (inline) format.
virtual void writeEntries(Ostream &os) const
Write coefficient entries in dictionary format.
virtual Type value(const scalar x) const
Return Sample value.
Sample(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry name, dictionary and optional registry.
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two (scalar) values.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
virtual void writeData(Ostream &os) const
Write in dictionary format.
Function1(const word &entryName, const objectRegistry *obrPtr=nullptr)
Construct from entry name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const MeshType & mesh(const word ®ionName=word::null) const
Return the mesh database if this Function1 was created using a mesh.
static autoPtr< interpolation< Type > > New(const word &interpolationType, const GeometricField< Type, fvPatchField, volMesh > &psi)
Return a reference to the specified interpolation scheme.
Registry of regIOobjects.
A traits class, which is primarily used for primitives and vector-space.
A class for handling words, derived from Foam::string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define DebugInfo
Report an information message using Foam::Info.
vectorIOField pointIOField
pointIOField is a vectorIOField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
vector point
Point is a vector.
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...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).