From a2542cc90f55af26e6bcbf8bc9bbeafcd36fa712 Mon Sep 17 00:00:00 2001 From: Kilian Patrick Date: Mon, 29 Jun 2026 11:41:47 +0300 Subject: [PATCH] Catch the attempt to use GhostTranslate in non-3d simulations or with domains that are too small. --- parameters.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/parameters.cpp b/parameters.cpp index 792710e76d..278257ac53 100644 --- a/parameters.cpp +++ b/parameters.cpp @@ -1158,6 +1158,20 @@ void Parameters::getParameters() { RP::get("vlasovsolver.GhostTranslateExtent",P::vlasovSolverGhostTranslateExtent); RP::get("vlasovsolver.accelerateMaxwellianBoundaries", P::vlasovAccelerateMaxwellianBoundaries); if (P::vlasovSolverGhostTranslate==true) { + if (myRank == MASTER_RANK) { + if (P::xcells_ini < 2*VLASOV_STENCIL_WIDTH+1) { + cerr << "ERROR The domain has x_length = " << P::xcells_ini << " < 2*VLASOV_STENCIL_WIDTH+1 = " << 2*VLASOV_STENCIL_WIDTH+1 << endl; + MPI_Abort(MPI_COMM_WORLD, 1); + } + if (P::ycells_ini < 2*VLASOV_STENCIL_WIDTH+1) { + cerr << "ERROR The domain has y_length = " << P::ycells_ini << " < 2*VLASOV_STENCIL_WIDTH+1 = " << 2*VLASOV_STENCIL_WIDTH+1 << endl; + MPI_Abort(MPI_COMM_WORLD, 1); + } + if (P::zcells_ini < 2*VLASOV_STENCIL_WIDTH+1) { + cerr << "ERROR The domain has z_length = " << P::zcells_ini << " < 2*VLASOV_STENCIL_WIDTH+1 = " << 2*VLASOV_STENCIL_WIDTH+1 << endl; + MPI_Abort(MPI_COMM_WORLD, 1); + } + } if (myRank == MASTER_RANK) { logFile<<"Performing spatial translation using ghost cell information with coalesced MPI updates."<