unify notation with grid

consistent style: Symbols, not descriptions.
also removed untested/unused loginc functionality. Once load cases are
written in YAML, we can introduce the scaling as in DAMASK_grid
This commit is contained in:
Martin Diehl 2021-07-22 07:58:34 +02:00
parent 173a5f8e55
commit eb834b635d
4 changed files with 32 additions and 54 deletions

@ -1 +1 @@
Subproject commit 96cf7af039b3153f91c037bcce62eb456af51f4b
Subproject commit d92b030e5777e718c77edc2e1e93abfa0981b024

View File

@ -1,11 +1,11 @@
#initial elastic step
$Loadcase 1 time 0.0005 incs 1 frequency 5
$Loadcase 1 t 0.0005 N 1 f_out 5
Face 1 X 0.01
Face 2 X 0.0
Face 2 Y 0.0
Face 2 Z 0.0
$EndLoadcase
$Loadcase 2 time 10.0 incs 200 frequency 5
$Loadcase 2 t 10.0 N 200 f_out 5
Face 1 X 0.01
Face 2 X 0.0
Face 2 Y 0.0

View File

@ -23,6 +23,15 @@ program DAMASK_mesh
implicit none
integer :: nActiveFields = 0
type :: tLoadCase
real(pReal) :: time = 0.0_pReal !< length of increment
integer :: incs = 0, & !< number of increments
outputfrequency = 1 !< frequency of result writes
logical :: followFormerTrajectory = .true. !< follow trajectory of former loadcase
integer, allocatable, dimension(:) :: faceID
type(tFieldBC), allocatable, dimension(:) :: fieldBC
end type tLoadCase
!--------------------------------------------------------------------------------------------------
! variables related to information from load case and geom file
integer, allocatable, dimension(:) :: chunkPos ! this is longer than needed for geometry parsing
@ -104,8 +113,8 @@ program DAMASK_mesh
chunkPos = IO_stringPos(line)
do i = 1, chunkPos(1) ! reading compulsory parameters for loadcase
select case (IO_lc(IO_stringValue(line,chunkPos,i)))
case('$loadcase')
select case (IO_stringValue(line,chunkPos,i))
case('$Loadcase')
N_def = N_def + 1
end select
enddo ! count all identifiers to allocate memory and do sanity check
@ -152,39 +161,36 @@ program DAMASK_mesh
chunkPos = IO_stringPos(line)
do i = 1, chunkPos(1)
select case (IO_lc(IO_stringValue(line,chunkPos,i)))
select case (IO_stringValue(line,chunkPos,i))
!--------------------------------------------------------------------------------------------------
! loadcase information
case('$loadcase')
case('$Loadcase')
currentLoadCase = IO_intValue(line,chunkPos,i+1)
case('face')
case('Face')
currentFace = IO_intValue(line,chunkPos,i+1)
currentFaceSet = -1
do faceSet = 1, mesh_Nboundaries
if (mesh_boundaries(faceSet) == currentFace) currentFaceSet = faceSet
enddo
if (currentFaceSet < 0) call IO_error(error_ID = 837, ext_msg = 'invalid BC')
case('t','time','delta') ! increment time
case('t')
loadCases(currentLoadCase)%time = IO_floatValue(line,chunkPos,i+1)
case('n','incs','increments','steps') ! number of increments
case('N')
loadCases(currentLoadCase)%incs = IO_intValue(line,chunkPos,i+1)
case('logincs','logincrements','logsteps') ! number of increments (switch to log time scaling)
loadCases(currentLoadCase)%incs = IO_intValue(line,chunkPos,i+1)
loadCases(currentLoadCase)%logscale = 1
case('freq','frequency','outputfreq') ! frequency of result writings
case('f_out')
loadCases(currentLoadCase)%outputfrequency = IO_intValue(line,chunkPos,i+1)
case('guessreset','dropguessing')
case('estimate_rate')
loadCases(currentLoadCase)%followFormerTrajectory = .false. ! do not continue to predict deformation along former trajectory
!--------------------------------------------------------------------------------------------------
! boundary condition information
case('x','y','z')
select case(IO_lc(IO_stringValue(line,chunkPos,i)))
case('x')
case('X','Y','Z')
select case(IO_stringValue(line,chunkPos,i))
case('X')
ID = COMPONENT_MECH_X_ID
case('y')
case('Y')
ID = COMPONENT_MECH_Y_ID
case('z')
case('Z')
ID = COMPONENT_MECH_Z_ID
end select
@ -267,26 +273,8 @@ program DAMASK_mesh
!--------------------------------------------------------------------------------------------------
! forwarding time
timeIncOld = timeinc ! last timeinc that brought former inc to an end
if (loadCases(currentLoadCase)%logscale == 0) then ! linear scale
timeinc = loadCases(currentLoadCase)%time/real(loadCases(currentLoadCase)%incs,pReal)
else
if (currentLoadCase == 1) then ! 1st load case of logarithmic scale
if (inc == 1) then ! 1st inc of 1st load case of logarithmic scale
timeinc = loadCases(1)%time*(2.0_pReal**real( 1-loadCases(1)%incs ,pReal)) ! assume 1st inc is equal to 2nd
else ! not-1st inc of 1st load case of logarithmic scale
timeinc = loadCases(1)%time*(2.0_pReal**real(inc-1-loadCases(1)%incs ,pReal))
endif
else ! not-1st load case of logarithmic scale
timeinc = time0 * &
( (1.0_pReal + loadCases(currentLoadCase)%time/time0 )**(real( inc,pReal)/&
real(loadCases(currentLoadCase)%incs ,pReal))&
-(1.0_pReal + loadCases(currentLoadCase)%time/time0 )**(real( inc-1 ,pReal)/&
real(loadCases(currentLoadCase)%incs ,pReal)))
endif
endif
timeinc = timeinc * real(subStepFactor,pReal)**real(-cutBackLevel,pReal) ! depending on cut back level, decrease time step
stepFraction = 0 ! fraction scaled by stepFactor**cutLevel
subStepLooping: do while (stepFraction < subStepFactor**cutBackLevel)

View File

@ -64,16 +64,6 @@ module FEM_utilities
type(tComponentBC), allocatable :: componentBC(:)
end type tFieldBC
type, public :: tLoadCase
real(pReal) :: time = 0.0_pReal !< length of increment
integer :: incs = 0, & !< number of increments
outputfrequency = 1, & !< frequency of result writes
logscale = 0 !< linear/logarithmic time inc flag
logical :: followFormerTrajectory = .true. !< follow trajectory of former loadcase
integer, allocatable, dimension(:) :: faceID
type(tFieldBC), allocatable, dimension(:) :: fieldBC
end type tLoadCase
public :: &
FEM_utilities_init, &
utilities_constitutiveResponse, &