Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/idefix-ci-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang -all $TESTME_OPTIONS
- name: Orszag Tang 3D+restart tests
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang3D -all $TESTME_OPTIONS
- name: Axis Flux tube
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/AxisFluxTube -all $TESTME_OPTIONS

ParabolicMHD:
runs-on: self-hosted
Expand Down
30 changes: 18 additions & 12 deletions src/dataBlock/coarsen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,33 @@ void DataBlock::CheckCoarseningLevels() {
idfx::pushRegion("DataBlock::CheckCoarseningLevels()");
// Check that the coarsening levels we have are valid
// NB: this is a costly procedure, we can't repeat it at each loop!
DataBlockHost d(*this);
d.SyncFromDevice();
for(int dir = 0 ; dir < DIMENSIONS ; dir++) {
if(mygrid->coarseningDirection[dir]) {
IdefixHostArray2D<int> arr = d.coarseningLevel[dir];
const int Xt = (dir == IDIR ? JDIR : IDIR);
const int Xb = (dir == KDIR ? JDIR : KDIR);
for(int i = beg[Xt] ; i < end[Xt] ; i++) {
for(int j = beg[Xb] ; j < end[Xb] ; j++) {
IdefixHostArray2D<int> arr = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(),
coarseningLevel[dir]);
for(int j = 0 ; j < arr.extent(0) ; j++) {
for(int i = 0 ; i < arr.extent(1) ; i++) {
if(std::isnan(arr(j,i))) {
std::stringstream str;
str << "Nan in grid coarsening levels" << std::endl;
str << "at (i,j)=("<< i << "," << j << "): Coarsening level is NaN!" << std::endl;
IDEFIX_ERROR(str);
}
if(arr(j,i) < 1) {
std::stringstream str;
str << "Incorrect grid coarsening levels" << std::endl;
str << "at (i,j)=("<< i << "," << j << "): Coarsening level < 1!" << std::endl;
str << "Coarsening level < 1!" << std::endl;
str << "at (i,j)=("<< i << "," << j << "): ";
str << "coarsening level= " << arr(j,i) << std::endl;
IDEFIX_ERROR(str);
}
const int factor = 1 << (arr(j,i) - 1);
if(np_int[dir] % factor != 0) {
std::stringstream str;
str << "local grid size not divisible by coarsening level" << std::endl;
str << "at (i,j)=("<< i << "," << j << "): Coarsening level: ";
str << arr(j,i) << std::endl;
str << "Local grid size not divisible by coarsening level." << std::endl;
str << "at (i,j)=("<< i << "," << j << "): ";
str << "coarsening level= " << arr(j,i) << std::endl;
str << np_int[dir] << " cannot be divided by 2^" << arr(j,i)-1;
str << " = " << factor << std::endl;
IDEFIX_ERROR(str);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/MHD/AxisFluxTube/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void CoarsenFunction(DataBlock &data) {
Setup::Setup(Input &input, Grid &grid, DataBlock &data, Output &output) {
output.EnrollUserDefVariables(&ComputeUserVars);
data.hydro->EnrollUserDefBoundary(&UserdefBoundary);
output.EnrollAnalysis(&Analysis);
//output.EnrollAnalysis(&Analysis);
Rtorus = input.Get<real>("Setup","Rtorus",0);
Ztorus = input.Get<real>("Setup","Ztorus",0);
Rin = input.Get<real>("Setup","Rin",0);
Expand Down