34 template<
class CloudType>
37 const label globalPatchi
42 if (patchIDs_[i] == globalPatchi)
54 template<
class CloudType>
60 procTimes[Pstream::myProcNo()] = times_[i];
61 Pstream::gatherList(procTimes);
64 procData[Pstream::myProcNo()] = patchData_[i];
65 Pstream::gatherList(procData);
67 if (Pstream::master())
72 mkDir(this->writeTimeDir());
78 this->writeTimeDir()/patchName +
".post",
80 IOstream::currentVersion,
85 globalData = ListListOps::combine<List<string>>
92 globalTimes = ListListOps::combine<List<scalar>>
101 string header(
"# Time currentProc " + parcelType::propertyList_);
102 patchOutFile<< header.c_str() <<
nl;
106 label dataI = indices[i];
109 << globalTimes[dataI] <<
' ' 110 << globalData[dataI].c_str()
115 patchData_[i].clearStorage();
116 times_[i].clearStorage();
123 template<
class CloudType>
128 const word& modelName
132 maxStoredParcels_(
readScalar(this->coeffDict().
lookup(
"maxStoredParcels"))),
137 const wordList allPatchNames = owner.mesh().boundaryMesh().names();
145 if (patchIDs.
empty())
148 <<
"Cannot find any patch names matching " << patchName[i]
152 uniquePatchIDs.
insert(patchIDs);
155 patchIDs_ = uniquePatchIDs.
toc();
162 const word& patchName = owner.mesh().boundaryMesh()[
patchi].name();
163 Info<<
"Post-process patch " << patchName <<
endl;
167 patchData_.setSize(patchIDs_.size());
168 times_.setSize(patchIDs_.size());
172 template<
class CloudType>
179 maxStoredParcels_(ppm.maxStoredParcels_),
180 patchIDs_(ppm.patchIDs_),
182 patchData_(ppm.patchData_)
188 template<
class CloudType>
195 template<
class CloudType>
206 const label localPatchi = applyToPatch(patchi);
208 if (localPatchi != -1 && patchData_[localPatchi].size() < maxStoredParcels_)
210 times_[localPatchi].append(this->owner().time().value());
213 data<< Pstream::myProcNo() <<
' ' <<
p;
215 patchData_[localPatchi].append(data.
str());
string str() const
Return the string.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
void write()
Write post-processing info.
A list of keyword definitions, which are a keyword followed by any number of values (e...
bool empty() const
Return true if the UList is empty (ie, size() is zero)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
virtual ~PatchPostProcessing()
Destructor.
Operations on lists of strings.
bool insert(const Key &key)
Insert a new entry.
virtual void postPatch(const parcelType &p, const polyPatch &pp, const scalar trackFraction, const tetIndices &tetIs, bool &keepParticle)
Post-patch hook.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Various functions to operate on Lists.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
stressControl lookup("compactNormalStress") >> compactNormalStress
A class for handling words, derived from string.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
List< Key > toc() const
Return the table of contents.
Database for solution data, solver performance and other reduced data.
IOstream::compressionType writeCompression() const
Default write compression.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
#define WarningInFunction
Report a warning using Foam::Warning.
Mesh data needed to do the Finite Volume discretisation.
Standard post-processing.
A patch is a list of labels that address the faces in the global face list.
Templated base class for dsmc cloud.
Output to memory buffer stream.
Templated cloud function object base class.
label index() const
Return the index of this patch in the boundaryMesh.
const word & name() const
Return name.
PatchPostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
const Time & time() const
Return the top-level database.