49 bool Foam::pointHistory::writeData()
57 position =
mesh.points()[historyPointID_];
60 reduce(position, sumOp<vector>());
68 << position.x() <<
tab 69 << position.y() <<
tab 70 << position.z() <<
endl;
78 Foam::pointHistory::pointHistory
88 regionName_(
polyMesh::defaultRegion),
90 refHistoryPoint_(
dict.
lookup(
"refHistoryPoint")),
93 historyFilePtr_(nullptr)
95 Info<<
"Creating " << this->
name() <<
" function object." <<
endl;
98 dict.readIfPresent(
"historyPointID", historyPointID_);
106 if (historyPointID_ == -1)
110 scalar dist =
mag(refHistoryPoint_ -
points[pointI]);
115 historyPointID_ = pointI;
127 if (minDist[procI] <
min)
129 min = minDist[procI];
136 Pout<<
"History point ID: " << historyPointID_ <<
nl 137 <<
"History point coordinates: " 139 <<
"Reference point coordinates: " << refHistoryPoint_
144 if (!historyFilePtr_)
149 const word startTimeName =
152 const fileName historyDir =
164 historyFilePtr_.reset
166 new OFstream(historyDir/fileName_)
173 <<
"# Time" <<
tab <<
"X" <<
tab <<
"Y" <<
tab <<
"Z" List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const Type & value() const noexcept
Return const reference to value.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static void writeData(Ostream &os, const Type &val)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char tab
The tab '\t' character(0x09)
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
Abstract base-class for Time/database function objects.
Lookup type of boundary radiation properties.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
const word & name() const noexcept
Return the name of this functionObject.
#define forAll(list, i)
Loop across all elements in list.
Omanip< int > setprecision(const int i)
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
virtual bool execute()
execute is called at each ++ or += of the time-loop
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
fileName globalPath() const
Return global path for the case = rootPath/globalCaseName. Same as TimePaths::globalPath() ...
A class for handling words, derived from Foam::string.
const Time & time() const noexcept
Return time registry.
static word defaultRegion
Return the default region name.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Istream and Ostream manipulators taking arguments.
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.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
virtual bool read(const dictionary &dict)
Read and set the function object if its data has changed.
defineTypeNameAndDebug(combustionModel, 0)
static void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual linear/tree communicat...
Mesh data needed to do the Finite Volume discretisation.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)