37 void Foam::patchProbes::writeValues
39 const word& fieldName,
41 const scalar timeValue
49 os <<
setw(w) << timeValue;
51 for (
const auto& v :
values)
60 template<
class GeoField>
61 void Foam::patchProbes::performAction
63 const fieldGroup<GeoField>& fieldNames,
67 for (
const word& fieldName : fieldNames)
69 tmp<GeoField> tfield = getOrLoadField<GeoField>(fieldName);
73 const auto&
field = tfield();
74 const scalar timeValue =
field.time().timeOutputValue();
76 Field<typename GeoField::value_type>
values(sample(
field));
78 this->storeResults(fieldName,
values);
79 if (request & ACTION_WRITE)
81 this->writeValues(fieldName,
values, timeValue);
97 auto&
values = tvalues.ref();
104 label facei = faceList_[probei];
109 label localFacei =
patches[patchi].whichFace(facei);
110 values[probei] = bField[patchi][localFacei];
127 auto&
values = tvalues.ref();
134 label facei = faceList_[probei];
139 label localFacei =
patches[patchi].whichFace(facei);
140 values[probei] = bField[patchi][localFacei];
Ostream & endl(Ostream &os)
Add newline and flush stream.
A traits class, which is primarily used for primitives.
static unsigned int defaultPrecision() noexcept
Return the default precision.
Generic GeometricField class.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
#define forAll(list, i)
Loop across all elements in list.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Generic templated field type.
A class for handling words, derived from Foam::string.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
Istream and Ostream manipulators taking arguments.
OBJstream os(runTime.globalPath()/outputName)
HashPtrTable< OFstream > probeFilePtrs_
Current open files (non-empty on master only)
tmp< Field< Type > > sample(const VolumeField< Type > &) const
Sample a volume field at all locations.
label whichPatch(const label faceIndex) const
Return patch index for a given mesh face index.
static bool master(const label communicator=worldComm)
Am I the master rank.
const polyBoundaryMesh & patches
tmp< Field< Type > > sampleSurfaceField(const word &fieldName) const
Sample a surface field at all locations.
Omanip< int > setw(const int i)
A class for managing temporary objects.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
After completion all processors have the same data.