35 void Foam::sampledSurfaces::writeSurface
37 const Field<Type>& values,
39 const word& fieldName,
40 const fileName& outputDir
60 accessOp<Field<Type>>()
65 if (mergeList_[surfI].pointsMap.size() == allValues.size())
68 allValues.setSize(mergeList_[surfI].
points.size());
73 if (mergeList_[surfI].faces.size())
79 mergeList_[surfI].points,
80 mergeList_[surfI].faces,
110 void Foam::sampledSurfaces::sampleAndWrite
112 const GeometricField<Type, fvPatchField, volMesh>& vField
116 autoPtr<interpolation<Type>> interpolatorPtr;
118 const word& fieldName = vField.name();
119 const fileName outputDir = outputPath_/vField.time().timeName();
129 if (interpolatorPtr.empty())
133 interpolationScheme_,
138 values = s.interpolate(interpolatorPtr());
142 values = s.sample(vField);
145 writeSurface<Type>(values, surfI, fieldName, outputDir);
151 void Foam::sampledSurfaces::sampleAndWrite
153 const GeometricField<Type, fvsPatchField, surfaceMesh>& sField
156 const word& fieldName = sField.name();
157 const fileName outputDir = outputPath_/sField.time().timeName();
162 Field<Type> values(s.sample(sField));
163 writeSurface<Type>(values, surfI, fieldName, outputDir);
168 template<
class GeoField>
169 void Foam::sampledSurfaces::sampleAndWrite(
const IOobjectList& objects)
174 IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
175 names = fieldObjects.names();
188 const word& fieldName = iter.key();
192 Pout<<
"sampleAndWrite: " << fieldName <<
endl;
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
#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.
static autoPtr< interpolation< Type > > New(const word &interpolationType, const GeometricField< Type, fvPatchField, volMesh > &psi)
Return a reference to the specified interpolation scheme.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
wordList names() const
Return the list of names of the IOobjects.
const T & operator[](const label) const
Return element const reference.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Operations on lists of strings.
const Time & time() const
Return the top-level database.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
AccessType combine(const List< T > &, AccessOp aop=accessOp< T >())
Combines sublists into one big list.
static List< word > fieldNames
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< label > labelList
A List of labels.
HashSet wordHashSet
A HashSet with word keys.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
List< word > wordList
A List of words.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
prefixOSstream Pout(cout, "Pout")
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.