Load the material parameters from the JSON file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(type_input) | :: | self | ||||
type(json_file), | intent(inout) | :: | json |
JSON parser |
subroutine read_parameters_materials(self, json) !> Load the material parameters from the JSON file implicit none class(type_input) :: self type(json_file), intent(inout) :: json !! JSON parser logical :: found character(:), allocatable :: key integer(int32) :: i call json%info(materials, found=found, n_children=self%basic%num_materials) call json%print_error_message(output_unit) if (.not. found .or. self%basic%num_materials <= 0) then call json%destroy() call error_message(904, c_opt=materials) end if if (allocated(self%basic%materials)) deallocate (self%basic%materials) allocate (self%basic%materials(self%basic%num_materials)) do i = 1, self%basic%num_materials call read_parameters_materials_basic(self, json, i) if (self%basic%analysis_controls%calculate_thermal) then call read_parameters_materials_thermal(self, json, i) end if if (self%basic%analysis_controls%calculate_hydraulic) then call read_parameters_materials_hydrauilic(self, json, i) end if if (self%basic%analysis_controls%calculate_mechanical) then ! Mechanical parameters can be added here in the future end if end do end subroutine read_parameters_materials