37 template<
class CloudType>
40 const label globalPatchi
43 return patchIDs_.find(globalPatchi);
49 template<
class CloudType>
55 procTimes[Pstream::myProcNo()] = times_[i];
56 Pstream::gatherList(procTimes);
59 procData[Pstream::myProcNo()] = patchData_[i];
60 Pstream::gatherList(procData);
62 if (Pstream::master())
67 mkDir(this->writeTimeDir());
69 const word& patchName =
mesh.boundaryMesh()[patchIDs_[i]].name();
73 this->writeTimeDir()/patchName +
".post",
74 IOstreamOption::ASCII,
75 mesh.time().writeCompression()
79 globalData = ListListOps::combine<List<string>>
86 globalTimes = ListListOps::combine<List<scalar>>
94 string header(
"# Time currentProc " + header_);
95 patchOutFile<< header.c_str() <<
nl;
99 label dataI = indices[i];
102 << globalTimes[dataI] <<
' ' 103 << globalData[dataI].c_str()
108 patchData_[i].clearStorage();
109 times_[i].clearStorage();
116 template<
class CloudType>
121 const word& modelName
125 maxStoredParcels_(this->coeffDict().getScalar(
"maxStoredParcels")),
140 if (patchIDs_.
empty())
143 <<
"No matching patches found: " 149 Info<<
"Post-process fields " 152 Info<<
"On patches (";
154 for (
const label patchi : patchIDs_)
162 patchData_.setSize(patchIDs_.size());
163 times_.setSize(patchIDs_.size());
167 template<
class CloudType>
174 maxStoredParcels_(ppm.maxStoredParcels_),
175 fields_(ppm.fields_),
176 patchIDs_(ppm.patchIDs_),
178 patchData_(ppm.patchData_),
185 template<
class CloudType>
193 const label patchi = pp.
index();
194 const label localPatchi = applyToPatch(patchi);
199 p.writeProperties(
data, fields_,
" ",
true);
200 header_ =
data.str();
203 if (localPatchi != -1 && patchData_[localPatchi].size() < maxStoredParcels_)
205 times_[localPatchi].append(this->owner().time().value());
209 p.writeProperties(data, fields_,
" ",
false);
211 patchData_[localPatchi].
append(data.str());
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void write()
Write post-processing info.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Return list indices for all matches.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void append(const T &val)
Append an element at the end of the list.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
const word & name() const noexcept
Return the object name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to file stream, using an OSstream.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Object access operator or list access operator.
Operations on lists of strings.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
Lookup type of boundary radiation properties.
Various functions to operate on Lists.
const CloudType & owner() const
Return const access to the owner cloud.
#define forAll(list, i)
Loop across all elements in list.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
A class for handling words, derived from Foam::string.
wordList names() const
Return a list of patch names.
A List of wordRe with additional matching capabilities.
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
int debug
Static debugging option.
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...
Database for solution data, solver performance and other reduced data.
const fvMesh & mesh() const
Return reference to the mesh.
#define WarningInFunction
Report a warning using Foam::Warning.
Mesh data needed to do the Finite Volume discretisation.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Standard post-processing.
label index() const noexcept
The index of this patch in the boundaryMesh.
A patch is a list of labels that address the faces in the global face list.
Templated base class for dsmc cloud.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Templated cloud function object base class.
PatchPostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.