45 namespace functionObjects
56 Foam::functionObjects::streamLine::wallPatch()
const 58 const fvMesh& mesh =
dynamic_cast<const fvMesh&
>(obr_);
60 const polyBoundaryMesh& patches = mesh.boundaryMesh();
66 if (isA<wallPolyPatch>(patches[patchi]))
68 nFaces += patches[
patchi].size();
78 if (isA<wallPolyPatch>(patches[patchi]))
80 const polyPatch& pp = patches[
patchi];
84 addressing[nFaces++] = pp.start()+i;
89 return autoPtr<indirectPrimitivePatch>
104 void Foam::functionObjects::streamLine::track()
106 const fvMesh& mesh =
dynamic_cast<const fvMesh&
>(obr_);
108 IDLList<streamLineParticle> initialParticles;
109 streamLineParticleCloud particles
116 const sampledSet& seedPoints = sampledSetPtr_();
120 particles.addParticle
122 new streamLineParticle
126 seedPoints.cells()[i],
134 Info <<
" seeded " << nSeeds <<
" particles" <<
endl;
137 PtrList<volScalarField> vsFlds;
138 PtrList<interpolation<scalar>> vsInterp;
139 PtrList<volVectorField> vvFlds;
140 PtrList<interpolation<vector>> vvInterp;
160 <<
"Cannot find field " << fields_[i] <<
nl 161 <<
"Valid scalar fields are:" 163 <<
"Valid vector fields are:" 168 vsInterp.setSize(nScalar);
170 vvInterp.setSize(nVector);
186 interpolationScheme_,
198 if (f.name() == UName_)
208 interpolationScheme_,
216 scalarNames_.
setSize(vsInterp.size());
219 scalarNames_[i] = vsInterp[i].psi().name();
221 vectorNames_.setSize(vvInterp.size());
224 vectorNames_[i] = vvInterp[i].psi().name();
232 <<
"Cannot find field to move particles with : " << UName_ <<
nl 233 <<
"This field has to be present in the sampled fields " << fields_
234 <<
" and in the objectRegistry." 243 allTracks_.setCapacity(nSeeds);
244 allScalars_.setSize(vsInterp.size());
247 allScalars_[i].clear();
248 allScalars_[i].setCapacity(nSeeds);
250 allVectors_.setSize(vvInterp.size());
253 allVectors_[i].clear();
254 allVectors_[i].setCapacity(nSeeds);
259 streamLineParticle::trackingData td
280 particles.move(td, trackTime);
286 Foam::functionObjects::streamLine::streamLine
304 if (!isA<fvMesh>(obr_))
326 dict.
lookup(
"fields") >> fields_;
329 dict.
lookup(
"U") >> UName_;
337 <<
"Using deprecated entry \"U\"." 338 <<
" Please use \"UName\" instead." 340 dict.
lookup(
"U") >> UName_;
347 <<
"Velocity field for tracking " << UName_
348 <<
" should be present in the list of fields " << fields_
353 dict.
lookup(
"trackForward") >> trackForward_;
354 dict.
lookup(
"lifeTime") >> lifeTime_;
358 <<
"Illegal value " << lifeTime_ <<
" for lifeTime" 363 bool subCycling = dict.
found(
"nSubCycle");
364 bool fixedLength = dict.
found(
"trackLength");
366 if (subCycling && fixedLength)
369 <<
"Cannot both specify automatic time stepping (through '" 370 <<
"nSubCycle' specification) and fixed track length (through '" 379 trackLength_ = VGREAT;
384 Info<<
" automatic track length specified through" 385 <<
" number of sub cycles : " << nSubCycle_ << nl <<
endl;
389 dict.
lookup(
"trackLength") >> trackLength_;
391 Info<<
" fixed track length specified : " 392 << trackLength_ << nl <<
endl;
398 "interpolationScheme",
403 dict.
lookup(
"seedSampleSet") >> seedSet_;
417 coeffsDict.
lookup(
"axis") >> sampledSetAxis_;
464 fromProc.
setSize(globalTrackIDs.localSize(proci));
467 fromProc[i] = trackI++;
473 toMaster.
setSize(globalTrackIDs.localSize());
481 globalTrackIDs.size(),
493 distMap.constructSize(),
496 distMap.constructMap(),
503 forAll(allScalars_, scalarI)
505 allScalars_[scalarI].shrink();
510 distMap.constructSize(),
513 distMap.constructMap(),
515 allScalars_[scalarI],
518 allScalars_[scalarI].setCapacity(allScalars_[scalarI].size());
521 forAll(allVectors_, vectorI)
523 allVectors_[vectorI].shrink();
528 distMap.constructSize(),
531 distMap.constructMap(),
533 allVectors_[vectorI],
536 allVectors_[vectorI].setCapacity(allVectors_[vectorI].size());
542 forAll(allTracks_, trackI)
544 n += allTracks_[trackI].size();
547 Info<<
" Tracks:" << allTracks_.size() << nl
548 <<
" Total samples:" << n
562 ? runTime.
path()/
".."/
"postProcessing"/
"sets"/
name()
563 : runTime.
path()/
"postProcessing"/
"sets"/
name()
567 vtkPath = vtkPath/mesh.
name();
576 forAll(allTracks_, trackI)
587 tracks[trackI].transfer(allTracks_[trackI]);
592 if (allScalars_.size() > 0)
596 forAll(allScalars_, scalarI)
599 allScalars_[scalarI];
600 scalarValues[scalarI].
setSize(allTrackVals.
size());
602 forAll(allTrackVals, trackI)
605 scalarValues[scalarI][trackI].
transfer(trackVals);
612 / scalarFormatterPtr_().getFileName
621 scalarFormatterPtr_().
write 633 if (allVectors_.size() > 0)
637 forAll(allVectors_, vectorI)
640 allVectors_[vectorI];
641 vectorValues[vectorI].
setSize(allTrackVals.
size());
643 forAll(allTrackVals, trackI)
646 vectorValues[vectorI][trackI].
transfer(trackVals);
653 / vectorFormatterPtr_().getFileName
660 vectorFormatterPtr_().write
677 const fvMesh& mesh_ =
dynamic_cast<const fvMesh&
>(obr_);
679 if (&mpm.
mesh() == &mesh_)
688 const fvMesh& mesh_ =
dynamic_cast<const fvMesh&
>(obr_);
const Time & time() const
Return time.
Class containing functor to negate primitives. Dummy for all other types.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
#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.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
static autoPtr< sampledSet > New(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Return a reference to the selected sampledSet.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
static const char *const typeName
static autoPtr< interpolation< scalar > > New(const word &interpolationType, const GeometricField< scalar, fvPatchField, volMesh > &psi)
Return a reference to the specified interpolation scheme.
void size(const label)
Override size to be inconsistent with allocated storage.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
static word defaultRegion
Return the default region name.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
Field reading functions for post-processing utilities.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
virtual ~streamLine()
Destructor.
Abstract base-class for Time/database function objects.
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
bool read(const char *, int32_t &)
void setSize(const label)
Alter the addressed list size.
virtual bool read(const dictionary &)
Read the field average data.
Holds list of sampling positions.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for Pstream::scheduled.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
List< label > labelList
A List of labels.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
static autoPtr< writer > New(const word &writeFormat)
Return a reference to the selected writer.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
word name(const complex &)
Return a string representation of a complex.
void setSize(const label)
Reset size of List.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Given cell centre values and point (vertex) values decompose into tetrahedra and linear interpolate w...
Class containing processor-to-processor mapping information.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
addToRunTimeSelectionTable(functionObject, blendingFactor, dictionary)
Mesh data needed to do the Finite Volume discretisation.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual Ostream & write(const token &)=0
Write next token to stream.
Mesh consisting of general polyhedral cells.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
virtual void movePoints(const polyMesh &)
Update for mesh point-motion.
virtual bool execute()
Do nothing.
Registry of regIOobjects.
fileName path() const
Return path.
void transfer(List< T > &)
Transfer contents of the argument List into this.
fileName path() const
Return directory path name (part before last /)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
const word & name() const
Return reference to name.
virtual bool write()
Calculate and write the steamlines.
const polyMesh & mesh() const
Return polyMesh.
const Time & time() const
Return the top-level database.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.