diff --git a/single-node-refactor/input-impact-erosion.yaml b/single-node-refactor/input-impact-erosion.yaml index 55f79d5bb..e6ac5e3a8 100644 --- a/single-node-refactor/input-impact-erosion.yaml +++ b/single-node-refactor/input-impact-erosion.yaml @@ -39,19 +39,27 @@ boundary_conditions: # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z # Tag z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: diff --git a/single-node-refactor/input-lattice.yaml b/single-node-refactor/input-lattice.yaml index 9fec12ee8..c041d32a0 100644 --- a/single-node-refactor/input-lattice.yaml +++ b/single-node-refactor/input-lattice.yaml @@ -13,8 +13,8 @@ mesh_options: num_dims: 3 type: box origin: [0.0, 0.0, 0.0] - length: [1, 1, 1] - num_elems: [64, 64, 64] + length: [0.5, 0.5, 1] + num_elems: [32, 32, 64] output_options: @@ -34,28 +34,60 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity - + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z + + # Tag Z plane + - boundary_condition: + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z # Tag z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 1.0 + velocity_model: time_varying + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z + - -0.1 + - 2 + - 0 + - 10 + # V = V0 exp (-V1 * (t-t_start)) + # vel_0: -0.1 + # vel_1: 2 + # vel_t_start: 0 + # vel_t_end: 10 materials: - material: @@ -106,20 +138,19 @@ regions: w: 0.0 - - fill_volume: type: voxel_file file_path: ../../VTK_Geometry_lattice.vtk material_id: 1 - den: 2.0 - sie: 0.001 + den: 7.86 + sie: 1.e-10 velocity: cartesian u: 0.0 v: 0.0 w: 0.0 - scale_x: 0.01 - scale_y: 0.01 - scale_z: 0.01 - origin: [0.3, 0.3, 0.3] + scale_x: 0.02 + scale_y: 0.02 + scale_z: 0.040635127 + origin: [-0.5, -0.5, 0.] diff --git a/single-node-refactor/input-noh-rz.yaml b/single-node-refactor/input-noh-rz.yaml index b2c2be570..5db5b6fe7 100644 --- a/single-node-refactor/input-noh-rz.yaml +++ b/single-node-refactor/input-noh-rz.yaml @@ -38,20 +38,28 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGHRZ - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y plane - boundary_condition: - solver: SGHRZ - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z diff --git a/single-node-refactor/input-noh.yaml b/single-node-refactor/input-noh.yaml index e07a29ef8..d56edc6e5 100644 --- a/single-node-refactor/input-noh.yaml +++ b/single-node-refactor/input-noh.yaml @@ -38,28 +38,39 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z - # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity - - # Tag z plane + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z + + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z diff --git a/single-node-refactor/input-origin-erosion.yaml b/single-node-refactor/input-origin-erosion.yaml index 92d1f669e..460664f37 100644 --- a/single-node-refactor/input-origin-erosion.yaml +++ b/single-node-refactor/input-origin-erosion.yaml @@ -38,31 +38,39 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - u: 0.0 - v: 0.0 - w: 1.0 - type: reflected_velocity - + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity - - # Tag z plane + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z + + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: - material: @@ -70,6 +78,7 @@ materials: eos_model_type: decoupled eos_model: gamma_law_gas # strength_model: none + dissipation_model: MARS dissipation_global_vars: - 1.0 # q1 - 1.0 # q1ex @@ -91,11 +100,14 @@ materials: eos_model_type: decoupled eos_model: gamma_law_gas # strength_model: none + dissipation_model: MARS dissipation_global_vars: - 1.0 # q1 - - 1.333 # q1ex - - 1.0 # q2 + - 1.0 # q1ex + - 1.333 # q2 - 1.333 # q2ex + - 0.0 # phi_min + - 1.0 # phi_curl_min eos_global_vars: - 1.666666666666667 - 1.0E-14 diff --git a/single-node-refactor/input-rz-polar.yaml b/single-node-refactor/input-rz-polar.yaml index 30339f376..c7aaee402 100644 --- a/single-node-refactor/input-rz-polar.yaml +++ b/single-node-refactor/input-rz-polar.yaml @@ -43,34 +43,43 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGHRZ - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity - - + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z + # Tag Y plane - boundary_condition: - solver: SGHRZ - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z # Tag inner circle - boundary_condition: - solver: SGHRZ - geometry: cylinder - value: 0.025 - type: zero_velocity + solver_id: 0 + surface: + type: cylinder + radius: 0.025 + velocity_model: fixed # Tag outer circle - boundary_condition: - solver: SGHRZ - geometry: cylinder - value: 1.2 - type: zero_velocity + solver_id: 0 + surface: + type: cylinder + radius: 1.2 + velocity_model: fixed materials: - material: diff --git a/single-node-refactor/input-rz.yaml b/single-node-refactor/input-rz.yaml index e91f3c129..97de23fa1 100644 --- a/single-node-refactor/input-rz.yaml +++ b/single-node-refactor/input-rz.yaml @@ -38,20 +38,28 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGHRZ - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y plane - boundary_condition: - solver: SGHRZ - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z diff --git a/single-node-refactor/input-sgtm-test.yaml b/single-node-refactor/input-sgtm-test.yaml index 66134885f..43f7ebed8 100644 --- a/single-node-refactor/input-sgtm-test.yaml +++ b/single-node-refactor/input-sgtm-test.yaml @@ -42,7 +42,7 @@ solver_options: # geometry: x_plane # direction: x_dir # value: 0.0 -# type: reflected_velocity +# velocity_model: reflected_velocity # # Tag Y plane @@ -51,7 +51,7 @@ solver_options: # geometry: y_plane # direction: y_dir # value: 0.0 -# type: reflected_velocity +# velocity_model: reflected_velocity # # Tag z plane # - boundary_condition: @@ -59,7 +59,7 @@ solver_options: # geometry: z_plane # direction: z_dir # value: 0.0 -# type: reflected_velocity +# velocity_model: reflected_velocity diff --git a/single-node-refactor/input.yaml b/single-node-refactor/input.yaml index 4c191142e..8668151c4 100644 --- a/single-node-refactor/input.yaml +++ b/single-node-refactor/input.yaml @@ -23,13 +23,14 @@ mesh_options: output_options: timer_output_level: thorough - output_file_format: state + output_file_format: ensight #state graphics_time_step: 1.0 # graphics_iteration_step: 10 solver_options: - solver: method: SGH3D + #id: 0 # solver_vars: # - blah # - blah @@ -38,28 +39,40 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z + - # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z # Tag z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z diff --git a/single-node-refactor/regression_tests/standard_inputs/Abaqus_read.yaml b/single-node-refactor/regression_tests/standard_inputs/Abaqus_read.yaml index f70f65a41..2d4f989ce 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Abaqus_read.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Abaqus_read.yaml @@ -37,43 +37,61 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: -4.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: -4.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 4.0 - type: reflected_velocity - + solver_id: 0 + surface: + type: x_plane + plane_position: 4.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: -4.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: -4.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 4.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 4.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z # Tag z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity - + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: diff --git a/single-node-refactor/regression_tests/standard_inputs/Sedov.yaml b/single-node-refactor/regression_tests/standard_inputs/Sedov.yaml index 7f5389f52..d0f0c496d 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Sedov.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Sedov.yaml @@ -28,28 +28,41 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z + - # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z - # Tag z plane + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z + materials: - material: diff --git a/single-node-refactor/regression_tests/standard_inputs/Sedov_Erosion.yaml b/single-node-refactor/regression_tests/standard_inputs/Sedov_Erosion.yaml index 85b54ebc7..aa0f24bdd 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Sedov_Erosion.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Sedov_Erosion.yaml @@ -38,31 +38,41 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - u: 0.0 - v: 0.0 - w: 1.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity - - # Tag z plane + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z + + + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: - material: diff --git a/single-node-refactor/regression_tests/standard_inputs/Sedov_Read_Ensight.yaml b/single-node-refactor/regression_tests/standard_inputs/Sedov_Read_Ensight.yaml index dae206ae7..4493aabd8 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Sedov_Read_Ensight.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Sedov_Read_Ensight.yaml @@ -25,28 +25,39 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z - # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z - # Tag z plane + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: - material: diff --git a/single-node-refactor/regression_tests/standard_inputs/Sedov_rz_polar.yaml b/single-node-refactor/regression_tests/standard_inputs/Sedov_rz_polar.yaml index 6f143c051..fe5fc1d50 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Sedov_rz_polar.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Sedov_rz_polar.yaml @@ -43,27 +43,35 @@ solver_options: boundary_conditions: # Tag X plane - boundary_condition: - solver: SGHRZ - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - # Tag Y plane - boundary_condition: - solver: SGHRZ - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + # Tag inner circle - boundary_condition: - solver: SGHRZ - geometry: cylinder - value: 0.025 - type: zero_velocity + solver_id: 0 + surface: + type: cylinder + radius: 0.025 + velocity_model: fixed diff --git a/single-node-refactor/regression_tests/standard_inputs/Sod_X.yaml b/single-node-refactor/regression_tests/standard_inputs/Sod_X.yaml index e9a8ded81..cca718495 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Sod_X.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Sod_X.yaml @@ -25,56 +25,80 @@ solver_options: method: SGH3D boundary_conditions: - # Tag X=0 plane + # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z - # Tag Y=0 plane + # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z - # Tag z=0 plane + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z # Tag X=1 plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 1.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 1.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y=0.01 plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.01 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.01 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z # Tag z=0.01 plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.01 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.01 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: diff --git a/single-node-refactor/regression_tests/standard_inputs/Sod_Y.yaml b/single-node-refactor/regression_tests/standard_inputs/Sod_Y.yaml index c90f4f6a5..85877f697 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Sod_Y.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Sod_Y.yaml @@ -25,56 +25,80 @@ solver_options: method: SGH3D boundary_conditions: - # Tag X=0 plane + # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z - # Tag Y=0 plane + # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z - # Tag z=0 plane + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z # Tag X=0.01 plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.01 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.01 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z - # Tag Y=1.0 plane + # Tag y=1.0 plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 1.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 1.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z # Tag z=0.01 plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.01 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.01 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: diff --git a/single-node-refactor/regression_tests/standard_inputs/Sod_Z.yaml b/single-node-refactor/regression_tests/standard_inputs/Sod_Z.yaml index a9c079fcb..6726694c7 100644 --- a/single-node-refactor/regression_tests/standard_inputs/Sod_Z.yaml +++ b/single-node-refactor/regression_tests/standard_inputs/Sod_Z.yaml @@ -25,57 +25,79 @@ solver_options: method: SGH3D boundary_conditions: - # Tag X=0 plane + # Tag X plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: x_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z - # Tag Y=0 plane + # Tag Y plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z - # Tag z=0 plane + # Tag Z plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 0.0 - type: reflected_velocity + solver_id: 0 + surface: + type: z_plane + plane_position: 0.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z # Tag X=0.01 plane - boundary_condition: - solver: SGH3D - geometry: x_plane - direction: x_dir - value: 0.01 - type: reflected_velocity - + solver_id: 0 + surface: + type: x_plane + plane_position: 0.01 + velocity_model: reflected + velocity_bc_global_vars: + - 1 # x + - 0 # y + - 0 # z # Tag Y=0.01 plane - boundary_condition: - solver: SGH3D - geometry: y_plane - direction: y_dir - value: 0.01 - type: reflected_velocity + solver_id: 0 + surface: + type: y_plane + plane_position: 0.01 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 1 # y + - 0 # z # Tag z=1.0 plane - boundary_condition: - solver: SGH3D - geometry: z_plane - direction: z_dir - value: 1.0 - type: reflected_velocity - + solver_id: 0 + surface: + type: z_plane + plane_position: 1.0 + velocity_model: reflected + velocity_bc_global_vars: + - 0 # x + - 0 # y + - 1 # z materials: - material: diff --git a/single-node-refactor/src/Solvers/SGH_solver_3D/src/boundary.cpp b/single-node-refactor/src/Solvers/SGH_solver_3D/src/boundary.cpp index c900c9321..ee8cba133 100644 --- a/single-node-refactor/src/Solvers/SGH_solver_3D/src/boundary.cpp +++ b/single-node-refactor/src/Solvers/SGH_solver_3D/src/boundary.cpp @@ -53,8 +53,13 @@ void SGH3D::boundary_velocity(const Mesh_t& mesh, DCArrayKokkos& node_vel, const double time_value) const { - // Loop over boundary sets - for (size_t bdy_set = 0; bdy_set < mesh.num_bdy_sets; bdy_set++) { + size_t num_vel_bdy_sets = BoundaryConditions.num_vel_bdy_sets_in_solver.host(this->solver_id); + + // Loop over the velocity boundary sets + for (size_t bc_lid = 0; bc_lid < num_vel_bdy_sets; bc_lid++) { + + size_t bdy_set = BoundaryConditions.vel_bdy_sets_in_solver.host(bc_lid); + // Loop over boundary nodes in a boundary set FOR_ALL(bdy_node_lid, 0, mesh.num_bdy_nodes_in_set.host(bdy_set), { // get the global index for this node on the boundary @@ -64,7 +69,7 @@ void SGH3D::boundary_velocity(const Mesh_t& mesh, BoundaryConditions.BoundaryConditionFunctions(bdy_set).velocity( mesh, BoundaryConditions.BoundaryConditionEnums, - BoundaryConditions.bc_global_vars, + BoundaryConditions.velocity_bc_global_vars, BoundaryConditions.bc_state_vars, node_vel, time_value, diff --git a/single-node-refactor/src/Solvers/SGH_solver_3D/src/sgh_execute.cpp b/single-node-refactor/src/Solvers/SGH_solver_3D/src/sgh_execute.cpp index f6e4a04d6..b25f1708e 100644 --- a/single-node-refactor/src/Solvers/SGH_solver_3D/src/sgh_execute.cpp +++ b/single-node-refactor/src/Solvers/SGH_solver_3D/src/sgh_execute.cpp @@ -57,6 +57,7 @@ void SGH3D::execute(SimulationParameters_t& SimulationParamaters, { std::cout << "In execute function in SGH3D solver" << std::endl; + double fuzz = SimulationParamaters.dynamic_options.fuzz; // double tiny = SimulationParamaters.dynamic_options.tiny; double small = SimulationParamaters.dynamic_options.small; @@ -297,7 +298,6 @@ void SGH3D::execute(SimulationParameters_t& SimulationParamaters, } // end for mat_id - // ---- Update nodal velocities ---- // update_velocity(rk_alpha, dt, diff --git a/single-node-refactor/src/Solvers/SGH_solver_rz/src/boundary_rz.cpp b/single-node-refactor/src/Solvers/SGH_solver_rz/src/boundary_rz.cpp index 54241c915..98a7a9ba2 100644 --- a/single-node-refactor/src/Solvers/SGH_solver_rz/src/boundary_rz.cpp +++ b/single-node-refactor/src/Solvers/SGH_solver_rz/src/boundary_rz.cpp @@ -55,8 +55,12 @@ void SGHRZ::boundary_velocity_rz(const Mesh_t& mesh, const double time_value) const { - // Loop over boundary sets - for (size_t bdy_set = 0; bdy_set < mesh.num_bdy_sets; bdy_set++) { + size_t num_vel_bdy_sets = BoundaryConditions.num_vel_bdy_sets_in_solver.host(this->solver_id); + + // Loop over the velocity boundary sets + for (size_t bc_lid = 0; bc_lid < num_vel_bdy_sets; bc_lid++) { + + size_t bdy_set = BoundaryConditions.vel_bdy_sets_in_solver.host(bc_lid); // Loop over boundary nodes in a boundary set FOR_ALL(bdy_node_lid, 0, mesh.num_bdy_nodes_in_set.host(bdy_set), { @@ -67,7 +71,7 @@ void SGHRZ::boundary_velocity_rz(const Mesh_t& mesh, // evaluate velocity on this boundary node BoundaryConditions.BoundaryConditionFunctions(bdy_set).velocity(mesh, BoundaryConditions.BoundaryConditionEnums, - BoundaryConditions.bc_global_vars, + BoundaryConditions.velocity_bc_global_vars, BoundaryConditions.bc_state_vars, node_vel, time_value, diff --git a/single-node-refactor/src/Solvers/SGH_solver_rz/src/sgh_initialize_rz.cpp b/single-node-refactor/src/Solvers/SGH_solver_rz/src/sgh_initialize_rz.cpp index ed9aee3a0..0e42c53a2 100644 --- a/single-node-refactor/src/Solvers/SGH_solver_rz/src/sgh_initialize_rz.cpp +++ b/single-node-refactor/src/Solvers/SGH_solver_rz/src/sgh_initialize_rz.cpp @@ -49,6 +49,8 @@ void SGHRZ::initialize(SimulationParameters_t& SimulationParamaters, int rk_num_bins = SimulationParamaters.dynamic_options.rk_num_stages; int num_dim = mesh.num_dims; + // save the solver_id, which is a pravate class variable + //this->solver_id = solver_id_inp; State.node.initialize(rk_num_bins, num_nodes, num_dim, SGHRZ_State::required_node_state); State.GaussPoints.initialize(rk_num_bins, num_gauss_pts, 3, SGHRZ_State::required_gauss_pt_state); // note: dims is always 3 diff --git a/single-node-refactor/src/boundary_conditions/velocity/constant_velocity_bc.h b/single-node-refactor/src/boundary_conditions/velocity/constant_velocity_bc.h index 88eb9da83..f5dc79420 100644 --- a/single-node-refactor/src/boundary_conditions/velocity/constant_velocity_bc.h +++ b/single-node-refactor/src/boundary_conditions/velocity/constant_velocity_bc.h @@ -60,7 +60,7 @@ namespace ConstantVelocityBC KOKKOS_FUNCTION static void velocity(const Mesh_t& mesh, const DCArrayKokkos& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, @@ -70,7 +70,7 @@ static void velocity(const Mesh_t& mesh, { for (size_t dim = 0; dim < mesh.num_dims; dim++) { // Set velocity to zero - node_vel(1, bdy_node_gid, dim) = bc_global_vars(bdy_set, dim); + node_vel(1, bdy_node_gid, dim) = vel_bc_global_vars(bdy_set, dim); } return; diff --git a/single-node-refactor/src/boundary_conditions/velocity/no_velocity_bc.h b/single-node-refactor/src/boundary_conditions/velocity/no_velocity_bc.h index 043ef0241..9a0a4e1c7 100644 --- a/single-node-refactor/src/boundary_conditions/velocity/no_velocity_bc.h +++ b/single-node-refactor/src/boundary_conditions/velocity/no_velocity_bc.h @@ -60,7 +60,7 @@ namespace NoVelocityBC KOKKOS_FUNCTION static void velocity(const Mesh_t& mesh, const DCArrayKokkos& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, diff --git a/single-node-refactor/src/boundary_conditions/velocity/piston_velocity_bc.h b/single-node-refactor/src/boundary_conditions/velocity/piston_velocity_bc.h index 953d06d0b..b15b6841f 100644 --- a/single-node-refactor/src/boundary_conditions/velocity/piston_velocity_bc.h +++ b/single-node-refactor/src/boundary_conditions/velocity/piston_velocity_bc.h @@ -62,7 +62,7 @@ namespace PistonVelocityBC KOKKOS_FUNCTION static void velocity(const Mesh_t& mesh, const DCArrayKokkos& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, @@ -77,7 +77,7 @@ static void velocity(const Mesh_t& mesh, // Set velocity to the specified value node_vel(1, bdy_node_gid, BoundaryConditionEnums(bdy_set).Direction) = - bc_global_vars(bdy_set, BoundaryConditionEnums(bdy_set).Direction); + vel_bc_global_vars(bdy_set, BoundaryConditionEnums(bdy_set).Direction); return; } // end func diff --git a/single-node-refactor/src/boundary_conditions/velocity/reflected_velocity_bc.h b/single-node-refactor/src/boundary_conditions/velocity/reflected_velocity_bc.h index 5e3a35bd7..a40c7a2ae 100644 --- a/single-node-refactor/src/boundary_conditions/velocity/reflected_velocity_bc.h +++ b/single-node-refactor/src/boundary_conditions/velocity/reflected_velocity_bc.h @@ -62,7 +62,7 @@ namespace ReflectedVelocityBC KOKKOS_FUNCTION static void velocity(const Mesh_t& mesh, const DCArrayKokkos& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, @@ -70,13 +70,15 @@ static void velocity(const Mesh_t& mesh, const size_t bdy_node_gid, const size_t bdy_set) { - // directions are: - // x_plane = 0, - // y_plane = 1, - // z_plane = 2, + double mag = 0.0; + for (size_t dim = 0; dim& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, @@ -81,10 +84,13 @@ static void velocity(const Mesh_t& mesh, const size_t bdy_node_gid, const size_t bdy_set) { - const double hydro_bc_vel_0 = bc_global_vars(bdy_set, BCVars::hydro_bc_vel_0); - const double hydro_bc_vel_1 = bc_global_vars(bdy_set, BCVars::hydro_bc_vel_1); - const double hydro_bc_vel_t_start = bc_global_vars(bdy_set, BCVars::hydro_bc_vel_t_start); - const double hydro_bc_vel_t_end = bc_global_vars(bdy_set, BCVars::hydro_bc_vel_t_end); + const double x_comp = vel_bc_global_vars(bdy_set, BCVars::x_comp); + const double y_comp = vel_bc_global_vars(bdy_set, BCVars::y_comp); + const double z_comp = vel_bc_global_vars(bdy_set, BCVars::z_comp); + const double hydro_bc_vel_0 = vel_bc_global_vars(bdy_set, BCVars::hydro_bc_vel_0); + const double hydro_bc_vel_1 = vel_bc_global_vars(bdy_set, BCVars::hydro_bc_vel_1); + const double hydro_bc_vel_t_start = vel_bc_global_vars(bdy_set, BCVars::hydro_bc_vel_t_start); + const double hydro_bc_vel_t_end = vel_bc_global_vars(bdy_set, BCVars::hydro_bc_vel_t_end); // directions are as follows: // x_plane = 0, @@ -98,8 +104,22 @@ static void velocity(const Mesh_t& mesh, // the time difference const double time_delta = time_value - hydro_bc_vel_t_start; - node_vel(1, bdy_node_gid, BoundaryConditionEnums(bdy_set).Direction) = - hydro_bc_vel_0 * exp(-hydro_bc_vel_1 * time_delta); + // the desired velocity + const double vel = hydro_bc_vel_0 * exp(-hydro_bc_vel_1 * time_delta); + + double mag = 0.0; + for (size_t dim = 0; dim& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, diff --git a/single-node-refactor/src/boundary_conditions/velocity/zero_velocity_bc.h b/single-node-refactor/src/boundary_conditions/velocity/zero_velocity_bc.h index 9e6d48f9c..fa1cb2d61 100644 --- a/single-node-refactor/src/boundary_conditions/velocity/zero_velocity_bc.h +++ b/single-node-refactor/src/boundary_conditions/velocity/zero_velocity_bc.h @@ -62,7 +62,7 @@ namespace ZeroVelocityBC KOKKOS_FUNCTION static void velocity(const Mesh_t& mesh, const DCArrayKokkos& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, diff --git a/single-node-refactor/src/common/include/boundary_conditions.h b/single-node-refactor/src/common/include/boundary_conditions.h index 2f9d25aa3..d05fbf903 100644 --- a/single-node-refactor/src/common/include/boundary_conditions.h +++ b/single-node-refactor/src/common/include/boundary_conditions.h @@ -44,7 +44,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace boundary_conditions { -// supported geometry for boundary conditions +// supported surface geometry for boundary conditions enum BdyTag { xPlane = 0, // tag an x-plane @@ -58,7 +58,7 @@ enum BdyTag // types of boundary conditions // WARNING: Currently only velocity is supported -enum BCHydro +enum BCVelocityModels { noVelocityBC = 0, constantVelocityBC = 1, @@ -68,12 +68,13 @@ enum BCHydro userDefinedVelocityBC = 5, pistonVelocityBC = 6 }; -// future options: -// displacement = 6, -// acceleration = 7, -// pressure = 8, -// temperature = 9, -// contact = 10 +// future model options: +// displacementBC = 6, +// accelerationBC = 7, +// pressureBC = 8, +// temperatureBC = 9, +// contactBC = 10 + enum BCFcnLocation { @@ -81,16 +82,10 @@ enum BCFcnLocation device = 1 }; -// Direction to apply boundary conditions -enum BCDirection -{ - xDir = 0, - yDir = 1, - zDir = 2 -}; + } // end of boundary conditions namespace -static std::map bc_geometry_map +static std::map bc_surface_map { { "x_plane", boundary_conditions::xPlane }, { "y_plane", boundary_conditions::yPlane }, @@ -101,29 +96,25 @@ static std::map bc_geometry_map // future options // { "read_file", boundary_conditions::read_file } -static std::map bc_type_map +static std::map bc_velocity_model_map { - { "no_velocity", boundary_conditions::noVelocityBC }, - { "constant_velocity", boundary_conditions::constantVelocityBC }, - { "velocity_vs_time", boundary_conditions::timeVaringVelocityBC }, - { "reflected_velocity", boundary_conditions::reflectedVelocityBC }, - { "zero_velocity", boundary_conditions::zeroVelocityBC }, - { "user_defined_velocity", boundary_conditions::userDefinedVelocityBC }, - { "piston_velocity", boundary_conditions::pistonVelocityBC } + { "none", boundary_conditions::noVelocityBC }, + { "constant", boundary_conditions::constantVelocityBC }, + { "time_varying", boundary_conditions::timeVaringVelocityBC }, + { "reflected", boundary_conditions::reflectedVelocityBC }, + { "fixed", boundary_conditions::zeroVelocityBC }, + { "user_defined", boundary_conditions::userDefinedVelocityBC }, + { "piston", boundary_conditions::pistonVelocityBC } }; // future options -// { "displacement", boundary_conditions::displacement }, -// { "acceleration", boundary_conditions::acceleration }, -// { "pressure", boundary_conditions::pressure }, -// { "temperature", boundary_conditions::temperature }, -// { "contact", boundary_conditions::contact } +// { "displacement", boundary_conditions::displacementBC }, +// { "acceleration", boundary_conditions::accelerationBC }, +// { "pressure", boundary_conditions::pressureBC }, +// { "temperature", boundary_conditions::temperatureBC }, +// { "contact", boundary_conditions::contactBC } + + -static std::map bc_direction_map -{ - { "x_dir", boundary_conditions::xDir }, - { "y_dir", boundary_conditions::yDir }, - { "z_dir", boundary_conditions::zDir } -}; static std::map bc_location_map { @@ -140,9 +131,9 @@ static std::map bc_location_map ///////////////////////////////////////////////////////////////////////////// struct BoundaryConditionSetup_t { - boundary_conditions::BdyTag geometry; ///< Geometry boundary condition is applied to, e.g., sphere, plane + boundary_conditions::BdyTag surface; ///< Geometry boundary condition is applied to, e.g., sphere, plane double origin[3] = { 0.0, 0.0, 0.0 }; ///< origin of surface being tagged, e.g., sphere or cylinder surface - double value = 0.0; ///< value = position, radius, etc. defining the geometric shape + double value = 0.0; ///< value = position, radius, etc. defining the surface geometric shape }; // end boundary condition setup ///////////////////////////////////////////////////////////////////////////// @@ -156,9 +147,7 @@ struct BoundaryConditionEnums_t { solver_input::method solver = solver_input::NONE; ///< Numerical solver method - boundary_conditions::BCHydro BCHydroType; ///< Type of boundary condition - - boundary_conditions::BCDirection Direction; ///< Boundary condition direction + boundary_conditions::BCVelocityModels BCVelocityModel = boundary_conditions::noVelocityBC; ///< Type of velocity boundary condition boundary_conditions::BCFcnLocation Location = boundary_conditions::device; // host or device BC function }; // end boundary condition enums @@ -175,7 +164,7 @@ struct BoundaryConditionFunctions_t // function pointer for velocity BC's void (*velocity) (const Mesh_t& mesh, const DCArrayKokkos& BoundaryConditionEnums, - const DCArrayKokkos& bc_global_vars, + const RaggedRightArrayKokkos& vel_bc_global_vars, const DCArrayKokkos& bc_state_vars, const DCArrayKokkos& node_vel, const double time_value, @@ -207,8 +196,18 @@ struct BoundaryCondition_t // enums to select BC capabilities, some enums are needed on the host side and device side DCArrayKokkos BoundaryConditionEnums; - // global variables for boundary condition models - DCArrayKokkos bc_global_vars; // it is only 4 values, so ragged doesn't make sense now + // making a psuedo dual ragged right + DCArrayKokkos vel_bdy_sets_in_solver; // (solver, ids) + DCArrayKokkos num_vel_bdy_sets_in_solver; // (solver) + + // keep adding ragged storage for the other BC models -- temp, displacement, etc. + // DCArrayKokkos temperature_bdy_sets_in_solver; // (solver, ids) + // DCArrayKokkos num_temperature_bdy_sets_in_solver; // (solver) + + + // global variables for velocity boundary condition models + RaggedRightArrayKokkos velocity_bc_global_vars; + CArrayKokkos num_velocity_bc_global_vars; // state variables for boundary conditions DCArrayKokkos bc_state_vars; @@ -219,19 +218,19 @@ struct BoundaryCondition_t // ------------------------------------- static std::vector str_bc_inps { - "solver", + "solver_id", + "velocity_model", + "surface", + "velocity_bc_global_vars" +}; + +// subfields under surface +static std::vector str_bc_surface_inps +{ "type", - "geometry", - "direction", - "value", - "u", - "v", - "w", - "origin", - "hydro_bc_vel_0", - "hydro_bc_vel_1", - "hydro_bc_vel_t_start", - "hydro_bc_vel_t_end" + "plane_position", + "radius", + "origin" }; // ---------------------------------- @@ -240,5 +239,8 @@ static std::vector str_bc_inps static std::vector bc_required_inps { }; +static std::vector bc_surface_required_inps +{ +}; #endif // end Header Guard \ No newline at end of file diff --git a/single-node-refactor/src/common/include/state.h b/single-node-refactor/src/common/include/state.h index 1716de52b..ac7df732c 100644 --- a/single-node-refactor/src/common/include/state.h +++ b/single-node-refactor/src/common/include/state.h @@ -149,7 +149,7 @@ struct MaterialToMeshMap_t // initialization method for FE-SGH and MPM methods (max number of elems needed) void initialize(size_t num_elem_max) { - this->elem = DCArrayKokkos(num_elem_max, "material_pt_to_elem"); + if (elem.size() == 0) this->elem = DCArrayKokkos(num_elem_max, "material_pt_to_elem"); }; // end method }; // end MaterialtoMeshMaps_t diff --git a/single-node-refactor/src/common/src/geometry_new.cpp b/single-node-refactor/src/common/src/geometry_new.cpp index eee926a97..7ca84e85a 100644 --- a/single-node-refactor/src/common/src/geometry_new.cpp +++ b/single-node-refactor/src/common/src/geometry_new.cpp @@ -723,7 +723,7 @@ void tag_bdys(const BoundaryCondition_t& boundary, FOR_ALL(bdy_set, 0, mesh.num_bdy_sets, { // tag boundaries - int bc_tag_id = boundary.BoundaryConditionSetup(bdy_set).geometry; + int bc_tag_id = boundary.BoundaryConditionSetup(bdy_set).surface; double val = boundary.BoundaryConditionSetup(bdy_set).value; double orig_x = boundary.BoundaryConditionSetup(bdy_set).origin[0]; double orig_y = boundary.BoundaryConditionSetup(bdy_set).origin[1]; diff --git a/single-node-refactor/src/driver.cpp b/single-node-refactor/src/driver.cpp index 6b8a2a212..0f2f3ab49 100644 --- a/single-node-refactor/src/driver.cpp +++ b/single-node-refactor/src/driver.cpp @@ -92,7 +92,7 @@ void Driver::initialize() mesh.build_boundry_node_sets(mesh); // Setup Solvers - for (int solver_id = 0; solver_id < SimulationParamaters.solver_inputs.size(); solver_id++) { + for (size_t solver_id = 0; solver_id < SimulationParamaters.solver_inputs.size(); solver_id++) { if (SimulationParamaters.solver_inputs[solver_id].method == solver_input::SGH3D) { @@ -104,6 +104,9 @@ void Driver::initialize() BoundaryConditions, State); + // save the solver_id + sgh_solver->solver_id = solver_id; + solvers.push_back(sgh_solver); } // end if SGH solver else if (SimulationParamaters.solver_inputs[solver_id].method == solver_input::SGHRZ) { @@ -116,6 +119,9 @@ void Driver::initialize() BoundaryConditions, State); + // save the solver_id + sgh_solver_rz->solver_id = solver_id; + solvers.push_back(sgh_solver_rz); } // end if SGHRZ solver //else if (SimulationParamaters.solver_inputs[solver_id].method == solver_input::SGTM3D) { diff --git a/single-node-refactor/src/input/parse_yaml.cpp b/single-node-refactor/src/input/parse_yaml.cpp index ef4a4421e..4463e0c93 100644 --- a/single-node-refactor/src/input/parse_yaml.cpp +++ b/single-node-refactor/src/input/parse_yaml.cpp @@ -306,7 +306,8 @@ void parse_yaml(Yaml::Node& root, SimulationParameters_t& SimulationParamaters, printf("\n"); std::cout << "Parsing YAML boundary condition options:" << std::endl; } - parse_bcs(root, Boundary); + size_t num_solvers = SimulationParamaters.solver_inputs.size(); + parse_bcs(root, Boundary, num_solvers); if (VERBOSE) { printf("\n"); @@ -2188,7 +2189,7 @@ void parse_materials(Yaml::Node& root, Material_t& Materials, const size_t num_d std::cout << "num global strength vars = " << num_global_vars << std::endl; } - // store the global eos model parameters + // store the global strength model parameters for (int global_var_id = 0; global_var_id < num_global_vars; global_var_id++) { double strength_var = root["materials"][m_id]["material"]["strength_global_vars"][global_var_id].As(); @@ -2200,7 +2201,7 @@ void parse_materials(Yaml::Node& root, Material_t& Materials, const size_t num_d std::cout << "\t var = " << strength_var << std::endl; } } // end loop over global vars - } // "eos_global_vars" + } // "strength_global_vars" else if (a_word.compare("dissipation_global_vars") == 0) { Yaml::Node & mat_global_vars_yaml = root["materials"][m_id]["material"][a_word]; @@ -2294,7 +2295,7 @@ void parse_materials(Yaml::Node& root, Material_t& Materials, const size_t num_d // ================================================================================= // Parse Boundary Conditions // ================================================================================= -void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) +void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions, const size_t num_solvers) { Yaml::Node& bc_yaml = root["boundary_conditions"]; @@ -2310,22 +2311,75 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) // enums to select options with boundary conditions BoundaryConditions.BoundaryConditionEnums = DCArrayKokkos (num_bcs,"bc_enums"); - // the state for boundary conditions - BoundaryConditions.bc_global_vars = DCArrayKokkos(num_bcs, 4, "bc_global_values"); // increase 4 for more params + // stores the velocity bdy node lists per solver, in the future, this needs to be a DualRaggedRight + BoundaryConditions.vel_bdy_sets_in_solver = DCArrayKokkos (num_solvers, num_bcs, "vel_bdy_sets_in_solver"); + // this stores the number of bdy sets for a solver + BoundaryConditions.num_vel_bdy_sets_in_solver = DCArrayKokkos (num_solvers, "num_vel_bdy_sets_in_solver"); + // set the storage counter to zero + for(size_t solver_id=0; solver_id tempVelocityBCGlobalVars (num_bcs, 100, "temporary_velocity_bc_global_values"); + + BoundaryConditions.num_velocity_bc_global_vars = CArrayKokkos (num_bcs, "BoundaryConditions.num_velocity_bc_global_vars"); + + // initialize the num of global vars to 0 for all models + FOR_ALL(bc_id, 0, num_bcs, { + BoundaryConditions.num_velocity_bc_global_vars(bc_id) = 0; + }); // end parallel for + + + // state place holder is here BoundaryConditions.bc_state_vars = DCArrayKokkos(num_bcs, 4, "bc_state_values"); // WARNING a place holder // loop over the BC specified - for (int bc_id = 0; bc_id < num_bcs; bc_id++) { + for (size_t bc_id = 0; bc_id < num_bcs; bc_id++) { // read the variables names Yaml::Node& inps_yaml = bc_yaml[bc_id]["boundary_condition"]; - // get the material variables names set by the user + // get the boundary condition variables names set by the user std::vector user_str_bc_inps; // extract words from the input file and validate they are correct validate_inputs(inps_yaml, user_str_bc_inps, str_bc_inps, bc_required_inps); + + // verify the boundary condition block connects to a solver + // loop over the words in the boundary input definition and find the solver id + int solver_id = -1; + for (auto& a_word : user_str_bc_inps) { + + Yaml::Node& inps_yaml = bc_yaml[bc_id]["boundary_condition"][a_word]; + + if (a_word.compare("solver_id") == 0) { + solver_id = bc_yaml[bc_id]["boundary_condition"][a_word].As(); + + if (solver_id<0 || solver_id>=num_solvers){ + std::cout << "ERROR: invalid solver_id specified in the boundary condition definition " << std::endl; + + throw std::runtime_error("**** Solver_id is out of bounds ****"); + } // end check on m_id range + + if (VERBOSE) { + std::cout << "\tsolver_id = " << solver_id << std::endl; + } + } // end id + + // add other checks here... + + } // end loop over all boundary condition inputs + + if (solver_id<0){ + std::cout << "ERROR: solver_id must be specified in the boundary condition definition " << std::endl; + + throw std::runtime_error("**** Solver_id is missing ****"); + } // end check on m_id range + + // loop over the words in the material input definition for (auto& a_word : user_str_bc_inps) { if (VERBOSE) { @@ -2335,50 +2389,36 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) Yaml::Node& inps_yaml = bc_yaml[bc_id]["boundary_condition"][a_word]; // get solver for this boundary condition - if (a_word.compare("solver") == 0) { - std::string solver = bc_yaml[bc_id]["boundary_condition"][a_word].As(); + if (a_word.compare("solver_id") == 0) { + // do nothing, I already have solver_id - auto map = solver_map; + } // solver id + // get boundary condition type + else if (a_word.compare("velocity_model") == 0) { + + // Note: solver_id was retrieved at the top of the bc_id loop - // set the solver - if (map.find(solver) != map.end()) { - solver_input::method bc_solver = map[solver]; + // find out how many velocity bdy sets have been saved + size_t num_saved = BoundaryConditions.num_vel_bdy_sets_in_solver.host(solver_id); + BoundaryConditions.vel_bdy_sets_in_solver.host(num_saved) = bc_id; + BoundaryConditions.num_vel_bdy_sets_in_solver.host(solver_id) += 1; // increment saved counter - RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).solver = bc_solver; - }); + std::string velocity_model = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - if (VERBOSE) { - std::cout << "\tsolver = " << solver << std::endl; - } - } - else{ - std::cout << "ERROR: invalid boundary condition option input in YAML file: " << solver << std::endl; - std::cout << "Valid options are: " << std::endl; + auto map = bc_velocity_model_map; - for (const auto& pair : map) { - std::cout << "\t" << pair.first << std::endl; - } - } // end if - } // solver - // get boundary condition type - else if (a_word.compare("type") == 0) { - std::string type = bc_yaml[bc_id]["boundary_condition"][a_word].As(); + // set the velocity_model + if (map.find(velocity_model) != map.end()) { + auto bc_velocity_model = map[velocity_model]; - auto map = bc_type_map; - - // set the type - if (map.find(type) != map.end()) { - auto bc_type = map[type]; - - // bc_type_map[type] returns enum value, e.g., boundary_conditions::velocity_constant - switch(map[type]){ + // bc_velocity_model_map[velocity_model] returns enum value, e.g., boundary_conditions::velocity_constant + switch(map[velocity_model]){ case boundary_conditions::constantVelocityBC : std::cout << "Setting velocity bc " << std::endl; RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).BCHydroType = boundary_conditions::constantVelocityBC ; + BoundaryConditions.BoundaryConditionEnums(bc_id).BCVelocityModel = boundary_conditions::constantVelocityBC ; BoundaryConditions.BoundaryConditionFunctions(bc_id).velocity = &ConstantVelocityBC::velocity; }); break; @@ -2387,7 +2427,7 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) std::cout << "Setting velocity bc " << std::endl; RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).BCHydroType = boundary_conditions::timeVaringVelocityBC; + BoundaryConditions.BoundaryConditionEnums(bc_id).BCVelocityModel = boundary_conditions::timeVaringVelocityBC; BoundaryConditions.BoundaryConditionFunctions(bc_id).velocity = &TimeVaryingVelocityBC::velocity; }); break; @@ -2396,7 +2436,7 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) std::cout << "Setting velocity bc " << std::endl; RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).BCHydroType = boundary_conditions::reflectedVelocityBC; + BoundaryConditions.BoundaryConditionEnums(bc_id).BCVelocityModel = boundary_conditions::reflectedVelocityBC; BoundaryConditions.BoundaryConditionFunctions(bc_id).velocity = &ReflectedVelocityBC::velocity; }); break; @@ -2405,7 +2445,7 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) std::cout << "Setting velocity bc " << std::endl; RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).BCHydroType = boundary_conditions::zeroVelocityBC; + BoundaryConditions.BoundaryConditionEnums(bc_id).BCVelocityModel = boundary_conditions::zeroVelocityBC; BoundaryConditions.BoundaryConditionFunctions(bc_id).velocity = &ZeroVelocityBC::velocity; }); break; @@ -2413,7 +2453,7 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) std::cout << "Setting velocity bc " << std::endl; RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).BCHydroType = boundary_conditions::userDefinedVelocityBC; + BoundaryConditions.BoundaryConditionEnums(bc_id).BCVelocityModel = boundary_conditions::userDefinedVelocityBC; BoundaryConditions.BoundaryConditionFunctions(bc_id).velocity = &UserDefinedVelocityBC::velocity; }); break; @@ -2421,33 +2461,31 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) std::cout << "Setting velocity bc " << std::endl; RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).BCHydroType = boundary_conditions::pistonVelocityBC; + BoundaryConditions.BoundaryConditionEnums(bc_id).BCVelocityModel = boundary_conditions::pistonVelocityBC; BoundaryConditions.BoundaryConditionFunctions(bc_id).velocity = &UserDefinedVelocityBC::velocity; }); break; default: - std::cout << "Setting velocity bc " << std::endl; - RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).BCHydroType = boundary_conditions::noVelocityBC; - BoundaryConditions.BoundaryConditionFunctions(bc_id).velocity = &NoVelocityBC::velocity; - }); - // no velocity specified is default + std::cout << "ERROR: invalid velocity boundary condition input: " << velocity_model << std::endl; + throw std::runtime_error("**** Velocity BC model Not Understood ****"); break; } // end switch if (VERBOSE) { - std::cout << "\ttype = " << type << std::endl; + std::cout << "\tvelocity_bc_model = " << velocity_model << std::endl; } } else{ - std::cout << "ERROR: invalid boundary condition option input in YAML file: " << type << std::endl; + std::cout << "ERROR: invalid boundary condition option input in YAML file: " << velocity_model << std::endl; std::cout << "Valid options are: " << std::endl; for (const auto& pair : map) { std::cout << "\t" << pair.first << std::endl; } + + throw std::runtime_error("**** Boundary Condition Velocity Model Not Understood ****"); } // end if } // type // get boundary condition direction @@ -2473,152 +2511,145 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) for (const auto& pair : map) { std::cout << "\t" << pair.first << std::endl; } + throw std::runtime_error("**** Boundary Conditions Not Understood ****"); } // end if } // direction - // get boundary condition geometry - // get boundary condition direction - else if (a_word.compare("direction") == 0) { - std::string direction = bc_yaml[bc_id]["boundary_condition"][a_word].As(); + // get boundary condition surface geometry + else if (a_word.compare("surface") == 0) { - auto map = bc_direction_map; + // ----- + // loop over the sub fields under surface + // ----- + Yaml::Node& inps_subfields_yaml = bc_yaml[bc_id]["boundary_condition"]["surface"]; - // set the direction - if (map.find(direction) != map.end()) { - auto bc_direction = map[direction]; - RUN({ - BoundaryConditions.BoundaryConditionEnums(bc_id).Direction = bc_direction; - }); - if (VERBOSE) { - std::cout << "\tdirection = " << direction << std::endl; - } - } - else{ - std::cout << "ERROR: invalid boundary condition option input in YAML file: " << direction << std::endl; - std::cout << "Valid options are: " << std::endl; + // get the bc_geometery variables names set by the user + std::vector user_bc_surface_inputs; + + // extract words from the input file and validate they are correct + validate_inputs(inps_subfields_yaml, user_bc_surface_inputs, str_bc_surface_inps, bc_surface_required_inps); - for (const auto& pair : map) { - std::cout << "\t" << pair.first << std::endl; - } - } // end if - } // direction - // get boundary condition geometry - else if (a_word.compare("geometry") == 0) { - std::string geometry = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - auto map = bc_geometry_map; + // loop over the subfield words + for(auto& a_subfield_word : user_bc_surface_inputs){ - // set the geometry - if (map.find(geometry) != map.end()) { - auto bc_geometry = map[geometry]; - RUN({ - BoundaryConditions.BoundaryConditionSetup(bc_id).geometry = bc_geometry; - }); + if (a_subfield_word.compare("type") == 0){ + std::string surface = bc_yaml[bc_id]["boundary_condition"]["surface"][a_subfield_word].As(); - if (VERBOSE) { - std::cout << "\tgeometry = " << geometry << std::endl; - } - } - else{ - std::cout << "ERROR: invalid boundary condition option input in YAML file: " << geometry << std::endl; - std::cout << "Valid options are: " << std::endl; + auto map = bc_surface_map; - for (const auto& pair : map) { - std::cout << "\t" << pair.first << std::endl; + // set the surface + if (map.find(surface) != map.end()) { + auto bc_surface = map[surface]; + RUN({ + BoundaryConditions.BoundaryConditionSetup(bc_id).surface = bc_surface; + }); + + if (VERBOSE) { + std::cout << "\tsurface = " << surface << std::endl; + } + } + else{ + std::cout << "ERROR: invalid boundary condition option input in YAML file: " << surface << std::endl; + std::cout << "Valid options are: " << std::endl; + + for (const auto& pair : map) { + std::cout << "\t" << pair.first << std::endl; + } + throw std::runtime_error("**** Boundary Condition Surface Inputs Not Understood ****"); + } // end if + + } // end if type + else if (a_subfield_word.compare("plane_position") == 0) { + double value = bc_yaml[bc_id]["boundary_condition"]["surface"][a_subfield_word].As(); + RUN({ + BoundaryConditions.BoundaryConditionSetup(bc_id).value = value; + }); + } // end if value + else if (a_subfield_word.compare("radius") == 0) { + double value = bc_yaml[bc_id]["boundary_condition"]["surface"][a_subfield_word].As(); + RUN({ + BoundaryConditions.BoundaryConditionSetup(bc_id).value = value; + }); + } // end if value + else if (a_subfield_word.compare("origin") == 0) { + std::string origin = bc_yaml[bc_id]["boundary_condition"]["surface"][a_subfield_word].As(); + if (VERBOSE) { + std::cout << "\torigin = " << origin << std::endl; + } + + // get the origin numbers, values are words + std::vector numbers = exact_array_values(origin, ","); + + double x1 = std::stod(numbers[0]); + double y1 = std::stod(numbers[1]); + double z1; + + if(numbers.size()==3){ + // 3D + z1 = std::stod(numbers[2]); + } + else { + // 2D + z1 = 0.0; + } // + + if (VERBOSE) { + std::cout << "\tx1 = " << x1 << std::endl; + std::cout << "\ty1 = " << y1 << std::endl; + std::cout << "\tz1 = " << z1 << std::endl; + } + // storing the origin values as (x1,y1,z1) + + RUN({ + BoundaryConditions.BoundaryConditionSetup(bc_id).origin[0] = x1; + BoundaryConditions.BoundaryConditionSetup(bc_id).origin[1] = y1; + BoundaryConditions.BoundaryConditionSetup(bc_id).origin[2] = z1; + }); + + } //end origin + else { + // word is unknown + std::cout << "ERROR: invalid input under boundary condition geometery: " << a_subfield_word << std::endl; + std::cout << "Valid options are: " << std::endl; + for (const auto& element : str_bc_surface_inps) { + std::cout << element << std::endl; + } + throw std::runtime_error("**** Boundary Conditions Not Understood ****"); } - } // end if - } // geometry + + } // end loop over words in the subfield + } // surface // set the value - else if (a_word.compare("value") == 0) { - double value = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.BoundaryConditionSetup(bc_id).value = value; - }); - } // value - // set the u - else if (a_word.compare("u") == 0) { - double u = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.bc_global_vars(bc_id,0) = u; - }); - } // u - // set the v - else if (a_word.compare("v") == 0) { - double v = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.bc_global_vars(bc_id,1) = v; - }); - } // v - // set the w - else if (a_word.compare("w") == 0) { - double w = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.bc_global_vars(bc_id,2) = w; - }); - } // w - // set the bc_vel_0 - else if (a_word.compare("hydro_bc_vel_0") == 0) { - double hydro_bc_vel_0 = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.bc_global_vars(bc_id,0) = hydro_bc_vel_0; - }); - } // - // set the bc_vel_1 - else if (a_word.compare("hydro_bc_vel_1") == 0) { - double hydro_bc_vel_1 = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.bc_global_vars(bc_id,1) = hydro_bc_vel_1; - }); - } // - // set the bc_vel_start - else if (a_word.compare("hydro_bc_vel_t_start") == 0) { - double hydro_bc_vel_t_start = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.bc_global_vars(bc_id,2) = hydro_bc_vel_t_start; - }); - } // - // set the bc_vel_end - else if (a_word.compare("hydro_bc_vel_t_end") == 0) { - double hydro_bc_vel_t_end = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - RUN({ - BoundaryConditions.bc_global_vars(bc_id,3) = hydro_bc_vel_t_end; - }); - } // - else if (a_word.compare("origin") == 0) { - std::string origin = bc_yaml[bc_id]["boundary_condition"][a_word].As(); - if (VERBOSE) { - std::cout << "\torigin = " << origin << std::endl; - } + else if (a_word.compare("velocity_bc_global_vars") == 0) { + Yaml::Node & vel_bc_global_vars_yaml = bc_yaml[bc_id]["boundary_condition"][a_word]; - // get the origin numbers, values are words - std::vector numbers = exact_array_values(origin, ","); + size_t num_global_vars = vel_bc_global_vars_yaml.Size(); - double x1 = std::stod(numbers[0]); - double y1 = std::stod(numbers[1]); - double z1; - - if(numbers.size()==3){ - // 3D - z1 = std::stod(numbers[2]); - } - else { - // 2D - z1 = 0.0; - } // + if(num_global_vars>100){ + throw std::runtime_error("**** Per boundary condition, the code only supports up to 100 velocity global vars in the input file ****"); + } // end check on num_global_vars + RUN({ + BoundaryConditions.num_velocity_bc_global_vars(bc_id) = num_global_vars; + }); + if (VERBOSE) { - std::cout << "\tx1 = " << x1 << std::endl; - std::cout << "\ty1 = " << y1 << std::endl; - std::cout << "\tz1 = " << z1 << std::endl; + std::cout << "num global velocity_bc vars = " << num_global_vars << std::endl; } - // storing the origin values as (x1,y1,z1) - RUN({ - BoundaryConditions.BoundaryConditionSetup(bc_id).origin[0] = x1; - BoundaryConditions.BoundaryConditionSetup(bc_id).origin[1] = y1; - BoundaryConditions.BoundaryConditionSetup(bc_id).origin[2] = z1; - }); + // store the global eos model parameters + for (int global_var_id = 0; global_var_id < num_global_vars; global_var_id++) { + double velocity_bc_var = bc_yaml[bc_id]["boundary_condition"]["velocity_bc_global_vars"][global_var_id].As(); + + RUN({ + tempVelocityBCGlobalVars(bc_id, global_var_id) = velocity_bc_var; + }); - } // origin + if (VERBOSE) { + std::cout << "\t var = " << velocity_bc_var << std::endl; + } + } // end loop over global vars + } // end else if on velocity_bc_global_vars else { std::cout << "ERROR: invalid input: " << a_word << std::endl; std::cout << "Valid options are: " << std::endl; @@ -2629,8 +2660,28 @@ void parse_bcs(Yaml::Node& root, BoundaryCondition_t& BoundaryConditions) } } // end for words in boundary conditions + + // add checks for velocity vs time boundary condition + + } // end loop over BCs specified + + // allocate ragged right memory to hold the model global variables + BoundaryConditions.velocity_bc_global_vars = RaggedRightArrayKokkos (BoundaryConditions.num_velocity_bc_global_vars, "BoundaryConditions.velocity_bc_global_vars"); + // ... allocate other bc global vars here + + // save the global variables + FOR_ALL(bc_id, 0, num_bcs, { + + for (size_t var_lid=0; var_lid