void Foam::probes::findCells(const fvMesh& mesh) { if (cellList_.size() == 0) { cellList_.setSize(probeLocations_.size()); forAll(probeLocations_, probeI) { cellList_[probeI] = mesh.findCell(probeLocations_[probeI]); if (debug && cellList_[probeI] != -1) { Pout<< "probes : found point " << probeLocations_[probeI] << " in cell " << cellList_[probeI] << endl; } }
void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh) { // Bit tricky: generate C and V before shortcutting if cannot find // cell locally. mesh.C generation uses parallel communication. const volVectorField& centres = mesh.C(); const scalarField& vols = mesh.V(); label ignCell = mesh.findCell(location_); if (ignCell == -1) { return; } scalar radius = diameter_/2.0; cells_.setSize(1); cellVolumes_.setSize(1); cells_[0] = ignCell; cellVolumes_[0] = vols[ignCell]; scalar minDist = GREAT; label nIgnCells = 1; forAll(centres, celli) { scalar dist = mag(centres[celli] - location_); if (dist < minDist) { minDist = dist; } if (dist < radius && celli != ignCell) { cells_.setSize(nIgnCells+1); cellVolumes_.setSize(nIgnCells+1); cells_[nIgnCells] = celli; cellVolumes_[nIgnCells] = vols[celli]; nIgnCells++; } }