Go to the documentation of this file.
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",
75 IOstream::currentVersion,
76 mesh.time().writeCompression()
80 globalData = ListListOps::combine<List<string>>
87 globalTimes = ListListOps::combine<List<scalar>>
95 string header(
"# Time currentProc " + header_);
96 patchOutFile<< header.c_str() <<
nl;
100 label dataI = indices[i];
103 << globalTimes[dataI] <<
' '
104 << globalData[dataI].c_str()
109 patchData_[i].clearStorage();
110 times_[i].clearStorage();
117 template<
class CloudType>
122 const word& modelName
126 maxStoredParcels_(this->coeffDict().getScalar(
"maxStoredParcels")),
134 this->coeffDict().readIfPresent(
"fields", fields_);
137 const wordRes patchMatcher(this->coeffDict().
lookup(
"patches"));
141 if (patchIDs_.empty())
144 <<
"No matching patches found: "
150 Info<<
"Post-process fields "
153 Info<<
"On patches (";
155 for (
const label patchi : patchIDs_)
163 patchData_.setSize(patchIDs_.size());
164 times_.setSize(patchIDs_.size());
168 template<
class CloudType>
175 maxStoredParcels_(ppm.maxStoredParcels_),
176 fields_(ppm.fields_),
177 patchIDs_(ppm.patchIDs_),
179 patchData_(ppm.patchData_),
186 template<
class CloudType>
194 const label patchi = pp.
index();
195 const label localPatchi = applyToPatch(patchi);
200 p.writeProperties(
data, fields_,
" ",
true);
201 header_ =
data.str();
204 if (localPatchi != -1 && patchData_[localPatchi].size() < maxStoredParcels_)
206 times_[localPatchi].append(this->owner().time().value());
209 data<< Pstream::myProcNo();
210 p.writeProperties(
data, fields_,
" ",
false);
212 patchData_[localPatchi].append(
data.str());
int debug
Static debugging option.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Extract list indices for all matches.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
wordList names() const
Return a list of patch names.
#define forAll(list, i)
Loop across all elements in list.
const fvMesh & mesh() const
Return reference to the mesh.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
const cellModel * lookup(const word &modelName)
Deprecated(2017-11) equivalent to cellModel::ptr static method.
Templated base class for dsmc cloud.
Standard post-processing.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
Output to file stream, using an OSstream.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to string buffer, using a OSstream.
Templated cloud function object base class.
A List of wordRe with additional matching capabilities.
void write()
Write post-processing info.
Operations on lists of strings.
PatchPostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Various functions to operate on Lists.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
#define WarningInFunction
Report a warning using Foam::Warning.
label index() const
The index of this patch in the boundaryMesh.
Database for solution data, solver performance and other reduced data.