mechanics solver type is set only once
as all mech routines have the same interface, this leaner syntax can be used
This commit is contained in:
parent
b11666effa
commit
d18d74ae31
|
@ -143,6 +143,12 @@ program DAMASK_spectral
|
||||||
integer(pInt), parameter :: maxRealOut = maxByteOut/pReal
|
integer(pInt), parameter :: maxRealOut = maxByteOut/pReal
|
||||||
integer(pLongInt), dimension(2) :: outputIndex
|
integer(pLongInt), dimension(2) :: outputIndex
|
||||||
integer :: ierr
|
integer :: ierr
|
||||||
|
procedure(basic_init), pointer :: &
|
||||||
|
mech_init
|
||||||
|
procedure(basic_forward), pointer :: &
|
||||||
|
mech_forward
|
||||||
|
procedure(basic_solution), pointer :: &
|
||||||
|
mech_solution
|
||||||
|
|
||||||
external :: &
|
external :: &
|
||||||
quit
|
quit
|
||||||
|
@ -163,6 +169,26 @@ program DAMASK_spectral
|
||||||
if (any(damage_type == DAMAGE_nonlocal_ID )) nActiveFields = nActiveFields + 1
|
if (any(damage_type == DAMAGE_nonlocal_ID )) nActiveFields = nActiveFields + 1
|
||||||
allocate(solres(nActiveFields))
|
allocate(solres(nActiveFields))
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
! assign mechanics solver depending on selected type
|
||||||
|
select case (spectral_solver)
|
||||||
|
case (DAMASK_spectral_SolverBasic_label)
|
||||||
|
mech_init => basic_init
|
||||||
|
mech_forward => basic_forward
|
||||||
|
mech_solution => basic_solution
|
||||||
|
|
||||||
|
case (DAMASK_spectral_SolverPolarisation_label)
|
||||||
|
if(iand(debug_level(debug_spectral),debug_levelBasic)/= 0) &
|
||||||
|
call IO_warning(42_pInt, ext_msg='debug Divergence')
|
||||||
|
mech_init => polarisation_init
|
||||||
|
mech_forward => polarisation_forward
|
||||||
|
mech_solution => polarisation_solution
|
||||||
|
|
||||||
|
case default
|
||||||
|
call IO_error(error_ID = 891_pInt, ext_msg = trim(spectral_solver))
|
||||||
|
|
||||||
|
end select
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! reading basic information from load case file and allocate data structure containing load cases
|
! reading basic information from load case file and allocate data structure containing load cases
|
||||||
call IO_open_file(FILEUNIT,trim(loadCaseFile))
|
call IO_open_file(FILEUNIT,trim(loadCaseFile))
|
||||||
|
@ -189,7 +215,7 @@ program DAMASK_spectral
|
||||||
allocate (loadCases(N_n)) ! array of load cases
|
allocate (loadCases(N_n)) ! array of load cases
|
||||||
loadCases%stress%myType='stress'
|
loadCases%stress%myType='stress'
|
||||||
|
|
||||||
do i = 1, size(loadCases)
|
do i = 1, size(loadCases)
|
||||||
allocate(loadCases(i)%ID(nActiveFields))
|
allocate(loadCases(i)%ID(nActiveFields))
|
||||||
field = 1
|
field = 1
|
||||||
loadCases(i)%ID(field) = FIELD_MECH_ID ! mechanical active by default
|
loadCases(i)%ID(field) = FIELD_MECH_ID ! mechanical active by default
|
||||||
|
@ -355,25 +381,13 @@ program DAMASK_spectral
|
||||||
do field = 1, nActiveFields
|
do field = 1, nActiveFields
|
||||||
select case (loadCases(1)%ID(field))
|
select case (loadCases(1)%ID(field))
|
||||||
case(FIELD_MECH_ID)
|
case(FIELD_MECH_ID)
|
||||||
select case (spectral_solver)
|
call mech_init
|
||||||
case (DAMASK_spectral_SolverBasic_label)
|
|
||||||
call basic_init
|
|
||||||
|
|
||||||
case (DAMASK_spectral_SolverPolarisation_label)
|
|
||||||
if(iand(debug_level(debug_spectral),debug_levelBasic)/= 0) &
|
|
||||||
call IO_warning(42_pInt, ext_msg='debug Divergence')
|
|
||||||
call Polarisation_init
|
|
||||||
|
|
||||||
case default
|
|
||||||
call IO_error(error_ID = 891_pInt, ext_msg = trim(spectral_solver))
|
|
||||||
|
|
||||||
end select
|
|
||||||
|
|
||||||
case(FIELD_THERMAL_ID)
|
case(FIELD_THERMAL_ID)
|
||||||
call spectral_thermal_init
|
call spectral_thermal_init
|
||||||
|
|
||||||
case(FIELD_DAMAGE_ID)
|
case(FIELD_DAMAGE_ID)
|
||||||
call spectral_damage_init()
|
call spectral_damage_init
|
||||||
|
|
||||||
end select
|
end select
|
||||||
enddo
|
enddo
|
||||||
|
@ -512,24 +526,14 @@ program DAMASK_spectral
|
||||||
do field = 1, nActiveFields
|
do field = 1, nActiveFields
|
||||||
select case(loadCases(currentLoadCase)%ID(field))
|
select case(loadCases(currentLoadCase)%ID(field))
|
||||||
case(FIELD_MECH_ID)
|
case(FIELD_MECH_ID)
|
||||||
select case (spectral_solver)
|
call mech_forward (&
|
||||||
case (DAMASK_spectral_SolverBasic_label)
|
|
||||||
call Basic_forward (&
|
|
||||||
guess,timeinc,timeIncOld,remainingLoadCaseTime, &
|
guess,timeinc,timeIncOld,remainingLoadCaseTime, &
|
||||||
deformation_BC = loadCases(currentLoadCase)%deformation, &
|
deformation_BC = loadCases(currentLoadCase)%deformation, &
|
||||||
stress_BC = loadCases(currentLoadCase)%stress, &
|
stress_BC = loadCases(currentLoadCase)%stress, &
|
||||||
rotation_BC = loadCases(currentLoadCase)%rotation)
|
rotation_BC = loadCases(currentLoadCase)%rotation)
|
||||||
|
|
||||||
case (DAMASK_spectral_SolverPolarisation_label)
|
case(FIELD_THERMAL_ID); call spectral_thermal_forward()
|
||||||
call Polarisation_forward (&
|
case(FIELD_DAMAGE_ID); call spectral_damage_forward()
|
||||||
guess,timeinc,timeIncOld,remainingLoadCaseTime, &
|
|
||||||
deformation_BC = loadCases(currentLoadCase)%deformation, &
|
|
||||||
stress_BC = loadCases(currentLoadCase)%stress, &
|
|
||||||
rotation_BC = loadCases(currentLoadCase)%rotation)
|
|
||||||
end select
|
|
||||||
|
|
||||||
case(FIELD_THERMAL_ID); call spectral_thermal_forward()
|
|
||||||
case(FIELD_DAMAGE_ID); call spectral_damage_forward()
|
|
||||||
end select
|
end select
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -541,20 +545,10 @@ program DAMASK_spectral
|
||||||
do field = 1, nActiveFields
|
do field = 1, nActiveFields
|
||||||
select case(loadCases(currentLoadCase)%ID(field))
|
select case(loadCases(currentLoadCase)%ID(field))
|
||||||
case(FIELD_MECH_ID)
|
case(FIELD_MECH_ID)
|
||||||
select case (spectral_solver)
|
solres(field) = mech_solution (&
|
||||||
case (DAMASK_spectral_SolverBasic_label)
|
incInfo,timeinc,timeIncOld, &
|
||||||
solres(field) = Basic_solution (&
|
stress_BC = loadCases(currentLoadCase)%stress, &
|
||||||
incInfo,timeinc,timeIncOld, &
|
rotation_BC = loadCases(currentLoadCase)%rotation)
|
||||||
stress_BC = loadCases(currentLoadCase)%stress, &
|
|
||||||
rotation_BC = loadCases(currentLoadCase)%rotation)
|
|
||||||
|
|
||||||
case (DAMASK_spectral_SolverPolarisation_label)
|
|
||||||
solres(field) = Polarisation_solution (&
|
|
||||||
incInfo,timeinc,timeIncOld, &
|
|
||||||
stress_BC = loadCases(currentLoadCase)%stress, &
|
|
||||||
rotation_BC = loadCases(currentLoadCase)%rotation)
|
|
||||||
|
|
||||||
end select
|
|
||||||
|
|
||||||
case(FIELD_THERMAL_ID)
|
case(FIELD_THERMAL_ID)
|
||||||
solres(field) = spectral_thermal_solution(timeinc,timeIncOld,remainingLoadCaseTime)
|
solres(field) = spectral_thermal_solution(timeinc,timeIncOld,remainingLoadCaseTime)
|
||||||
|
|
Loading…
Reference in New Issue