Add Solid 0.5.1 input validation

This commit is contained in:
Codex
2026-07-03 17:06:42 +08:00
parent 98d05aa94d
commit f1ad27c5d7
10 changed files with 307 additions and 24 deletions
+7 -1
View File
@@ -189,7 +189,7 @@ contains
particle_phase(i) = SPH_PHASE_SOLID
particle_status(i) = SPH_STATUS_ACTIVE
material_id(i) = 1
section_id(i) = 1
section_id(i) = 0
x0(:,i) = 0.0_rk
x(:,i) = 0.0_rk
v(:,i) = 0.0_rk
@@ -467,6 +467,12 @@ contains
integer :: i
ierr = SPH_SUCCESS
if (density_value /= density_value .or. &
abs(density_value) > huge(density_value) * 0.5_rk) then
call sph_error_set(SPH_ERROR_ARGUMENT, 'material density must be finite')
ierr = SPH_ERROR_ARGUMENT
return
end if
if (density_value <= 0.0_rk) then
call sph_error_set(SPH_ERROR_ARGUMENT, 'material density must be positive')
ierr = SPH_ERROR_ARGUMENT