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->outputTimeDir());
78 this->outputTimeDir()/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())
149 "Foam::PatchPostProcessing<CloudType>::PatchPostProcessing" 151 "const dictionary&, " 154 ) <<
"Cannot find any patch names matching " << patchName[i]
158 uniquePatchIDs.
insert(patchIDs);
161 patchIDs_ = uniquePatchIDs.
toc();
167 const label patchI = patchIDs_[i];
168 const word& patchName = owner.mesh().boundaryMesh()[patchI].name();
169 Info<<
"Post-process patch " << patchName <<
endl;
173 patchData_.setSize(patchIDs_.size());
174 times_.setSize(patchIDs_.size());
178 template<
class CloudType>
185 maxStoredParcels_(ppm.maxStoredParcels_),
186 patchIDs_(ppm.patchIDs_),
188 patchData_(ppm.patchData_)
194 template<
class CloudType>
201 template<
class CloudType>
212 const label localPatchI = applyToPatch(patchI);
214 if (localPatchI != -1 && patchData_[localPatchI].size() < maxStoredParcels_)
216 times_[localPatchI].append(this->owner().time().value());
219 data<< Pstream::myProcNo() <<
' ' <<
p;
221 patchData_[localPatchI].append(data.
str());
Mesh data needed to do the Finite Volume discretisation.
bool empty() const
Return true if the UList is empty (ie, size() is zero).
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
string str() const
Return the string.
label index() const
Return the index of this patch in the boundaryMesh.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Various functions to operate on Lists.
Database for solution data, solver performance and other reduced data.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A patch is a list of labels that address the faces in the global face list.
const Time & time() const
Return the top-level database.
void write()
Write post-processing info.
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.
stressControl lookup("compactNormalStress") >> compactNormalStress
#define WarningIn(functionName)
Report a warning using Foam::Warning.
Standard post-processing.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
Output to memory buffer stream.
List< Key > toc() const
Return the table of contents.
IOstream::compressionType writeCompression() const
Default write compression.
const word & name() const
Return name.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual ~PatchPostProcessing()
Destructor.
#define forAllReverse(list, i)
PatchPostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Operations on lists of strings.
Templated base class for dsmc cloud.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Templated cloud function object base class.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
virtual void postPatch(const parcelType &p, const polyPatch &pp, const scalar trackFraction, const tetIndices &tetIs, bool &keepParticle)
Post-patch hook.
bool insert(const Key &key)
Insert a new entry.