50 Foam::streamLine::wallPatch()
const 52 const fvMesh& mesh =
dynamic_cast<const fvMesh&
>(obr_);
54 const polyBoundaryMesh& patches = mesh.boundaryMesh();
61 if (isA<wallPolyPatch>(patches[patchI]))
63 nFaces += patches[patchI].size();
74 if (isA<wallPolyPatch>(patches[patchI]))
76 const polyPatch& pp = patches[patchI];
80 addressing[nFaces++] = pp.start()+i;
85 return autoPtr<indirectPrimitivePatch>
100 void Foam::streamLine::track()
102 const Time& runTime = obr_.time();
103 const fvMesh& mesh =
dynamic_cast<const fvMesh&
>(obr_);
105 IDLList<streamLineParticle> initialParticles;
106 streamLineParticleCloud particles
113 const sampledSet& seedPoints = sampledSetPtr_();
117 particles.addParticle
119 new streamLineParticle
123 seedPoints.cells()[i],
131 Info <<
" seeded " << nSeeds <<
" particles" <<
endl;
134 PtrList<volScalarField> vsFlds;
135 PtrList<interpolation<scalar> > vsInterp;
136 PtrList<volVectorField> vvFlds;
137 PtrList<interpolation<vector> > vvInterp;
143 IOobjectList allObjects(mesh, runTime.timeName());
145 IOobjectList objects(2*fields_.size());
148 objects.add(*allObjects[fields_[i]]);
152 vsInterp.setSize(vsFlds.size());
160 interpolationScheme_,
166 vvInterp.setSize(vvFlds.size());
174 interpolationScheme_,
198 <<
"Cannot find field " << fields_[i] <<
nl 199 <<
"Valid scalar fields are:" 201 <<
"Valid vector fields are:" 206 vsInterp.setSize(nScalar);
208 vvInterp.setSize(nVector);
224 interpolationScheme_,
236 if (f.name() == UName_)
246 interpolationScheme_,
255 scalarNames_.
setSize(vsInterp.size());
258 scalarNames_[i] = vsInterp[i].psi().name();
260 vectorNames_.setSize(vvInterp.size());
263 vectorNames_[i] = vvInterp[i].psi().name();
271 <<
"Cannot find field to move particles with : " << UName_ <<
nl 272 <<
"This field has to be present in the sampled fields " << fields_
273 <<
" and in the objectRegistry." 282 allTracks_.setCapacity(nSeeds);
283 allScalars_.setSize(vsInterp.size());
286 allScalars_[i].clear();
287 allScalars_[i].setCapacity(nSeeds);
289 allVectors_.setSize(vvInterp.size());
292 allVectors_[i].clear();
293 allVectors_[i].setCapacity(nSeeds);
298 streamLineParticle::trackingData td
319 particles.move(td, trackTime);
325 Foam::streamLine::streamLine
330 const bool loadFromFiles
336 loadFromFiles_(loadFromFiles),
341 if (isA<fvMesh>(obr_))
350 "streamLine::streamLine\n" 353 "const objectRegistry&,\n" 354 "const dictionary&,\n" 357 ) <<
"No fvMesh available, deactivating." 378 dict.
lookup(
"fields") >> fields_;
379 if (dict.
found(
"UName"))
381 dict.
lookup(
"UName") >> UName_;
388 IOWarningIn(
"streamLine::read(const dictionary&)", dict)
389 <<
"Using deprecated entry \"U\"." 390 <<
" Please use \"UName\" instead." 392 dict.
lookup(
"U") >> UName_;
399 <<
"Velocity field for tracking " << UName_
400 <<
" should be present in the list of fields " << fields_
405 dict.
lookup(
"trackForward") >> trackForward_;
406 dict.
lookup(
"lifeTime") >> lifeTime_;
410 <<
"Illegal value " << lifeTime_ <<
" for lifeTime" 415 bool subCycling = dict.
found(
"nSubCycle");
416 bool fixedLength = dict.
found(
"trackLength");
418 if (subCycling && fixedLength)
421 <<
"Cannot both specify automatic time stepping (through '" 422 <<
"nSubCycle' specification) and fixed track length (through '" 431 trackLength_ = VGREAT;
436 Info<<
" automatic track length specified through" 437 <<
" number of sub cycles : " << nSubCycle_ << nl <<
endl;
441 dict.
lookup(
"trackLength") >> trackLength_;
443 Info<<
" fixed track length specified : " 444 << trackLength_ << nl <<
endl;
450 "interpolationScheme",
458 dict.
lookup(
"seedSampleSet") >> seedSet_;
472 coeffsDict.
lookup(
"axis") >> sampledSetAxis_;
528 Info<<
type() <<
" " << name_ <<
" output:" <<
nl;
558 fromProc.
setSize(globalTrackIDs.localSize(procI));
561 fromProc[i] = trackI++;
567 toMaster.
setSize(globalTrackIDs.localSize());
575 globalTrackIDs.size(),
587 distMap.constructSize(),
589 distMap.constructMap(),
594 forAll(allScalars_, scalarI)
600 distMap.constructSize(),
602 distMap.constructMap(),
607 forAll(allVectors_, vectorI)
613 distMap.constructSize(),
615 distMap.constructMap(),
623 forAll(allTracks_, trackI)
625 n += allTracks_[trackI].size();
628 Info<<
" Tracks:" << allTracks_.size() << nl
629 <<
" Total samples:" << n
643 ? runTime.
path()/
".."/
"postProcessing"/
"sets"/
name()
644 : runTime.
path()/
"postProcessing"/
"sets"/
name()
648 vtkPath = vtkPath/mesh.
name();
657 forAll(allTracks_, trackI)
668 tracks[trackI].transfer(allTracks_[trackI]);
673 if (allScalars_.size() > 0)
677 forAll(allScalars_, scalarI)
680 allScalars_[scalarI];
681 scalarValues[scalarI].
setSize(allTrackVals.
size());
683 forAll(allTrackVals, trackI)
686 scalarValues[scalarI][trackI].
transfer(trackVals);
693 / scalarFormatterPtr_().getFileName
702 scalarFormatterPtr_().
write 714 if (allVectors_.size() > 0)
718 forAll(allVectors_, vectorI)
721 allVectors_[vectorI];
722 vectorValues[vectorI].
setSize(allTrackVals.
size());
724 forAll(allTrackVals, trackI)
727 vectorValues[vectorI][trackI].
transfer(trackVals);
734 / vectorFormatterPtr_().getFileName
743 vectorFormatterPtr_().write
dimensionedScalar sqrt(const dimensionedScalar &ds)
static bool & parRun()
Is this a parallel run?
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
static autoPtr< writer > New(const word &writeFormat)
Return a reference to the selected writer.
void transfer(List< T > &)
Transfer contents of the argument List into this.
virtual void end()
Execute the averaging at the final time-loop, currently does nothing.
static const char *const typeName
Mesh data needed to do the Finite Volume discretisation.
const word & name() const
Return reference to name.
virtual void read(const dictionary &)
Read the field average data.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
fileName path() const
Return path.
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const labelListList &constructMap, List< T > &, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for Pstream::scheduled.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Holds list of sampling positions.
word name(const complex &)
Return a string representation of a complex.
static autoPtr< sampledSet > New(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Return a reference to the selected sampledSet.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
Class containing processor-to-processor mapping information.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A class for handling words, derived from string.
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 word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
fileName path() const
Return directory path name (part before last /)
A list of keyword definitions, which are a keyword followed by any number of values (e...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
#define IOWarningIn(functionName, ios)
Report an IO warning using Foam::Warning.
const Time & time() const
Return the top-level database.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
wordList ReadFields(const Mesh &mesh, const IOobjectList &objects, PtrList< GeoField > &fields, const bool syncPar=true)
Helper routine to read fields.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
virtual Ostream & write(const token &)=0
Write next token to stream.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
void setSize(const label)
Alter the addressed list size.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Helper routine to read fields.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
virtual ~streamLine()
Destructor.
Given cell centre values and point (vertex) values decompose into tetrahedra and linear interpolate w...
virtual void execute()
Execute the averaging.
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
GeometricField< vector, fvPatchField, volMesh > volVectorField
static word defaultRegion
Return the default region name.
Mesh consisting of general polyhedral cells.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Registry of regIOobjects.
List< label > labelList
A List of labels.
virtual void movePoints(const polyMesh &)
Update for mesh point-motion.
A class for handling file names.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
virtual void write()
Calculate the field average data and write.
static bool master(const label communicator=0)
Am I the master process.
bool read(const char *, int32_t &)
const Time & time() const
Return time.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
static autoPtr< interpolation< scalar > > New(const word &interpolationType, const GeometricField< scalar, fvPatchField, volMesh > &psi)
Return a reference to the specified interpolation scheme.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
defineTypeNameAndDebug(combustionModel, 0)