Compare commits

...

2 Commits

2 changed files with 15 additions and 3 deletions

View File

@@ -313,7 +313,7 @@ MyList<Block> *Parallel::distribute(MyList<Patch> *PatchLIST, int cpusize, int i
int split_size, min_size, block_size = 0;
int min_width = 2 * Mymax(ghost_width, buffer_width);
int min_width = Mymax(2 * ghost_width + 2, buffer_width + 2);
int nxyz[dim], mmin_width[dim], min_shape[dim];
MyList<Patch> *PLi = PatchLIST;
@@ -641,7 +641,7 @@ MyList<Block> *Parallel::distribute(MyList<Patch> *PatchLIST, int cpusize, int i
int split_size, min_size, block_size = 0;
int min_width = 2 * Mymax(ghost_width, buffer_width);
int min_width = Mymax(2 * ghost_width + 2, buffer_width + 2);
int nxyz[dim], mmin_width[dim], min_shape[dim];
MyList<Patch> *PLi = PatchLIST;

View File

@@ -253,7 +253,19 @@ def generate_macrodef_h():
# Define macro buffer_width
# number of buffer points for mesh-refinement interfaces
print( "#define buffer_width 6", file=file1 )
# Calculate ghost_width based on Finite_Diffenence_Method to optimize buffer_width
if ( input_data.Finite_Diffenence_Method == "2nd-order" ):
gw = 2
elif ( input_data.Finite_Diffenence_Method == "4th-order" ):
gw = 3
elif ( input_data.Finite_Diffenence_Method == "6th-order" ):
gw = 4
elif ( input_data.Finite_Diffenence_Method == "8th-order" ):
gw = 5
else:
gw = 5 # Default conservative value
print( f"#define buffer_width {gw + 1}", file=file1 )
print( file=file1 )
# Define macro SC_width as buffer_width