Add Solid 0.5.1 input validation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user