introduced new state structure, compile with STATE=NEW

This commit is contained in:
Martin Diehl 2014-04-15 09:20:38 +00:00
parent a8a9c8eef5
commit 302423d266
3 changed files with 30 additions and 6 deletions

View File

@ -117,6 +117,11 @@ RUN_PATH :=$(RUN_PATH),-rpath,$(HDF5_ROOT)/lib
INCLUDE_DIRS +=-I$(HDF5_ROOT)/include -DHDF
endif
#new state
ifeq "$(STATE)" "NEW"
INCLUDE_DIRS +=-DNEWSTATE
endif
ifdef STANDARD_CHECK
STANDARD_CHECK_ifort =$(STANDARD_CHECK)
STANDARD_CHECK_gfortran =$(STANDARD_CHECK)

View File

@ -12,6 +12,9 @@ module material
use prec, only: &
pReal, &
pInt, &
#ifdef NEWSTATE
tState, &
#endif
p_intvec
implicit none
@ -88,6 +91,12 @@ module material
integer(pInt), dimension(:,:,:), allocatable, public :: &
material_phase !< phase (index) of each grain,IP,element
#ifdef NEWSTATE
type(tState), allocatable, dimension(:) :: &
plasticState, &
elasticState
#endif
integer(pInt), dimension(:,:,:), allocatable, public, protected :: &
material_texture !< texture (index) of each grain,IP,element
@ -208,6 +217,11 @@ subroutine material_init
call material_parsePhase(FILEUNIT,material_partPhase)
if (iand(myDebug,debug_levelBasic) /= 0_pInt) write(6,'(a)') ' Phase parsed'
close(FILEUNIT)
#ifdef NEWSTATE
allocate(plasticState(material_Nphase))
allocate(plasticState(material_Nphase))
#endif
do m = 1_pInt,material_Nmicrostructure
if(microstructure_crystallite(m) < 1_pInt .or. &
@ -221,12 +235,6 @@ subroutine material_init
call IO_error(150_pInt,m,ext_msg='texture')
if(microstructure_Nconstituents(m) < 1_pInt) &
call IO_error(151_pInt,m)
! if (abs(sum(microstructure_fraction(:,m)) - 1.0_pReal) >= 1.0e-6_pReal) then ! have ppm precision in fractions
! if (iand(myDebug,debug_levelExtensive) /= 0_pInt) then
! write(6,'(a,1x,f12.9)') ' sum of microstructure fraction = ',sum(microstructure_fraction(:,m))
! endif
! call IO_error(153_pInt,m)
! endif
enddo
debugOut: if (iand(myDebug,debug_levelExtensive) /= 0_pInt) then
write(6,'(/,a,/)') ' MATERIAL configuration'

View File

@ -56,6 +56,13 @@ module prec
integer(pInt), dimension(:), pointer :: p
end type p_intvec
#ifdef NEWSTATE
!http://stackoverflow.com/questions/3948210/can-i-have-a-pointer-to-an-item-in-an-allocatable-array
type, public :: tState
real(pReal), pointer, dimension(:,:) :: s ! material points, state size
end type
#endif
public :: &
prec_init
@ -74,11 +81,15 @@ subroutine prec_init
write(6,'(/,a)') ' <<<+- prec init -+>>>'
write(6,'(a)') ' $Id$'
#include "compilation_info.f90"
#ifdef NEWSTATE
write(6,'(a)') 'Using new state structure'
#endif
write(6,'(a,i3)') ' Bytes for pReal: ',pReal
write(6,'(a,i3)') ' Bytes for pInt: ',pInt
write(6,'(a,i3)') ' Bytes for pLongInt: ',pLongInt
write(6,'(a,e10.3)') ' NaN: ', DAMASK_NaN
write(6,'(a,l3,/)') ' NaN /= NaN: ',DAMASK_NaN/=DAMASK_NaN
if (DAMASK_NaN == DAMASK_NaN) call quit(9000)
end subroutine prec_init