diff --git a/examples/cascade_lattice.py b/examples/cascade_lattice.py index 8493076d..b423dc81 100644 --- a/examples/cascade_lattice.py +++ b/examples/cascade_lattice.py @@ -5,12 +5,12 @@ def main(): # Example usage: quad_order = 19 - cl_fine_vals = [0.02, 0.01, 0.005] + cl_fine_vals = [0.05, 0.02, 0.01, 0.005] cl_coarse = 0.075 cl_boundary = 0.2 length = 0.075 - for i in range(3): + for i in range(len(cl_fine_vals)): cl_fine = cl_fine_vals[i] modify_and_run_geo_file( cl_fine=cl_fine, cl_coarse=cl_coarse, cl_boundary=cl_boundary, length=length @@ -79,6 +79,7 @@ def modify_and_save_log_file(quad_order, cl_fine, cl_coarse, cl_boundary, length # Identify the lines containing "LOG_DIR" and "LOG_FILE" log_dir_line = next(line for line in lines if "LOG_DIR" in line) log_file_line = next(line for line in lines if "LOG_FILE" in line) + vtk_file_line = next(line for line in lines if "OUTPUT_FILE" in line) print(log_file_line) # Extract the current log directory and file name @@ -87,10 +88,13 @@ def modify_and_save_log_file(quad_order, cl_fine, cl_coarse, cl_boundary, length # Construct the new log file name new_log_file = f"lattice_quad_order_{quad_order}_cl_fine_{cl_fine}_cl_coarse_{cl_coarse}_cl_boundary_{cl_boundary}_length_{length}" + new_vtk_file = f"lattice_quad_order_{quad_order}_cl_fine_{cl_fine}_cl_coarse_{cl_coarse}_cl_boundary_{cl_boundary}_length_{length}" # Update the log file name in the lines list log_file_line_new = f"LOG_FILE = {new_log_file}\n" + vtk_file_line_new = f"OUTPUT_FILE = {new_vtk_file}\n" lines[lines.index(log_file_line)] = log_file_line_new + lines[lines.index(vtk_file_line)] = vtk_file_line_new # Save the modified lattice.cfg file with open(cfg_file_path, "w") as file: diff --git a/examples/meshes/geo_files/lattice_refined.geo b/examples/meshes/geo_files/lattice_refined.geo index dea72d8f..a3ee2a81 100644 --- a/examples/meshes/geo_files/lattice_refined.geo +++ b/examples/meshes/geo_files/lattice_refined.geo @@ -1,10 +1,11 @@ cl_fine = 0.02; -cl_coarse = 0.2; -length = 0.05; -Point(1) = {-3.5, -3.5, 0, cl_coarse}; -Point(2) = {3.5, -3.5, 0, cl_coarse}; -Point(3) = {-3.5, 3.5, 0, cl_coarse}; -Point(4) = {3.5, 3.5, 0, cl_coarse}; +cl_coarse = 0.075; +cl_boundary = 0.2; +length = 0.075; +Point(1) = {-3.5, -3.5, 0, cl_boundary}; +Point(2) = {3.5, -3.5, 0, cl_boundary}; +Point(3) = {-3.5, 3.5, 0, cl_boundary}; +Point(4) = {3.5, 3.5, 0, cl_boundary}; Point(5) = {-1.5, -1.5, 0, cl_fine}; Point(6) = {-2.5, -1.5, 0, cl_fine}; Point(7) = {-2.5, -2.5, 0, cl_fine};