47 {
"forward",
"backward",
"both"};
49 namespace functionObjects
63 Foam::functionObjects::streamLine::wallPatch()
const 71 if (isA<wallPolyPatch>(patches[
patchi]))
83 if (isA<wallPolyPatch>(patches[
patchi]))
89 addressing[nFaces++] = pp.
start()+i;
109 void Foam::functionObjects::streamLine::track()
119 const sampledSet& seedPoints = sampledSetPtr_();
129 seedPoints.
cells()[i],
137 Info <<
" seeded " << nSeeds <<
" particles" <<
endl;
163 <<
"Cannot find field " << fields_[i] <<
nl 164 <<
"Valid scalar fields are:" 166 <<
"Valid vector fields are:" 189 interpolationScheme_,
201 if (f.
name() == UName_)
211 interpolationScheme_,
219 scalarNames_.setSize(vsInterp.
size());
222 scalarNames_[i] = vsInterp[i].psi().name();
227 vectorNames_[i] = vvInterp[i].psi().name();
235 <<
"Cannot find field to move particles with : " << UName_ <<
nl 236 <<
"This field has to be present in the sampled fields " << fields_
237 <<
" and in the objectRegistry." 246 allTracks_.setCapacity(nSeeds);
247 allScalars_.setSize(vsInterp.
size());
250 allScalars_[i].clear();
251 allScalars_[i].setCapacity(nSeeds);
253 allVectors_.setSize(vvInterp.
size());
256 allVectors_[i].clear();
257 allVectors_[i].setCapacity(nSeeds);
269 trackDirection_ == trackDirection::FORWARD,
284 if (trackDirection_ == trackDirection::BOTH)
286 initialParticles = particles;
289 particles.
move(particles, td, trackTime);
291 if (trackDirection_ == trackDirection::BOTH)
295 particles.
move(particles, td, trackTime);
302 Foam::functionObjects::streamLine::streamLine
334 dict.
lookup(
"fields") >> fields_;
340 <<
"Velocity field for tracking " << UName_
341 <<
" should be present in the list of fields " << fields_
346 if (!dict.
found(
"direction") && dict.
found(
"trackForward"))
350 ? trackDirection::FORWARD
351 : trackDirection::BACKWARD;
355 trackDirection_ = trackDirectionNames_[
word(dict.
lookup(
"direction"))];
358 dict.
lookup(
"lifeTime") >> lifeTime_;
362 <<
"Illegal value " << lifeTime_ <<
" for lifeTime" 367 bool subCycling = dict.
found(
"nSubCycle");
368 bool fixedLength = dict.
found(
"trackLength");
370 if (subCycling && fixedLength)
373 <<
"Cannot both specify automatic time stepping (through '" 374 <<
"nSubCycle' specification) and fixed track length (through '" 383 trackLength_ = vGreat;
388 Info<<
" automatic track length specified through" 389 <<
" number of sub cycles : " << nSubCycle_ << nl <<
endl;
393 dict.
lookup(
"trackLength") >> trackLength_;
395 Info<<
" fixed track length specified : " 396 << trackLength_ << nl <<
endl;
402 "interpolationScheme",
417 sampledSetAxis_ = sampledSetPtr_->axis();
462 fromProc.
setSize(globalTrackIDs.localSize(proci));
465 fromProc[i] = trackI++;
471 toMaster.
setSize(globalTrackIDs.localSize());
479 globalTrackIDs.size(),
491 distMap.constructSize(),
494 distMap.constructMap(),
501 forAll(allScalars_, scalarI)
503 allScalars_[scalarI].shrink();
508 distMap.constructSize(),
511 distMap.constructMap(),
513 allScalars_[scalarI],
516 allScalars_[scalarI].setCapacity(allScalars_[scalarI].size());
519 forAll(allVectors_, vectorI)
521 allVectors_[vectorI].shrink();
526 distMap.constructSize(),
529 distMap.constructMap(),
531 allVectors_[vectorI],
534 allVectors_[vectorI].setCapacity(allVectors_[vectorI].size());
540 forAll(allTracks_, trackI)
542 n += allTracks_[trackI].size();
545 Info<<
" Tracks:" << allTracks_.size() << nl
546 <<
" Total samples:" << n
560 ? runTime.
path()/
".."/
"postProcessing"/
"sets"/
name()
561 : runTime.
path()/
"postProcessing"/
"sets"/
name()
565 vtkPath = vtkPath/mesh_.
name();
567 vtkPath = vtkPath/mesh_.time().timeName();
574 forAll(allTracks_, trackI)
585 tracks[trackI].transfer(allTracks_[trackI]);
590 if (allScalars_.size() > 0)
594 forAll(allScalars_, scalarI)
597 allScalars_[scalarI];
598 scalarValues[scalarI].
setSize(allTrackVals.
size());
600 forAll(allTrackVals, trackI)
603 scalarValues[scalarI][trackI].
transfer(trackVals);
610 / scalarFormatterPtr_().getFileName
619 scalarFormatterPtr_().
write 631 if (allVectors_.size() > 0)
635 forAll(allVectors_, vectorI)
638 allVectors_[vectorI];
639 vectorValues[vectorI].
setSize(allTrackVals.
size());
641 forAll(allTrackVals, trackI)
644 vectorValues[vectorI][trackI].
transfer(trackVals);
651 / vectorFormatterPtr_().getFileName
658 vectorFormatterPtr_().write
675 if (&mpm.
mesh() == &mesh_)
Template class for intrusive linked lists.
Class containing functor to negate primitives. Dummy for all other types.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
fileName path() const
Return path.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
A class for handling file names.
bool set(const label) const
Is element set.
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
void size(const label)
Override size to be inconsistent with allocated storage.
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.
label size() const
Return the number of particles in the cloud.
Field reading functions for post-processing utilities.
virtual ~streamLine()
Destructor.
Abstract base-class for Time/database function objects.
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
Initialise the NamedEnum HashTable from the static list of names.
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.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
T lookupType(const word &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
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.
void addParticle(ParticleType *pPtr)
Transfer particle to cloud.
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...
Holds list of sampling points which is filled at construction time. Various implementations of this b...
A class for handling words, derived from string.
Particle class that samples fields as it passes through. Used in streamline calculation.
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.
word name() const
Return file name (part beyond last /)
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
static autoPtr< writer > New(const word &writeFormat)
Return a reference to the selected writer.
const Time & time() const
Return time.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence 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.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
label size() const
Return the number of elements in the UPtrList.
A Cloud of streamLine particles.
void setSize(const label)
Reset size of List.
void move(TrackCloudType &cloud, typename ParticleType::trackingData &td, const scalar trackTime)
Move the particles.
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.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#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...
const polyMesh & mesh() const
Return polyMesh.
label start() const
Return start label of this patch in the polyMesh face list.
Abstract base class for interpolation.
static const NamedEnum< trackDirection, 3 > trackDirectionNames_
Track direction enumeration names.
fileName path() const
Return directory path name (part before last /)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
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.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
virtual void movePoints(const polyMesh &)
Update for mesh point-motion.
virtual bool execute()
Do nothing.
A patch is a list of labels that address the faces in the global face list.
void transfer(List< T > &)
Transfer contents of the argument List into this.
const labelList & cells() const
A List with indirect addressing.
virtual bool write()
Calculate and write the steamlines.
addToRunTimeSelectionTable(functionObject, add, dictionary)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.