33 void Foam::ignitionSite::findIgnitionCells(
const fvMesh&
mesh)
46 scalar radius = diameter_/2.0;
52 cellVolumes_[0] = vols[ignCell];
59 scalar dist =
mag(centres[celli] - location_);
66 if (dist < radius && celli != ignCell)
69 cellVolumes_.
setSize(nIgnCells+1);
71 cells_[nIgnCells] = celli;
72 cellVolumes_[nIgnCells] = vols[celli];
80 Pout<<
"Found ignition cells:" <<
endl << cells_ <<
endl;
89 if (mesh_.changing() && timeIndex_ != db_.timeIndex())
91 const_cast<ignitionSite&
>(*this).findIgnitionCells(mesh_);
93 timeIndex_ = db_.timeIndex();
101 scalar curTime = db_.value();
102 scalar deltaT = db_.deltaTValue();
106 (curTime - deltaT >= time_)
108 (curTime - deltaT < time_ +
max(duration_, deltaT) + small)
115 scalar curTime = db_.value();
116 scalar deltaT = db_.deltaTValue();
118 return(curTime - deltaT >= time_);
126 location_ = is.location_;
127 diameter_ = is.diameter_;
129 duration_ = is.duration_;
130 strength_ = is.strength_;
132 cellVolumes_ = is.cellVolumes_;
#define forAll(list, i)
Loop across all elements in list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
const volVectorField & C() const
Return cell centres.
const DimensionedField< scalar, fvMesh > & V() const
Return cell volumes.
const labelList & cells() const
Return the ignition cells updated if the mesh moved.
void operator=(const ignitionSite &)
label findCell(const point &p, const pointInCellShapes=pointInCellShapes::tets) const
Find the cell containing the given point.
static const meshSearch & New(const polyMesh &mesh, const pointInCellShapes=pointInCellShapes::tets)
Lookup or construct from mesh and cell decomposition option.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
scalar minDist(const List< pointIndexHit > &hitList)
VolField< vector > volVectorField
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
prefixOSstream Pout(cout, "Pout")
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)