35 void Foam::ignitionSite::findIgnitionCells(
const fvMesh&
mesh)
42 label ignCell =
mesh.findCell(location_);
48 scalar radius = diameter_/2.0;
54 cellVolumes_[0] = vols[ignCell];
56 scalar minDist = GREAT;
61 scalar dist =
mag(centres[celli] - location_);
68 if (dist < radius && celli != ignCell)
71 cellVolumes_.
setSize(nIgnCells+1);
73 cells_[nIgnCells] = celli;
74 cellVolumes_[nIgnCells] = vols[celli];
91 if (mesh_.changing() && timeIndex_ != db_.timeIndex())
93 const_cast<ignitionSite&
>(*this).findIgnitionCells(mesh_);
95 timeIndex_ = db_.timeIndex();
103 scalar curTime = db_.value();
104 scalar deltaT = db_.deltaTValue();
108 (curTime - deltaT >= time_)
110 (curTime - deltaT < time_ +
max(duration_, deltaT) + SMALL)
117 scalar curTime = db_.value();
118 scalar deltaT = db_.deltaTValue();
120 return(curTime - deltaT >= time_);
133 location_ = is.location_;
134 diameter_ = is.diameter_;
136 duration_ = is.duration_;
137 strength_ = is.strength_;
139 cellVolumes_ = is.cellVolumes_;
void size(const label n)
Older name for setAddressableSize.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< vector, fvPatchField, volMesh > volVectorField
#define forAll(list, i)
Loop across all elements in list.
void operator=(const ignitionSite &)
void setSize(const label n)
Alias for resize()
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const labelList & cells() const
Return the ignition cells updated if the mesh moved.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.