66 const std::vector<CellID>& cells,
67 fsgrid::FsData<std::array<Real, fsgrids::moments::N_MOMENTS>>& moments,
87 dccrg::Dccrg<SpatialCell, dccrg::Cartesian_Geometry>& mpiGrid,
88 const std::vector<CellID>& cells);
101 dccrg::Dccrg<SpatialCell, dccrg::Cartesian_Geometry>& mpiGrid,
102 const std::vector<CellID>& cells);
105 const std::vector<CellID>& cells);
108 const std::vector<CellID>& cells,
121template <
int STENCIL>
122void computeCoupling(dccrg::Dccrg<SpatialCell, dccrg::Cartesian_Geometry>& mpiGrid,
const std::vector<CellID>& cells,
125 phiprof::Timer couplingTimerActual {
"CouplingTimerActual"};
128 std::vector<CellID> dccrgCells = cells;
129 std::sort(dccrgCells.begin(), dccrgCells.end());
136 const auto maxRefLevel = mpiGrid.mapping.get_maximum_refinement_level();
140 fsgrid.serial_for([](
int timerId) -> phiprof::Timer {
return phiprof::Timer{timerId}; },
141 phiprof::initializeTimer(
"Coupling loop"), technical,
142 [=, &mpiGrid](
const fsgrid::Coordinates &coordinates,
const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
143 const std::array<fsgrid::FsSize_t, 3> globalIndices = coordinates.localToGlobal(stencil.i, stencil.j, stencil.k);
144 const dccrg::Types<3>::indices_t indices = {
145 {(uint64_t)globalIndices[0], (uint64_t)globalIndices[1], (uint64_t)globalIndices[2]}};
147 mpiGrid.get_existing_cell(indices, 0, maxRefLevel);
149 const int process = mpiGrid.get_process(dccrgCell);
150 const fsgrid::LocalID fsgridLid = coordinates.localIDFromLocalCoordinates(stencil.i, stencil.j, stencil.k);
156 for(uint64_t
i=0;
i< dccrgCells.size();
i++) {
161 for (
auto const &fsCellID : fsCells) {
162 const int process =
fsgrid.getTaskForGlobalID(fsCellID);
fsgrid::FsGrid< FS_STENCIL_WIDTH > FieldSolverGrid
std::map< int, std::set< CellID > > onDccrgMapRemoteProcessGlobal
std::map< int, std::set< CellID > > onFsgridMapRemoteProcessGlobal
std::map< CellID, std::vector< int64_t > > onFsgridMapCellsGlobal
void computeCoupling(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells, fsgrid::FsGrid< STENCIL > &fsgrid, fsgrids::technicalspan technical)
std::vector< CellID > mapDccrgIdToFsGridGlobalID(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, CellID dccrgID)
void feedBoundaryIntoFsGrid(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid)
int getNumberOfCellsOnMaxRefLvl(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells)
void getFieldsFromFsGrid(fsgrids::constvolspan volumefields, fsgrids::constbgbspan bgb, fsgrids::constegradpespan egradpe, fsgrids::constdmomentsspan dmoments, fsgrids::consttechnicalspan technical, FieldSolverGrid &fsgrid, dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells)
void getBgFieldsAndDerivativesFromFsGrid(fsgrid::FsData< std::array< Real, fsgrids::bgbfield::N_BGB > > &bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells)
void feedMomentsIntoFsGrid(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells, fsgrid::FsData< std::array< Real, fsgrids::moments::N_MOMENTS > > &moments, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, bool dt2=false)
std::span< const std::array< Real, fsgrids::dmoments::N_DMOMENTS > > constdmomentsspan
std::span< const std::array< Real, bgbfield::N_BGB > > constbgbspan
std::span< technical > technicalspan
std::span< const technical > consttechnicalspan
std::span< const std::array< Real, fsgrids::volfields::N_VOL > > constvolspan
std::span< const std::array< Real, fsgrids::egradpe::N_EGRADPE > > constegradpespan