44 namespace functionObjects
55 Foam::functionObjects::streamLine::wallPatch()
const 57 const polyBoundaryMesh& patches = mesh_.boundaryMesh();
63 if (isA<wallPolyPatch>(patches[patchi]))
65 nFaces += patches[
patchi].size();
75 if (isA<wallPolyPatch>(patches[patchi]))
77 const polyPatch& pp = patches[
patchi];
81 addressing[nFaces++] = pp.start()+i;
86 return autoPtr<indirectPrimitivePatch>
101 void Foam::functionObjects::streamLine::track()
103 IDLList<streamLineParticle> initialParticles;
104 streamLineParticleCloud particles
111 const sampledSet& seedPoints = sampledSetPtr_();
115 particles.addParticle
117 new streamLineParticle
121 seedPoints.cells()[i],
129 Info <<
" seeded " << nSeeds <<
" particles" <<
endl;
132 PtrList<volScalarField> vsFlds;
133 PtrList<interpolation<scalar>> vsInterp;
134 PtrList<volVectorField> vvFlds;
135 PtrList<interpolation<vector>> vvInterp;
155 <<
"Cannot find field " << fields_[i] <<
nl 156 <<
"Valid scalar fields are:" 158 <<
"Valid vector fields are:" 163 vsInterp.setSize(nScalar);
165 vvInterp.setSize(nVector);
181 interpolationScheme_,
193 if (f.name() == UName_)
203 interpolationScheme_,
211 scalarNames_.
setSize(vsInterp.size());
214 scalarNames_[i] = vsInterp[i].psi().name();
216 vectorNames_.setSize(vvInterp.size());
219 vectorNames_[i] = vvInterp[i].psi().name();
227 <<
"Cannot find field to move particles with : " << UName_ <<
nl 228 <<
"This field has to be present in the sampled fields " << fields_
229 <<
" and in the objectRegistry." 238 allTracks_.setCapacity(nSeeds);
239 allScalars_.setSize(vsInterp.size());
242 allScalars_[i].clear();
243 allScalars_[i].setCapacity(nSeeds);
245 allVectors_.setSize(vvInterp.size());
248 allVectors_[i].clear();
249 allVectors_[i].setCapacity(nSeeds);
254 streamLineParticle::trackingData td
275 particles.move(td, trackTime);
281 Foam::functionObjects::streamLine::streamLine
313 dict.
lookup(
"fields") >> fields_;
319 <<
"Velocity field for tracking " << UName_
320 <<
" should be present in the list of fields " << fields_
325 dict.
lookup(
"trackForward") >> trackForward_;
326 dict.
lookup(
"lifeTime") >> lifeTime_;
330 <<
"Illegal value " << lifeTime_ <<
" for lifeTime" 335 bool subCycling = dict.
found(
"nSubCycle");
336 bool fixedLength = dict.
found(
"trackLength");
338 if (subCycling && fixedLength)
341 <<
"Cannot both specify automatic time stepping (through '" 342 <<
"nSubCycle' specification) and fixed track length (through '" 351 trackLength_ = VGREAT;
356 Info<<
" automatic track length specified through" 357 <<
" number of sub cycles : " << nSubCycle_ << nl <<
endl;
361 dict.
lookup(
"trackLength") >> trackLength_;
363 Info<<
" fixed track length specified : " 364 << trackLength_ << nl <<
endl;
370 "interpolationScheme",
385 sampledSetAxis_ = sampledSetPtr_->axis();
430 fromProc.
setSize(globalTrackIDs.localSize(proci));
433 fromProc[i] = trackI++;
439 toMaster.
setSize(globalTrackIDs.localSize());
447 globalTrackIDs.size(),
459 distMap.constructSize(),
462 distMap.constructMap(),
469 forAll(allScalars_, scalarI)
471 allScalars_[scalarI].shrink();
476 distMap.constructSize(),
479 distMap.constructMap(),
481 allScalars_[scalarI],
484 allScalars_[scalarI].setCapacity(allScalars_[scalarI].size());
487 forAll(allVectors_, vectorI)
489 allVectors_[vectorI].shrink();
494 distMap.constructSize(),
497 distMap.constructMap(),
499 allVectors_[vectorI],
502 allVectors_[vectorI].setCapacity(allVectors_[vectorI].size());
508 forAll(allTracks_, trackI)
510 n += allTracks_[trackI].size();
513 Info<<
" Tracks:" << allTracks_.size() << nl
514 <<
" Total samples:" << n
528 ? runTime.
path()/
".."/
"postProcessing"/
"sets"/
name()
529 : runTime.
path()/
"postProcessing"/
"sets"/
name()
533 vtkPath = vtkPath/mesh_.
name();
535 vtkPath = vtkPath/mesh_.time().timeName();
542 forAll(allTracks_, trackI)
553 tracks[trackI].transfer(allTracks_[trackI]);
558 if (allScalars_.size() > 0)
562 forAll(allScalars_, scalarI)
565 allScalars_[scalarI];
566 scalarValues[scalarI].
setSize(allTrackVals.
size());
568 forAll(allTrackVals, trackI)
571 scalarValues[scalarI][trackI].
transfer(trackVals);
578 / scalarFormatterPtr_().getFileName
587 scalarFormatterPtr_().
write 599 if (allVectors_.size() > 0)
603 forAll(allVectors_, vectorI)
606 allVectors_[vectorI];
607 vectorValues[vectorI].
setSize(allTrackVals.
size());
609 forAll(allTrackVals, trackI)
612 vectorValues[vectorI][trackI].
transfer(trackVals);
619 / vectorFormatterPtr_().getFileName
626 vectorFormatterPtr_().write
643 if (&mpm.
mesh() == &mesh_)
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.
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.
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.
virtual ~streamLine()
Destructor.
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.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
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.
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.
List< label > labelList
A List of labels.
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 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.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
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.
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.
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.
void transfer(List< T > &)
Transfer contents of the argument List into this.
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.