31 Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
33 const trackingData& td,
34 const point& position,
41 FatalErrorIn(
"wallBoundedStreamLineParticle::interpolateFields(..)")
47 const vector U = td.vvInterp_[td.UIndex_].interpolate
57 !sampledPositions_.size()
62 sampledPositions_.append(position);
65 sampledScalars_.setSize(td.vsInterp_.size());
66 forAll(td.vsInterp_, scalarI)
68 sampledScalars_[scalarI].append
70 td.vsInterp_[scalarI].interpolate
80 sampledVectors_.setSize(td.vvInterp_.size());
81 forAll(td.vvInterp_, vectorI)
84 if (vectorI == td.UIndex_)
90 positionU = td.vvInterp_[vectorI].interpolate
97 sampledVectors_[vectorI].append(positionU);
105 Foam::vector Foam::wallBoundedStreamLineParticle::sample
112 if (!td.trackForward_)
117 scalar magU =
mag(U);
138 const label tetFaceI,
140 const label meshEdgeStart,
141 const label diagEdge,
174 >> sampledPositions_ >> sampledScalars >> sampledVectors;
176 sampledScalars_.setSize(sampledScalars.
size());
179 sampledScalars_[i].transfer(sampledScalars[i]);
181 sampledVectors_.setSize(sampledVectors.size());
184 sampledVectors_[i].transfer(sampledVectors[i]);
191 "wallBoundedStreamLineParticle::wallBoundedStreamLineParticle" 192 "(const Cloud<wallBoundedStreamLineParticle>&, Istream&, bool)" 203 lifeTime_(p.lifeTime_),
204 sampledPositions_(p.sampledPositions_),
205 sampledScalars_(p.sampledScalars_),
206 sampledVectors_(p.sampledVectors_)
215 const scalar trackTime
227 td.switchProcessor =
false;
228 td.keepParticle =
true;
236 && !td.switchProcessor
270 if (tEnd <= ROOTVSMALL)
279 || td.switchProcessor
288 if (!td.keepParticle || lifeTime_ == 0)
294 Pout<<
"wallBoundedStreamLineParticle :" 295 <<
" Removing stagnant particle:" 297 <<
" sampled positions:" << sampledPositions_.size()
300 td.keepParticle =
false;
309 Pout<<
"wallBoundedStreamLineParticle : Removing particle:" 311 <<
" sampled positions:" << sampledPositions_.size()
324 forAll(sampledScalars_, i)
331 forAll(sampledVectors_, i)
340 return td.keepParticle;
371 iter().lifeTime_ = lifeTime[i];
372 iter().sampledPositions_.transfer(sampledPositions[i]);
401 lifeTime[i] = iter().lifeTime_;
402 sampledPositions[i] = iter().sampledPositions_;
407 sampledPositions.write();
419 os << static_cast<const wallBoundedParticle&>(
p)
428 "Ostream& operator<<(Ostream&, const wallBoundedStreamLineParticle&)"
label & cell()
Return current cell particle is in.
vector point
Point is a vector.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar mag() const
The magnitude of the bounding box span.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
#define forAllIter(Container, container, iter)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
Particle class that samples fields as it passes through. Used in streamline calculation.
wallBoundedStreamLineParticle(const polyMesh &c, const vector &position, const label cellI, const label tetFaceI, const label tetPtI, const label meshEdgeStart, const label diagEdge, const label lifeTime)
Construct from components.
Class used to pass tracking data to the trackToEdge function.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
virtual bool write() const
Write using setting from DB.
static void writeFields(const CloudType &)
Write.
List< DynamicList< scalarList > > & allScalars_
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void readFields(Cloud< wallBoundedStreamLineParticle > &)
Read.
static void writeFields(const Cloud< wallBoundedStreamLineParticle > &)
Write.
const vector & position() const
Return current particle position.
DynamicList< vectorList > & allPositions_
scalar trackToEdge(TrackData &td, const vector &endPosition)
Equivalent of trackToFace.
const polyMesh & mesh_
Reference to the polyMesh database.
label & tetFace()
Return current tet face particle is in.
List< scalar > scalarList
A List of scalars.
errorManip< error > abort(error &err)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
static void readFields(CloudType &)
Read.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
scalar & stepFraction()
Return the fraction of time-step completed.
Mesh consisting of general polyhedral cells.
List< vector > vectorList
A List of vectors.
const boundBox & bounds() const
Return mesh bounding box.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Vector< scalar > vector
A scalar version of the templated Vector.
wallBoundedParticle(const polyMesh &c, const vector &position, const label cellI, const label tetFaceI, const label tetPtI, const label meshEdgeStart, const label diagEdge)
Construct from components.
bool move(trackingData &, const scalar trackTime)
Track all particles to their end point.
const scalar trackLength_
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tetIndices currentTetIndices() const
Return the indices of the current tet that the.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
prefixOSstream Pout(cout,"Pout")
A primitive field of type <T> with automated input and output.
List< DynamicList< vectorList > > & allVectors_