82 const Real v =
sqrt(v0 * v0 + v1 * v1);
107 const std::array<Real, fsgrids::bfield::N_BFIELD>&
perb;
108 const std::array<Real, fsgrids::bfield::N_BFIELD>&
nbr_perb;
109 const std::array<Real, fsgrids::dperb::N_DPERB>&
dperb;
110 const std::array<Real, fsgrids::dperb::N_DPERB>&
nbr_dperb;
111 const std::array<Real, fsgrids::bgbfield::N_BGB>&
bgb;
112 const std::array<Real, fsgrids::bgbfield::N_BGB>&
nbr_bgb;
113 const std::array<Real, fsgrids::moments::N_MOMENTS>&
moment;
114 const std::array<Real, fsgrids::dmoments::N_DMOMENTS>&
dmoment;
118 std::tuple<Real, Real>
compute(
const std::array<Real, N>& nbr_arr,
const std::array<Real, N>& arr,
size_t i,
123 return {mul0 * (a + b), mul1 * (a - b)};
198 const std::array<Real, 3>& gridSpacing,
const Limits& rhomLimits,
size_t self,
201 const Reconstructions rec(perB, dPerB, BgB, moments, dMoments, self, nbr, rhomLimits);
217 return Wavespeeds(bx2 + by2 + bz2, rhom, p11, p22, p33, gridSpacing);
252 const std::array<Real, 3>& gridSpacing,
const Limits& rhomLimits,
size_t self,
255 const Reconstructions rec(perB, dPerB, BgB, moments, dMoments, self, nbr, rhomLimits);
271 return Wavespeeds(bx2 + by2 + bz2, rhom, p11, p22, p33, gridSpacing);
306 const std::array<Real, 3>& gridSpacing,
const Limits& rhomLimits,
size_t self,
309 const Reconstructions rec(perB, dPerB, BgB, moments, dMoments, self, nbr, rhomLimits);
325 return Wavespeeds(bx2 + by2 + bz2, rhom, p11, p22, p33, gridSpacing);
328void fsdebugCheck([[maybe_unused]]
const fsgrid::FsStencil& stencil, [[maybe_unused]]
size_t len,
329 [[maybe_unused]]
const char*
file, [[maybe_unused]] uint32_t line) {
331 const bool ok = stencil.ooo() < len &&
332 stencil.oom() < len && stencil.omo() < len && stencil.moo() < len &&
333 stencil.omm() < len && stencil.mom() < len && stencil.mmo() < len;
336 cerr <<
"Out-of-bounds access in " <<
file <<
":" << line << std::endl;
344 Real minRhom = std::numeric_limits<Real>::max();
345 Real maxRhom = std::numeric_limits<Real>::min();
346 for (
const auto& m : moments) {
348 minRhom =
min(minRhom, rhom);
349 maxRhom =
max(maxRhom, rhom);
358 std::array<Real, 2> spacing) {
364 (dperb[indices[0]] / spacing[0] - dperb[indices[1]] / spacing[1]);
389#ifdef FS_1ST_ORDER_SPACE
412 const std::array<Real, fsgrids::bfield::N_BFIELD>&
perb;
413 const std::array<Real, fsgrids::dperb::N_DPERB>&
dperb;
414 const std::array<Real, fsgrids::moments::N_MOMENTS>&
moments;
415 const std::array<Real, fsgrids::dmoments::N_DMOMENTS>&
dmoments;
416 const std::array<Real, fsgrids::bgbfield::N_BGB>&
bgb;
457 int32_t RKCase,
const std::array<Real, 3>& gridSpacing) {
467 const CardinalIndices ci{stencil.ooo(), stencil.omo(), stencil.oom(), stencil.omm()};
468 const DataArrays sw{perb, dperb, moments, dmoments, bgb, ci.
sw};
469 const DataArrays se{perb, dperb, moments, dmoments, bgb, ci.
se};
470 const DataArrays nw{perb, dperb, moments, dmoments, bgb, ci.
nw};
471 const DataArrays ne{perb, dperb, moments, dmoments, bgb, ci.
ne};
506 Real Ex_SW = By_S * Vz0 - Bz_W * Vy0;
508#ifndef FS_1ST_ORDER_SPACE
513 size_t self = stencil.ooo();
514 size_t nbr = stencil.poo();
515 auto wavespeeds =
calculateWaveSpeedYZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, By_S,
516 Bz_W, dBydx_S, dBydz_S, dBzdx_W, dBzdy_W,
MINUS,
MINUS);
517 c_y = wavespeeds.minVelocity();
519 ay_neg =
max(
ZERO, -Vy0 + c_y);
520 ay_pos =
max(
ZERO, +Vy0 + c_y);
521 az_neg =
max(
ZERO, -Vz0 + c_z);
522 az_pos =
max(
ZERO, +Vz0 + c_z);
523 maxV =
max(maxV, wavespeeds.cflSpeed(Vy0, Vz0));
530 Real Ex_SE = By_S * Vz0 - Bz_E * Vy0;
532#ifndef FS_1ST_ORDER_SPACE
538 self = stencil.omo();
540 wavespeeds =
calculateWaveSpeedYZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, By_S,
541 Bz_E, dBydx_S, dBydz_S, dBzdx_E, dBzdy_E,
PLUS,
MINUS);
542 c_y = wavespeeds.minVelocity();
544 ay_neg =
max(ay_neg, -Vy0 + c_y);
545 ay_pos =
max(ay_pos, +Vy0 + c_y);
546 az_neg =
max(az_neg, -Vz0 + c_z);
547 az_pos =
max(az_pos, +Vz0 + c_z);
548 maxV =
max(maxV, wavespeeds.cflSpeed(Vy0, Vz0));
555 Real Ex_NW = By_N * Vz0 - Bz_W * Vy0;
557#ifndef FS_1ST_ORDER_SPACE
563 self = stencil.oom();
565 wavespeeds =
calculateWaveSpeedYZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, By_N,
566 Bz_W, dBydx_N, dBydz_N, dBzdx_W, dBzdy_W,
MINUS,
PLUS);
567 c_y = wavespeeds.minVelocity();
569 ay_neg =
max(ay_neg, -Vy0 + c_y);
570 ay_pos =
max(ay_pos, +Vy0 + c_y);
571 az_neg =
max(az_neg, -Vz0 + c_z);
572 az_pos =
max(az_pos, +Vz0 + c_z);
573 maxV =
max(maxV, wavespeeds.cflSpeed(Vy0, Vz0));
580 Real Ex_NE = By_N * Vz0 - Bz_E * Vy0;
582#ifndef FS_1ST_ORDER_SPACE
584 Ex_NE += +
HALF * ((By_N +
HALF * dBydz_N) *
587 Ex_NE += -
HALF * ((Bz_E +
HALF * dBzdy_E) *
592 self = stencil.omm();
594 wavespeeds =
calculateWaveSpeedYZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, By_N,
595 Bz_E, dBydx_N, dBydz_N, dBzdx_E, dBzdy_E,
PLUS,
PLUS);
596 c_y = wavespeeds.minVelocity();
598 ay_neg =
max(ay_neg, -Vy0 + c_y);
599 ay_pos =
max(ay_pos, +Vy0 + c_y);
600 az_neg =
max(az_neg, -Vz0 + c_z);
601 az_pos =
max(az_pos, +Vz0 + c_z);
602 maxV =
max(maxV, wavespeeds.cflSpeed(Vy0, Vz0));
608 const std::array spacing = {gridSpacing[1], gridSpacing[2]};
633 const UpwindField f(Ex_NE, Ex_SE, Ex_NW, Ex_SW, ay_pos, ay_neg, az_pos, az_neg, perBy_S, perBy_N, perBz_W, perBz_E,
634 dperBydz_S, dperBydz_N, dperBzdy_W, dperBzdy_E);
639 Real min_dx = std::numeric_limits<Real>::max();
640 min_dx =
min(min_dx, gridSpacing[1]);
641 min_dx =
min(min_dx, gridSpacing[2]);
644 auto& maxFsDt = technical[stencil.ooo()].maxFsDt;
645 maxFsDt =
min(maxFsDt, min_dx / maxV);
680 int32_t RKCase,
const std::array<Real, 3>& gridSpacing) {
690 const CardinalIndices ci{stencil.ooo(), stencil.oom(), stencil.moo(), stencil.mom()};
691 const DataArrays sw{perb, dperb, moments, dmoments, bgb, ci.
sw};
692 const DataArrays se{perb, dperb, moments, dmoments, bgb, ci.
se};
693 const DataArrays nw{perb, dperb, moments, dmoments, bgb, ci.
nw};
694 const DataArrays ne{perb, dperb, moments, dmoments, bgb, ci.
ne};
729 Real Ey_SW = Bz_S * Vx0 - Bx_W * Vz0;
731#ifndef FS_1ST_ORDER_SPACE
737 size_t self = stencil.ooo();
738 size_t nbr = stencil.opo();
739 auto wavespeeds =
calculateWaveSpeedXZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_W,
740 Bz_S, dBxdy_W, dBxdz_W, dBzdx_S, dBzdy_S,
MINUS,
MINUS);
741 c_z = wavespeeds.minVelocity();
743 az_neg =
max(
ZERO, -Vz0 + c_z);
744 az_pos =
max(
ZERO, +Vz0 + c_z);
745 ax_neg =
max(
ZERO, -Vx0 + c_x);
746 ax_pos =
max(
ZERO, +Vx0 + c_x);
747 maxV =
max(maxV, wavespeeds.cflSpeed(Vz0, Vx0));
754 Real Ey_SE = Bz_S * Vx0 - Bx_E * Vz0;
756#ifndef FS_1ST_ORDER_SPACE
762 self = stencil.oom();
764 wavespeeds =
calculateWaveSpeedXZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_E,
765 Bz_S, dBxdy_E, dBxdz_E, dBzdx_S, dBzdy_S,
MINUS,
PLUS);
766 c_z = wavespeeds.minVelocity();
768 az_neg =
max(az_neg, -Vz0 + c_z);
769 az_pos =
max(az_pos, +Vz0 + c_z);
770 ax_neg =
max(ax_neg, -Vx0 + c_x);
771 ax_pos =
max(ax_pos, +Vx0 + c_x);
772 maxV =
max(maxV, wavespeeds.cflSpeed(Vz0, Vx0));
779 Real Ey_NW = Bz_N * Vx0 - Bx_W * Vz0;
781#ifndef FS_1ST_ORDER_SPACE
787 self = stencil.moo();
789 wavespeeds =
calculateWaveSpeedXZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_W,
790 Bz_N, dBxdy_W, dBxdz_W, dBzdx_N, dBzdy_N,
PLUS,
MINUS);
791 c_z = wavespeeds.minVelocity();
793 az_neg =
max(az_neg, -Vz0 + c_z);
794 az_pos =
max(az_pos, +Vz0 + c_z);
795 ax_neg =
max(ax_neg, -Vx0 + c_x);
796 ax_pos =
max(ax_pos, +Vx0 + c_x);
797 maxV =
max(maxV, wavespeeds.cflSpeed(Vz0, Vx0));
804 Real Ey_NE = Bz_N * Vx0 - Bx_E * Vz0;
806#ifndef FS_1ST_ORDER_SPACE
812 self = stencil.mom();
814 wavespeeds =
calculateWaveSpeedXZ(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_E,
815 Bz_N, dBxdy_E, dBxdz_E, dBzdx_N, dBzdy_N,
PLUS,
PLUS);
816 c_z = wavespeeds.minVelocity();
818 az_neg =
max(az_neg, -Vz0 + c_z);
819 az_pos =
max(az_pos, +Vz0 + c_z);
820 ax_neg =
max(ax_neg, -Vx0 + c_x);
821 ax_pos =
max(ax_pos, +Vx0 + c_x);
822 maxV =
max(maxV, wavespeeds.cflSpeed(Vz0, Vx0));
828 const std::array spacing = {gridSpacing[2], gridSpacing[0]};
853 const UpwindField f(Ey_NE, Ey_SE, Ey_NW, Ey_SW, az_pos, az_neg, ax_pos, ax_neg, perBz_S, perBz_N, perBx_W, perBx_E,
854 dperBzdx_S, dperBzdx_N, dperBxdz_W, dperBxdz_E);
859 Real min_dx = std::numeric_limits<Real>::max();
860 min_dx =
min(min_dx, gridSpacing[0]);
861 min_dx =
min(min_dx, gridSpacing[2]);
864 auto& maxFsDt = technical[stencil.ooo()].maxFsDt;
865 maxFsDt =
min(maxFsDt, min_dx / maxV);
900 int32_t RKCase,
const std::array<Real, 3>& gridSpacing) {
910 const CardinalIndices ci{stencil.ooo(), stencil.moo(), stencil.omo(), stencil.mmo()};
911 const DataArrays sw{perb, dperb, moments, dmoments, bgb, ci.
sw};
912 const DataArrays se{perb, dperb, moments, dmoments, bgb, ci.
se};
913 const DataArrays nw{perb, dperb, moments, dmoments, bgb, ci.
nw};
914 const DataArrays ne{perb, dperb, moments, dmoments, bgb, ci.
ne};
950 Real Ez_SW = Bx_S * Vy0 - By_W * Vx0;
952#ifndef FS_1ST_ORDER_SPACE
958 size_t self = stencil.ooo();
959 size_t nbr = stencil.oop();
960 auto wavespeeds =
calculateWaveSpeedXY(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_S,
961 By_W, dBxdy_S, dBxdz_S, dBydx_W, dBydz_W,
MINUS,
MINUS);
962 c_x = wavespeeds.minVelocity();
964 ax_neg =
max(
ZERO, -Vx0 + c_x);
965 ax_pos =
max(
ZERO, +Vx0 + c_x);
966 ay_neg =
max(
ZERO, -Vy0 + c_y);
967 ay_pos =
max(
ZERO, +Vy0 + c_y);
968 maxV =
max(maxV, wavespeeds.cflSpeed(Vx0, Vy0));
975 Real Ez_SE = Bx_S * Vy0 - By_E * Vx0;
977#ifndef FS_1ST_ORDER_SPACE
983 self = stencil.moo();
985 wavespeeds =
calculateWaveSpeedXY(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_S,
986 By_E, dBxdy_S, dBxdz_S, dBydx_E, dBydz_E,
PLUS,
MINUS);
987 c_x = wavespeeds.minVelocity();
989 ax_neg =
max(ax_neg, -Vx0 + c_x);
990 ax_pos =
max(ax_pos, +Vx0 + c_x);
991 ay_neg =
max(ay_neg, -Vy0 + c_y);
992 ay_pos =
max(ay_pos, +Vy0 + c_y);
993 maxV =
max(maxV, wavespeeds.cflSpeed(Vx0, Vy0));
1000 Real Ez_NW = Bx_N * Vy0 - By_W * Vx0;
1002#ifndef FS_1ST_ORDER_SPACE
1008 self = stencil.omo();
1009 nbr = stencil.omp();
1010 wavespeeds =
calculateWaveSpeedXY(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_N,
1011 By_W, dBxdy_N, dBxdz_N, dBydx_W, dBydz_W,
MINUS,
PLUS);
1012 c_x = wavespeeds.minVelocity();
1014 ax_neg =
max(ax_neg, -Vx0 + c_x);
1015 ax_pos =
max(ax_pos, +Vx0 + c_x);
1016 ay_neg =
max(ay_neg, -Vy0 + c_y);
1017 ay_pos =
max(ay_pos, +Vy0 + c_y);
1018 maxV =
max(maxV, wavespeeds.cflSpeed(Vx0, Vy0));
1025 Real Ez_NE = Bx_N * Vy0 - By_E * Vx0;
1027#ifndef FS_1ST_ORDER_SPACE
1033 self = stencil.mmo();
1034 nbr = stencil.mmp();
1035 wavespeeds =
calculateWaveSpeedXY(perb, moments, dperb, dmoments, bgb, gridSpacing, rhomLimits, self, nbr, Bx_N,
1036 By_E, dBxdy_N, dBxdz_N, dBydx_E, dBydz_E,
PLUS,
PLUS);
1037 c_x = wavespeeds.minVelocity();
1039 ax_neg =
max(ax_neg, -Vx0 + c_x);
1040 ax_pos =
max(ax_pos, +Vx0 + c_x);
1041 ay_neg =
max(ay_neg, -Vy0 + c_y);
1042 ay_pos =
max(ay_pos, +Vy0 + c_y);
1043 maxV =
max(maxV, wavespeeds.cflSpeed(Vx0, Vy0));
1049 const std::array spacing = {gridSpacing[0], gridSpacing[1]};
1074 const UpwindField f(Ez_NE, Ez_SE, Ez_NW, Ez_SW, ax_pos, ax_neg, ay_pos, ay_neg, perBx_S, perBx_N, perBy_W, perBy_E,
1075 dperBxdy_S, dperBxdy_N, dperBydx_W, dperBydx_E);
1080 Real min_dx = std::numeric_limits<Real>::max();
1081 min_dx =
min(min_dx, gridSpacing[0]);
1082 min_dx =
min(min_dx, gridSpacing[1]);
1085 auto& maxFsDt = technical[stencil.ooo()].maxFsDt;
1086 maxFsDt =
min(maxFsDt, min_dx / maxV);
1121 const std::array<Real, 3>& gridSpacing,
SysBoundary& sysBoundaries, int32_t RKCase) {
1122 cuint cellSysBoundaryFlag = technical[stencil.ooo()].sysBoundaryFlag;
1123 cuint bitfield = technical[stencil.ooo()].SOLVE;
1131 calculateEdgeElectricFieldX(perb, dperb, e, ehall, egradpe, moments, dmoments, bgb, technical, stencil, RKCase,
1138 calculateEdgeElectricFieldY(perb, dperb, e, ehall, egradpe, moments, dmoments, bgb, technical, stencil, RKCase,
1145 calculateEdgeElectricFieldZ(perb, dperb, e, ehall, egradpe, moments, dmoments, bgb, technical, stencil, RKCase,
1192 const bool communicateEGradPeOrMomentsDerivatives) {
1193 const size_t numCells =
fsgrid.getNumCells();
1198 egradpe = egradpedt2;
1199 moments = momentsdt2;
1200 dmoments = dmomentsdt2;
1203 phiprof::Timer upwindedETimer{
"Calculate upwinded electric field"};
1205 phiprof::Timer mpiTimer{
"Electric field ghost updates MPI", {
"MPI"}};
1209 fsgrid.updateGhostCells(ehall);
1213 fsgrid.updateGhostCells(egradpe);
1217 fsgrid.updateGhostCells(dperb);
1221 fsgrid.updateGhostCells(dmoments);
1226 fsgrid.parallel_for([](
int timerId) -> phiprof::Timer {
return phiprof::Timer{timerId}; },
1227 phiprof::initializeTimer(
"Electric field compute cells"), technical,
1228 [=, &sysBoundaries](
const fsgrid::Coordinates &coordinates,
const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
1229 calculateElectricField(perb, dperb, e, ehall, egradpe, moments, dmoments, bgb, technical, stencil,
1230 coordinates.physicalGridSpacing, sysBoundaries, RKCase);
1235 fsgrid.updateGhostCells(e);
1238 upwindedETimer.stop(numCells,
"Spatial Cells");
sqrt(1.0+vA *vA/(c *c))) % Ion-acoustic wave cS
virtual void fieldSolverBoundaryCondElectricField(fsgrids::efieldspan e, const fsgrid::FsStencil &stencil, cuint component)=0
SysBoundary contains the SysBoundaryConditions used in the simulation.
SBC::SysBoundaryCondition * getSysBoundary(cuint sysBoundaryType) const
fsgrid::FsGrid< FS_STENCIL_WIDTH > FieldSolverGrid
Real divideIfNonZero(creal numerator, creal denominator)
Helper function.
void calculateEdgeElectricFieldZ(fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::efieldspan e, fsgrids::constehallspan ehall, fsgrids::constegradpespan egradpe, fsgrids::constmomentsspan moments, fsgrids::constdmomentsspan dmoments, fsgrids::constbgbspan bgb, fsgrids::technicalspan technical, const fsgrid::FsStencil &stencil, int32_t RKCase, const std::array< Real, 3 > &gridSpacing)
Low-level electric field propagation function.
Limits getRhomLimits(const std::array< std::array< Real, fsgrids::moments::N_MOMENTS >, 4 > &moments)
Wavespeeds calculateWaveSpeedXY(fsgrids::perbspan perB, fsgrids::constmomentsspan moments, fsgrids::constdperbspan dPerB, fsgrids::constdmomentsspan dMoments, fsgrids::constbgbspan BgB, const std::array< Real, 3 > &gridSpacing, const Limits &rhomLimits, size_t self, size_t nbr, Real Bx, Real By, Real dBxdy, Real dBxdz, Real dBydx, Real dBydz, Real xdir, Real ydir)
Low-level helper function.
void calculateEdgeElectricFieldX(fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::efieldspan e, fsgrids::constehallspan ehall, fsgrids::constegradpespan egradpe, fsgrids::constmomentsspan moments, fsgrids::constdmomentsspan dmoments, fsgrids::constbgbspan bgb, fsgrids::technicalspan technical, const fsgrid::FsStencil &stencil, int32_t RKCase, const std::array< Real, 3 > &gridSpacing)
Low-level electric field propagation function.
Real resistiveTerm(const auto &bgb, const auto &perb, const auto &dperb, Real rhoq, std::array< size_t, 2 > indices, std::array< Real, 2 > spacing)
void calculateUpwindedElectricFieldSimple(fsgrids::perbspan perb, fsgrids::perbspan perbdt2, fsgrids::efieldspan e, fsgrids::efieldspan edt2, fsgrids::ehallspan ehall, fsgrids::egradpespan egradpe, fsgrids::egradpespan egradpedt2, fsgrids::momentsspan moments, fsgrids::momentsspan momentsdt2, fsgrids::dperbspan dperb, fsgrids::dmomentsspan dmoments, fsgrids::dmomentsspan dmomentsdt2, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, SysBoundary &sysBoundaries, int32_t RKCase, const bool communicateEGradPeOrMomentsDerivatives)
High-level electric field computation function.
Wavespeeds calculateWaveSpeedYZ(fsgrids::perbspan perB, fsgrids::constmomentsspan moments, fsgrids::constdperbspan dPerB, fsgrids::constdmomentsspan dMoments, fsgrids::constbgbspan BgB, const std::array< Real, 3 > &gridSpacing, const Limits &rhomLimits, size_t self, size_t nbr, Real By, Real Bz, Real dBydx, Real dBydz, Real dBzdx, Real dBzdy, Real ydir, Real zdir)
Low-level helper function.
Wavespeeds calculateWaveSpeedXZ(fsgrids::perbspan perB, fsgrids::constmomentsspan moments, fsgrids::constdperbspan dPerB, fsgrids::constdmomentsspan dMoments, fsgrids::constbgbspan BgB, const std::array< Real, 3 > &gridSpacing, const Limits &rhomLimits, size_t self, size_t nbr, Real Bx, Real Bz, Real dBxdy, Real dBxdz, Real dBzdx, Real dBzdy, Real xdir, Real zdir)
Low-level helper function.
void calculateElectricField(fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::efieldspan e, fsgrids::constehallspan ehall, fsgrids::constegradpespan egradpe, fsgrids::constmomentsspan moments, fsgrids::constdmomentsspan dmoments, fsgrids::constbgbspan bgb, fsgrids::technicalspan technical, const fsgrid::FsStencil &stencil, const std::array< Real, 3 > &gridSpacing, SysBoundary &sysBoundaries, int32_t RKCase)
Electric field propagation function.
void calculateEdgeElectricFieldY(fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::efieldspan e, fsgrids::constehallspan ehall, fsgrids::constegradpespan egradpe, fsgrids::constmomentsspan moments, fsgrids::constdmomentsspan dmoments, fsgrids::constbgbspan bgb, fsgrids::technicalspan technical, const fsgrid::FsStencil &stencil, int32_t RKCase, const std::array< Real, 3 > &gridSpacing)
Low-level electric field propagation function.
void fsdebugCheck(const fsgrid::FsStencil &stencil, size_t len, const char *file, uint32_t line)
std::span< std::array< Real, fsgrids::bfield::N_BFIELD > > perbspan
std::span< const std::array< Real, fsgrids::dmoments::N_DMOMENTS > > constdmomentsspan
std::span< const std::array< Real, bgbfield::N_BGB > > constbgbspan
std::span< const std::array< Real, fsgrids::moments::N_MOMENTS > > constmomentsspan
std::span< std::array< Real, fsgrids::moments::N_MOMENTS > > momentsspan
std::span< std::array< Real, fsgrids::egradpe::N_EGRADPE > > egradpespan
std::span< std::array< Real, fsgrids::dmoments::N_DMOMENTS > > dmomentsspan
std::span< technical > technicalspan
std::span< const std::array< Real, fsgrids::ehall::N_EHALL > > constehallspan
std::span< std::array< Real, bgbfield::N_BGB > > bgbspan
std::span< std::array< Real, fsgrids::dperb::N_DPERB > > dperbspan
std::span< std::array< Real, fsgrids::efield::N_EFIELD > > efieldspan
std::span< const std::array< Real, fsgrids::egradpe::N_EGRADPE > > constegradpespan
std::span< std::array< Real, fsgrids::ehall::N_EHALL > > ehallspan
std::span< const std::array< Real, fsgrids::dperb::N_DPERB > > constdperbspan
static const Real MASS_PROTON
const std::array< Real, fsgrids::bfield::N_BFIELD > & perb
DataArrays(fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::constmomentsspan moments, fsgrids::constdmomentsspan dmoments, fsgrids::constbgbspan bgb, size_t index)
const std::array< Real, fsgrids::bgbfield::N_BGB > & bgb
const std::array< Real, fsgrids::moments::N_MOMENTS > & moments
const std::array< Real, fsgrids::dperb::N_DPERB > & dperb
const std::array< Real, fsgrids::dmoments::N_DMOMENTS > & dmoments
static uint ohmGradPeTerm
static bool fieldSolverDiffusiveEterms
static Real maxWaveVelocity
const std::array< Real, fsgrids::moments::N_MOMENTS > & moment
std::tuple< Real, Real > perBCoeffs(size_t i, size_t j) const
const std::array< Real, fsgrids::bfield::N_BFIELD > & nbr_perb
Real rhom(Real dir0, Real dir1, size_t i, size_t j, size_t k) const
const std::array< Real, fsgrids::dperb::N_DPERB > & dperb
const std::array< Real, fsgrids::bgbfield::N_BGB > & nbr_bgb
const std::array< Real, fsgrids::bgbfield::N_BGB > & bgb
std::tuple< Real, Real > compute(const std::array< Real, N > &nbr_arr, const std::array< Real, N > &arr, size_t i, size_t j, Real mul0, Real mul1) const
std::tuple< Real, Real > dPerBCoeffs(size_t i, size_t j) const
const std::array< Real, fsgrids::bfield::N_BFIELD > & perb
Reconstructions(fsgrids::perbspan perB, fsgrids::constdperbspan dPerB, fsgrids::constbgbspan BgB, fsgrids::constmomentsspan moments, fsgrids::constdmomentsspan dMoments, size_t self, size_t nbr, const Limits &rhomLimits)
const Limits & rhomLimits
Real interpolateAndLimitMoments(Real dir0, Real dir1, size_t i, size_t j, size_t k, Real min, Real max) const
Real p(Real dir0, Real dir1, size_t i, size_t j, size_t k) const
const std::array< Real, fsgrids::dmoments::N_DMOMENTS > & dmoment
static Real squared(Real a, Real b)
const std::array< Real, fsgrids::dperb::N_DPERB > & nbr_dperb
Real cflSpeed(Real v0, Real v1) const
Low-level helper function.
Wavespeeds(Real bmag2, Real rhom, Real p11, Real p22, Real p33, const std::array< Real, 3 > &gridSpacing)
static ARCH_HOSTDEV VecSimple< T > min(VecSimple< T > const &l, VecSimple< T > const &r)
static ARCH_HOSTDEV VecSimple< T > max(VecSimple< T > const &l, VecSimple< T > const &r)