Merge remote-tracking branch 'origin/development' into Marc-use-statev-2
PRIVATE repository is synced again (including changes to RGC test)
This commit is contained in:
commit
b1b556fc08
|
@ -251,13 +251,6 @@ Thermal:
|
||||||
- master
|
- master
|
||||||
- release
|
- release
|
||||||
|
|
||||||
grid_packedGeometry:
|
|
||||||
stage: grid
|
|
||||||
script: grid_packedGeometry/test.py
|
|
||||||
except:
|
|
||||||
- master
|
|
||||||
- release
|
|
||||||
|
|
||||||
grid_parsingArguments:
|
grid_parsingArguments:
|
||||||
stage: grid
|
stage: grid
|
||||||
script: grid_parsingArguments/test.py
|
script: grid_parsingArguments/test.py
|
||||||
|
|
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
||||||
Subproject commit 0cbe1cdb13388e33ecc0427d83aab0e090ca8f9d
|
Subproject commit 1b82ac39703fdea70962aea47a0381d50bd1d44e
|
|
@ -104,8 +104,8 @@ input = [options.eulers is not None,
|
||||||
|
|
||||||
if np.sum(input) != 1: parser.error('needs exactly one input format.')
|
if np.sum(input) != 1: parser.error('needs exactly one input format.')
|
||||||
|
|
||||||
r = damask.Rotation.from_axis_angle(np.array(options.crystalrotation),options.degrees,normalise=True)
|
r = damask.Rotation.from_axis_angle(np.array(options.crystalrotation),options.degrees,normalize=True)
|
||||||
R = damask.Rotation.from_axis_angle(np.array(options.labrotation),options.degrees,normalise=True)
|
R = damask.Rotation.from_axis_angle(np.array(options.labrotation),options.degrees,normalize=True)
|
||||||
|
|
||||||
for name in filenames:
|
for name in filenames:
|
||||||
damask.util.report(scriptName,name)
|
damask.util.report(scriptName,name)
|
||||||
|
|
|
@ -408,7 +408,7 @@ class Rotation:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_axis_angle(axis_angle,
|
def from_axis_angle(axis_angle,
|
||||||
degrees = False,
|
degrees = False,
|
||||||
normalise = False,
|
normalize = False,
|
||||||
P = -1):
|
P = -1):
|
||||||
"""
|
"""
|
||||||
Initialize from Axis angle pair.
|
Initialize from Axis angle pair.
|
||||||
|
@ -434,7 +434,7 @@ class Rotation:
|
||||||
|
|
||||||
if P == 1: ax[...,0:3] *= -1
|
if P == 1: ax[...,0:3] *= -1
|
||||||
if degrees: ax[..., 3] = np.radians(ax[...,3])
|
if degrees: ax[..., 3] = np.radians(ax[...,3])
|
||||||
if normalise: ax[...,0:3] /= np.linalg.norm(ax[...,0:3],axis=-1)
|
if normalize: ax[...,0:3] /= np.linalg.norm(ax[...,0:3],axis=-1)
|
||||||
if np.any(ax[...,3] < 0.0) or np.any(ax[...,3] > np.pi):
|
if np.any(ax[...,3] < 0.0) or np.any(ax[...,3] > np.pi):
|
||||||
raise ValueError('Axis angle rotation angle outside of [0..π].')
|
raise ValueError('Axis angle rotation angle outside of [0..π].')
|
||||||
if not np.all(np.isclose(np.linalg.norm(ax[...,0:3],axis=-1), 1.0)):
|
if not np.all(np.isclose(np.linalg.norm(ax[...,0:3],axis=-1), 1.0)):
|
||||||
|
@ -493,7 +493,7 @@ class Rotation:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_Rodrigues(rho,
|
def from_Rodrigues(rho,
|
||||||
normalise = False,
|
normalize = False,
|
||||||
P = -1):
|
P = -1):
|
||||||
"""
|
"""
|
||||||
Initialize from Rodrigues-Frank vector.
|
Initialize from Rodrigues-Frank vector.
|
||||||
|
@ -516,7 +516,7 @@ class Rotation:
|
||||||
raise ValueError('P ∉ {-1,1}')
|
raise ValueError('P ∉ {-1,1}')
|
||||||
|
|
||||||
if P == 1: ro[...,0:3] *= -1
|
if P == 1: ro[...,0:3] *= -1
|
||||||
if normalise: ro[...,0:3] /= np.linalg.norm(ro[...,0:3],axis=-1)
|
if normalize: ro[...,0:3] /= np.linalg.norm(ro[...,0:3],axis=-1)
|
||||||
if np.any(ro[...,3] < 0.0):
|
if np.any(ro[...,3] < 0.0):
|
||||||
raise ValueError('Rodrigues vector rotation angle not positive.')
|
raise ValueError('Rodrigues vector rotation angle not positive.')
|
||||||
if not np.all(np.isclose(np.linalg.norm(ro[...,0:3],axis=-1), 1.0)):
|
if not np.all(np.isclose(np.linalg.norm(ro[...,0:3],axis=-1), 1.0)):
|
||||||
|
|
|
@ -698,13 +698,13 @@ class TestRotation:
|
||||||
assert ok and np.isclose(np.linalg.norm(o),1.0)
|
assert ok and np.isclose(np.linalg.norm(o),1.0)
|
||||||
|
|
||||||
@pytest.mark.parametrize('P',[1,-1])
|
@pytest.mark.parametrize('P',[1,-1])
|
||||||
@pytest.mark.parametrize('normalise',[True,False])
|
@pytest.mark.parametrize('normalize',[True,False])
|
||||||
@pytest.mark.parametrize('degrees',[True,False])
|
@pytest.mark.parametrize('degrees',[True,False])
|
||||||
def test_axis_angle(self,set_of_rotations,degrees,normalise,P):
|
def test_axis_angle(self,set_of_rotations,degrees,normalize,P):
|
||||||
c = np.array([P*-1,P*-1,P*-1,1.])
|
c = np.array([P*-1,P*-1,P*-1,1.])
|
||||||
for rot in set_of_rotations:
|
for rot in set_of_rotations:
|
||||||
m = rot.as_Eulers()
|
m = rot.as_Eulers()
|
||||||
o = Rotation.from_axis_angle(rot.as_axis_angle(degrees)*c,degrees,normalise,P).as_Eulers()
|
o = Rotation.from_axis_angle(rot.as_axis_angle(degrees)*c,degrees,normalize,P).as_Eulers()
|
||||||
u = np.array([np.pi*2,np.pi,np.pi*2])
|
u = np.array([np.pi*2,np.pi,np.pi*2])
|
||||||
ok = np.allclose(m,o,atol=atol)
|
ok = np.allclose(m,o,atol=atol)
|
||||||
ok = ok or np.allclose(np.where(np.isclose(m,u),m-u,m),np.where(np.isclose(o,u),o-u,o),atol=atol)
|
ok = ok or np.allclose(np.where(np.isclose(m,u),m-u,m),np.where(np.isclose(o,u),o-u,o),atol=atol)
|
||||||
|
@ -725,12 +725,12 @@ class TestRotation:
|
||||||
assert ok and np.isclose(np.linalg.norm(o[:3]),1.0) and o[3]<=np.pi+1.e-9
|
assert ok and np.isclose(np.linalg.norm(o[:3]),1.0) and o[3]<=np.pi+1.e-9
|
||||||
|
|
||||||
@pytest.mark.parametrize('P',[1,-1])
|
@pytest.mark.parametrize('P',[1,-1])
|
||||||
@pytest.mark.parametrize('normalise',[True,False])
|
@pytest.mark.parametrize('normalize',[True,False])
|
||||||
def test_Rodrigues(self,set_of_rotations,normalise,P):
|
def test_Rodrigues(self,set_of_rotations,normalize,P):
|
||||||
c = np.array([P*-1,P*-1,P*-1,1.])
|
c = np.array([P*-1,P*-1,P*-1,1.])
|
||||||
for rot in set_of_rotations:
|
for rot in set_of_rotations:
|
||||||
m = rot.as_matrix()
|
m = rot.as_matrix()
|
||||||
o = Rotation.from_Rodrigues(rot.as_Rodrigues()*c,normalise,P).as_matrix()
|
o = Rotation.from_Rodrigues(rot.as_Rodrigues()*c,normalize,P).as_matrix()
|
||||||
ok = np.allclose(m,o,atol=atol)
|
ok = np.allclose(m,o,atol=atol)
|
||||||
print(m,o)
|
print(m,o)
|
||||||
assert ok and np.isclose(np.linalg.det(o),1.0)
|
assert ok and np.isclose(np.linalg.det(o),1.0)
|
||||||
|
|
|
@ -188,10 +188,10 @@ module subroutine mech_RGC_init(num_homogMech)
|
||||||
stt%work => homogState(h)%state(nIntFaceTot+1,:)
|
stt%work => homogState(h)%state(nIntFaceTot+1,:)
|
||||||
stt%penaltyEnergy => homogState(h)%state(nIntFaceTot+2,:)
|
stt%penaltyEnergy => homogState(h)%state(nIntFaceTot+2,:)
|
||||||
|
|
||||||
allocate(dst%volumeDiscrepancy( NofMyHomog))
|
allocate(dst%volumeDiscrepancy( NofMyHomog), source=0.0_pReal)
|
||||||
allocate(dst%relaxationRate_avg( NofMyHomog))
|
allocate(dst%relaxationRate_avg( NofMyHomog), source=0.0_pReal)
|
||||||
allocate(dst%relaxationRate_max( NofMyHomog))
|
allocate(dst%relaxationRate_max( NofMyHomog), source=0.0_pReal)
|
||||||
allocate(dst%mismatch( 3,NofMyHomog))
|
allocate(dst%mismatch( 3,NofMyHomog), source=0.0_pReal)
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! assigning cluster orientations
|
! assigning cluster orientations
|
||||||
|
|
|
@ -12,8 +12,7 @@ submodule(constitutive:constitutive_damage) source_damage_isoBrittle
|
||||||
|
|
||||||
type :: tParameters !< container type for internal constitutive parameters
|
type :: tParameters !< container type for internal constitutive parameters
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
critStrainEnergy, & !< critical elastic strain energy
|
W_crit !< critical elastic strain energy
|
||||||
N
|
|
||||||
character(len=pStringLen), allocatable, dimension(:) :: &
|
character(len=pStringLen), allocatable, dimension(:) :: &
|
||||||
output
|
output
|
||||||
end type tParameters
|
end type tParameters
|
||||||
|
@ -64,8 +63,7 @@ module function source_damage_isoBrittle_init(source_length) result(mySources)
|
||||||
associate(prm => param(source_damage_isoBrittle_instance(p)))
|
associate(prm => param(source_damage_isoBrittle_instance(p)))
|
||||||
src => sources%get(sourceOffset)
|
src => sources%get(sourceOffset)
|
||||||
|
|
||||||
prm%N = src%get_asFloat('m')
|
prm%W_crit = src%get_asFloat('W_crit')
|
||||||
prm%critStrainEnergy = src%get_asFloat('W_crit')
|
|
||||||
|
|
||||||
#if defined (__GFORTRAN__)
|
#if defined (__GFORTRAN__)
|
||||||
prm%output = output_asStrings(src)
|
prm%output = output_asStrings(src)
|
||||||
|
@ -74,8 +72,7 @@ module function source_damage_isoBrittle_init(source_length) result(mySources)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
! sanity checks
|
! sanity checks
|
||||||
if (prm%N <= 0.0_pReal) extmsg = trim(extmsg)//' m'
|
if (prm%W_crit <= 0.0_pReal) extmsg = trim(extmsg)//' W_crit'
|
||||||
if (prm%critStrainEnergy <= 0.0_pReal) extmsg = trim(extmsg)//' W_crit'
|
|
||||||
|
|
||||||
NipcMyPhase = count(material_phaseAt==p) * discretization_nIP
|
NipcMyPhase = count(material_phaseAt==p) * discretization_nIP
|
||||||
call constitutive_allocateState(sourceState(p)%p(sourceOffset),NipcMyPhase,1,1,1)
|
call constitutive_allocateState(sourceState(p)%p(sourceOffset),NipcMyPhase,1,1,1)
|
||||||
|
@ -125,8 +122,8 @@ module subroutine source_damage_isoBrittle_deltaState(C, Fe, ipc, ip, el)
|
||||||
strain = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3)
|
strain = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3)
|
||||||
|
|
||||||
associate(prm => param(source_damage_isoBrittle_instance(phase)))
|
associate(prm => param(source_damage_isoBrittle_instance(phase)))
|
||||||
strainenergy = 2.0_pReal*sum(strain*matmul(C,strain))/prm%critStrainEnergy
|
strainenergy = 2.0_pReal*sum(strain*matmul(C,strain))/prm%W_crit
|
||||||
! ToDo: check strainenergy = 2.0_pReal*dot_product(strain,matmul(C,strain))/param(instance)%critStrainEnergy
|
! ToDo: check strainenergy = 2.0_pReal*dot_product(strain,matmul(C,strain))/prm%W_crit
|
||||||
|
|
||||||
if (strainenergy > sourceState(phase)%p(sourceOffset)%subState0(1,constituent)) then
|
if (strainenergy > sourceState(phase)%p(sourceOffset)%subState0(1,constituent)) then
|
||||||
sourceState(phase)%p(sourceOffset)%deltaState(1,constituent) = &
|
sourceState(phase)%p(sourceOffset)%deltaState(1,constituent) = &
|
||||||
|
@ -161,10 +158,9 @@ module subroutine source_damage_isoBrittle_getRateAndItsTangent(localphiDot, dLo
|
||||||
sourceOffset = source_damage_isoBrittle_offset(phase)
|
sourceOffset = source_damage_isoBrittle_offset(phase)
|
||||||
|
|
||||||
associate(prm => param(source_damage_isoBrittle_instance(phase)))
|
associate(prm => param(source_damage_isoBrittle_instance(phase)))
|
||||||
localphiDot = (1.0_pReal - phi)**(prm%n - 1.0_pReal) &
|
localphiDot = 1.0_pReal &
|
||||||
- phi*sourceState(phase)%p(sourceOffset)%state(1,constituent)
|
- phi*sourceState(phase)%p(sourceOffset)%state(1,constituent)
|
||||||
dLocalphiDot_dPhi = - (prm%n - 1.0_pReal)* (1.0_pReal - phi)**max(0.0_pReal,prm%n - 2.0_pReal) &
|
dLocalphiDot_dPhi = - sourceState(phase)%p(sourceOffset)%state(1,constituent)
|
||||||
- sourceState(phase)%p(sourceOffset)%state(1,constituent)
|
|
||||||
end associate
|
end associate
|
||||||
|
|
||||||
end subroutine source_damage_isoBrittle_getRateAndItsTangent
|
end subroutine source_damage_isoBrittle_getRateAndItsTangent
|
||||||
|
|
Loading…
Reference in New Issue