cholla-hydro / cholla

A GPU-based hydro code
https://github.com/cholla-hydro/cholla/wiki
MIT License
65 stars 32 forks source link

2D and 3D Noh tests don't run on dev #323

Closed evazlimen closed 1 year ago

evazlimen commented 1 year ago

When running the 2 and 3D example noh problems on dev, you get "ABORT: noh -> Unknown custom boundary condition."

This looks like it is coming from cholla/src/grid/boundary_conditions.cpp:

void Grid3D::Custom_Boundary(char bcnd[MAXLEN])     
{  
  if (strcmp(bcnd, "noh") == 0) {  
    // from grid/cuda_boundaries.cu  
    Noh_Boundary();  
  }  
  if (strcmp(bcnd, "wind") == 0) {  
    // from grid/cuda_boundaries.cu  
    Wind_Boundary();  
  } else {  
    printf("ABORT: %s -> Unknown custom boundary condition.\n", bcnd);  
    exit(0);  
  }  
} 

strcmp(bcnd, "noh") is returning 0, but it is still checking if strcmp(bcnd, "wind")==0 If you change the second if statement to an else if statement the tests run. They run on main as there is only the one if statement.