31 Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
33 const trackingData& td,
34 const point& position,
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
270 if (tEnd <= ROOTVSMALL)
294 Pout<<
"wallBoundedStreamLineParticle :" 295 <<
" Removing stagnant particle:" 297 <<
" sampled positions:" << sampledPositions_.size()
309 Pout<<
"wallBoundedStreamLineParticle : Removing particle:" 311 <<
" sampled positions:" << sampledPositions_.size()
324 forAll(sampledScalars_, i)
331 forAll(sampledVectors_, i)
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&)" #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.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
const boundBox & bounds() const
Return mesh bounding box.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< DynamicList< vectorList > > & allVectors_
dimensionedSymmTensor sqr(const dimensionedVector &dv)
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
static void writeFields(const Cloud< wallBoundedStreamLineParticle > &)
Write.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
tetIndices currentTetIndices() const
Return the indices of the current tet that the.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
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.
List< vector > vectorList
A List of vectors.
bool move(trackingData &, const scalar trackTime)
Track all particles to their end point.
scalar & stepFraction()
Return the fraction of time-step completed.
scalar mag() const
The magnitude of the bounding box span.
const vector & position() const
Return current particle position.
List< scalar > scalarList
A List of scalars.
const polyMesh & mesh_
Reference to the polyMesh database.
DynamicList< vectorList > & allPositions_
const scalar trackLength_
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
static void readFields(CloudType &)
Read.
static void readFields(Cloud< wallBoundedStreamLineParticle > &)
Read.
static void writeFields(const CloudType &)
Write.
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.
vector point
Point is a vector.
scalar trackToEdge(TrackData &td, const vector &endPosition)
Equivalent of trackToFace.
virtual bool write() const
Write using setting from DB.
label & cell()
Return current cell particle is in.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
Class used to pass tracking data to the trackToEdge function.
label & tetFace()
Return current tet face particle is in.
Particle class that samples fields as it passes through. Used in streamline calculation.
bool switchProcessor
Flag to switch processor.
A primitive field of type <T> with automated input and output.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
List< DynamicList< scalarList > > & allScalars_