36 const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
37 const auto center = stencil.ooo();
38 std::array<Real, fsgrids::volfields::N_VOL>& vol = vols[center];
39 const auto sbflag = sysBoundaryFlag;
42 const bool ok = stencil.cellExists(0, 1, 0) && stencil.cellExists(0, 0, 1) && stencil.cellExists(0, 1, 1) &&
43 stencil.cellExists(1, 0, 0) && stencil.cellExists(1, 1, 0) && stencil.cellExists(1, 0, 1);
46 std::cerr <<
"Out-of-bounds access in " << __FILE__ <<
":" << __LINE__ << endl;
66 const std::array<Real, fsgrids::efield::N_EFIELD>& E_i1j1k1 = e[center];
67 const std::array<Real, fsgrids::efield::N_EFIELD>& E_i1j2k1 = e[stencil.opo()];
68 const std::array<Real, fsgrids::efield::N_EFIELD>& E_i1j1k2 = e[stencil.oop()];
69 const std::array<Real, fsgrids::efield::N_EFIELD>& E_i1j2k2 = e[stencil.opp()];
70 const std::array<Real, fsgrids::efield::N_EFIELD>& E_i2j1k1 = e[stencil.poo()];
71 const std::array<Real, fsgrids::efield::N_EFIELD>& E_i2j1k2 = e[stencil.pop()];
72 const std::array<Real, fsgrids::efield::N_EFIELD>& E_i2j2k1 = e[stencil.ppo()];
106 phiprof::Timer timer{
"Calculate volume averaged fields"};
107 const size_t numCells =
fsgrid.getNumCells();
108 fsgrid.parallel_for([](
int timerId) -> phiprof::Timer {
return phiprof::Timer{timerId}; },
109 phiprof::initializeTimer(
"volume averaged fields compute cells"), technical,
110 [=](
const fsgrid::Coordinates &coordinates,
const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
114 timer.stop(numCells,
"Spatial Cells");
std::array< Real, Rec::N_REC_COEFFICIENTS > reconstructionCoefficients(fsgrids::perbspan perb, fsgrids::constdperbspan dperb, const fsgrid::FsStencil &stencil, Real reconstructionOrder)
Low-level helper function.
void calculateVolumeAveragedFieldsSimple(fsgrids::perbspan perb, fsgrids::efieldspan e, fsgrids::dperbspan dperb, fsgrids::volspan vol, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid)
Top-level field averaging function.
void calculateVolumeAveragedFields(fsgrids::perbspan perb, fsgrids::constefieldspan e, fsgrids::constdperbspan dperb, fsgrids::volspan vols, const fsgrid::FsStencil &stencil, cuint sysBoundaryFlag, cuint sysBoundaryLayer)