2012-02-13 19:48:07 +05:30
|
|
|
! Copyright 2011 Max-Planck-Institut für Eisenforschung GmbH
|
2011-04-04 19:39:54 +05:30
|
|
|
!
|
|
|
|
! This file is part of DAMASK,
|
2012-08-28 21:38:17 +05:30
|
|
|
! the Düsseldorf Advanced Material Simulation Kit.
|
2011-04-04 19:39:54 +05:30
|
|
|
!
|
|
|
|
! DAMASK is free software: you can redistribute it and/or modify
|
|
|
|
! it under the terms of the GNU General Public License as published by
|
|
|
|
! the Free Software Foundation, either version 3 of the License, or
|
|
|
|
! (at your option) any later version.
|
|
|
|
!
|
|
|
|
! DAMASK is distributed in the hope that it will be useful,
|
|
|
|
! but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
! GNU General Public License for more details.
|
|
|
|
!
|
|
|
|
! You should have received a copy of the GNU General Public License
|
|
|
|
! along with DAMASK. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
!
|
2013-03-01 17:18:29 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
! $Id$
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author Luc Hantcherli, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author W.A. Counts
|
|
|
|
!> @author Denny Tjahjanto, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @brief Material subroutine for MSC.Marc
|
|
|
|
!> @details Usage:
|
|
|
|
!> @details - choose material as hypela2
|
|
|
|
!> @details - set statevariable 2 to index of homogenization
|
|
|
|
!> @details - set statevariable 3 to index of microstructure
|
|
|
|
!> @details - make sure the file "material.config" exists in the working
|
|
|
|
!> @details directory
|
|
|
|
!> @details - make sure the file "numerics.config" exists in the working
|
|
|
|
!> @details directory
|
|
|
|
!> @details - use nonsymmetric option for solver (e.g. direct
|
|
|
|
!> @details profile or multifrontal sparse, the latter seems
|
|
|
|
!> @details to be faster!)
|
|
|
|
!> @details - in case of ddm (domain decomposition)a SYMMETRIC
|
|
|
|
!> @details solver has to be used, i.e uncheck "non-symmetric"
|
|
|
|
!> @details Marc subroutines used:
|
|
|
|
!> @details - hypela2
|
|
|
|
!> @details - plotv
|
|
|
|
!> @details - quit
|
|
|
|
!> @details Marc common blocks included:
|
|
|
|
!> @details - concom: lovl, ncycle, inc, incsub
|
|
|
|
!> @details - creeps: timinc
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2012-08-28 21:38:17 +05:30
|
|
|
|
|
|
|
#ifndef INT
|
|
|
|
#define INT 4
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FLOAT
|
|
|
|
#define FLOAT 8
|
|
|
|
#endif
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
#define Marc
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2012-08-28 21:38:17 +05:30
|
|
|
#include "prec.f90"
|
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
module DAMASK_interface
|
2012-06-15 21:40:21 +05:30
|
|
|
|
|
|
|
implicit none
|
|
|
|
character(len=4), parameter :: InputFileExtension = '.dat'
|
|
|
|
character(len=4), parameter :: LogFileExtension = '.log'
|
2009-10-12 21:31:49 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
contains
|
2009-08-31 20:51:15 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief only output of current version
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2012-03-09 01:55:28 +05:30
|
|
|
subroutine DAMASK_interface_init
|
2010-11-03 20:09:18 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
implicit none
|
2010-11-03 20:09:18 +05:30
|
|
|
|
|
|
|
!$OMP CRITICAL (write2out)
|
2013-03-01 17:18:29 +05:30
|
|
|
write(6,'(/,a)') ' <<<+- DAMASK_marc init -+>>>'
|
|
|
|
write(6,'(a)') ' $Id$'
|
2012-02-01 00:48:55 +05:30
|
|
|
#include "compilation_info.f90"
|
2010-11-03 20:09:18 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
end subroutine DAMASK_interface_init
|
|
|
|
|
2009-08-31 20:39:15 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief returns the current workingDir
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2010-06-08 15:05:13 +05:30
|
|
|
function getSolverWorkingDirectoryName()
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2010-05-10 20:32:59 +05:30
|
|
|
implicit none
|
2012-06-13 12:58:43 +05:30
|
|
|
character(1024) getSolverWorkingDirectoryName, inputName
|
2010-08-04 05:17:00 +05:30
|
|
|
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! forward and backward slash
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2010-05-11 12:27:15 +05:30
|
|
|
getSolverWorkingDirectoryName=''
|
2012-06-13 12:58:43 +05:30
|
|
|
inputName=''
|
|
|
|
inquire(5, name=inputName) ! determine inputputfile
|
|
|
|
getSolverWorkingDirectoryName=inputName(1:scan(inputName,pathSep,back=.true.))
|
2010-05-11 12:27:15 +05:30
|
|
|
! write(6,*) 'getSolverWorkingDirectoryName', getSolverWorkingDirectoryName
|
2012-03-09 01:55:28 +05:30
|
|
|
|
|
|
|
end function getSolverWorkingDirectoryName
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief solver job name (no extension) as combination of geometry and load case name
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2010-06-08 15:05:13 +05:30
|
|
|
function getSolverJobName()
|
2013-03-01 17:18:29 +05:30
|
|
|
use prec, only: &
|
|
|
|
pReal, &
|
|
|
|
pInt
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
implicit none
|
2012-06-13 15:28:06 +05:30
|
|
|
character(1024) :: getSolverJobName, inputName
|
2010-08-04 05:17:00 +05:30
|
|
|
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! forward and backward slash
|
2012-03-09 01:55:28 +05:30
|
|
|
integer(pInt) :: extPos
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2010-05-11 12:27:15 +05:30
|
|
|
getSolverJobName=''
|
2012-06-13 15:28:06 +05:30
|
|
|
inputName=''
|
2012-06-15 21:40:21 +05:30
|
|
|
inquire(5, name=inputName) ! determine inputfile
|
2012-06-13 15:28:06 +05:30
|
|
|
extPos = len_trim(inputName)-4
|
|
|
|
getSolverJobName=inputName(scan(inputName,pathSep,back=.true.)+1:extPos)
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end function getSolverJobName
|
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end module DAMASK_interface
|
2009-08-31 20:51:15 +05:30
|
|
|
|
2013-02-26 18:19:07 +05:30
|
|
|
#include "IO.f90"
|
2011-03-29 12:57:19 +05:30
|
|
|
#include "numerics.f90"
|
|
|
|
#include "debug.f90"
|
|
|
|
#include "math.f90"
|
|
|
|
#include "FEsolving.f90"
|
|
|
|
#include "mesh.f90"
|
|
|
|
#include "material.f90"
|
|
|
|
#include "lattice.f90"
|
2012-07-03 16:46:38 +05:30
|
|
|
#include "constitutive_none.f90"
|
2011-03-29 12:57:19 +05:30
|
|
|
#include "constitutive_j2.f90"
|
|
|
|
#include "constitutive_phenopowerlaw.f90"
|
|
|
|
#include "constitutive_titanmod.f90"
|
|
|
|
#include "constitutive_dislotwin.f90"
|
|
|
|
#include "constitutive_nonlocal.f90"
|
|
|
|
#include "constitutive.f90"
|
|
|
|
#include "crystallite.f90"
|
|
|
|
#include "homogenization_isostrain.f90"
|
|
|
|
#include "homogenization_RGC.f90"
|
|
|
|
#include "homogenization.f90"
|
|
|
|
#include "CPFEM.f90"
|
2008-03-15 03:02:57 +05:30
|
|
|
|
2009-03-04 17:18:54 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief This is the MSC.Marc user subroutine for defining material behavior
|
|
|
|
!> @details CAUTION : Due to calculation of the Deformation gradients, Stretch Tensors and
|
|
|
|
!> @details Rotation tensors at previous and current states, the analysis can be
|
|
|
|
!> @details computationally expensive. Please use the user subroutine -> hypela
|
|
|
|
!> @details if these kinematic quantities are not needed in the constitutive model
|
|
|
|
!> @details
|
|
|
|
!> @details IMPORTANT NOTES :
|
|
|
|
!> @details
|
|
|
|
!> @details (1) F,R,U are only available for continuum and membrane elements (not for
|
|
|
|
!> @details shells and beams).
|
|
|
|
!> @details
|
|
|
|
!> @details (2) For total Lagrangian formulation use the -> 'Elasticity,1' card(=
|
|
|
|
!> @details total Lagrange with large disp) in the parameter section of input deck.
|
|
|
|
!> @details For updated Lagrangian formulation use the -> 'Plasticity,3' card(=
|
|
|
|
!> @details update+finite+large disp+constant d) in the parameter section of
|
|
|
|
!> @details input deck.
|
|
|
|
!> @details
|
|
|
|
!> @details The following operation obtains U (stretch tensor) at t=n+1 :
|
|
|
|
!> @details
|
|
|
|
!> @details call scla(un1,0.d0,itel,itel,1)
|
|
|
|
!> @details do k=1,3
|
|
|
|
!> @details do i=1,3
|
|
|
|
!> @details do j=1,3
|
|
|
|
!> @details un1(i,j)=un1(i,j)+dsqrt(strechn1(k))*eigvn1(i,k)*eigvn1(j,k)
|
|
|
|
!> @details enddo
|
|
|
|
!> @details enddo
|
|
|
|
!> @details enddo
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2009-05-07 21:57:36 +05:30
|
|
|
subroutine hypela2(&
|
2013-03-01 17:18:29 +05:30
|
|
|
d,& !< stress strain law to be formed
|
|
|
|
g,& !< change in stress due to temperature effects
|
|
|
|
e,& !< total elastic strain
|
|
|
|
de,& !< increment of strain
|
|
|
|
s,& !< stress - should be updated by user
|
|
|
|
t,& !< state variables (comes in at t=n, must be updated to have state variables at t=n+1)
|
|
|
|
dt,& !< increment of state variables
|
|
|
|
ngens,& !< size of stress - strain law
|
|
|
|
n,& !< element number
|
|
|
|
nn,& !< integration point number
|
|
|
|
kcus,& !< (1) layer number, (2) internal layer number
|
|
|
|
matus,& !< (1) user material identification number, (2) internal material identification number
|
|
|
|
ndi,& !< number of direct components
|
|
|
|
nshear,& !< number of shear components
|
|
|
|
disp,& !< incremental displacements
|
|
|
|
dispt,& !< displacements at t=n (at assembly, lovl=4) and displacements at t=n+1 (at stress recovery, lovl=6)
|
|
|
|
coord,& !< coordinates
|
|
|
|
ffn,& !< deformation gradient
|
|
|
|
frotn,& !< rotation tensor
|
|
|
|
strechn,& !< square of principal stretch ratios, lambda(i)
|
|
|
|
eigvn,& !< i principal direction components for j eigenvalues
|
|
|
|
ffn1,& !< deformation gradient
|
|
|
|
frotn1,& !< rotation tensor
|
|
|
|
strechn1,& !< square of principal stretch ratios, lambda(i)
|
|
|
|
eigvn1,& !< i principal direction components for j eigenvalues
|
|
|
|
ncrd,& !< number of coordinates
|
|
|
|
itel,& !< dimension of F and R, either 2 or 3
|
|
|
|
ndeg,& !< number of degrees of freedom ==> is this at correct list position ?!?
|
|
|
|
ndm,& !<
|
|
|
|
nnode,& !< number of nodes per element
|
|
|
|
jtype,& !< element type
|
|
|
|
lclass,& !< element class
|
|
|
|
ifr,& !< set to 1 if R has been calculated
|
|
|
|
ifu & !< set to 1 if stretch has been calculated
|
2009-05-07 21:57:36 +05:30
|
|
|
)
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
use prec, only: pReal, &
|
|
|
|
pInt
|
2012-11-14 20:08:10 +05:30
|
|
|
use numerics, only: numerics_unitlength
|
2009-06-15 18:41:21 +05:30
|
|
|
use FEsolving, only: cycleCounter, &
|
|
|
|
theInc, &
|
2009-10-12 21:31:49 +05:30
|
|
|
calcMode, &
|
|
|
|
lastMode, &
|
2009-06-15 18:41:21 +05:30
|
|
|
theTime, &
|
2009-10-12 21:31:49 +05:30
|
|
|
theDelta, &
|
2009-06-15 18:41:21 +05:30
|
|
|
lastIncConverged, &
|
|
|
|
outdatedByNewInc, &
|
|
|
|
outdatedFFN1, &
|
2009-08-12 13:40:28 +05:30
|
|
|
terminallyIll, &
|
2009-06-15 18:41:21 +05:30
|
|
|
symmetricSolver
|
|
|
|
use math, only: invnrmMandel
|
|
|
|
use debug, only: debug_info, &
|
|
|
|
debug_reset
|
2012-11-14 20:08:10 +05:30
|
|
|
use mesh, only: mesh_FEasCP, &
|
|
|
|
mesh_element, &
|
|
|
|
mesh_node0, &
|
|
|
|
mesh_node, &
|
|
|
|
mesh_build_subNodeCoords, &
|
|
|
|
mesh_build_ipCoordinates, &
|
2012-11-16 04:15:20 +05:30
|
|
|
FE_Nnodes, &
|
|
|
|
FE_geomtype
|
2013-03-01 17:18:29 +05:30
|
|
|
use CPFEM, only: &
|
|
|
|
CPFEM_general, &
|
|
|
|
CPFEM_init_done, &
|
|
|
|
CPFEM_initAll, &
|
|
|
|
CPFEM_CALCRESULTS, &
|
|
|
|
CPFEM_AGERESULTS, &
|
|
|
|
CPFEM_COLLECT, &
|
|
|
|
CPFEM_RESTOREJACOBIAN, &
|
|
|
|
CPFEM_BACKUPJACOBIAN
|
|
|
|
|
2011-05-28 15:12:25 +05:30
|
|
|
!$ use numerics, only: DAMASK_NumThreadsInt ! number of threads set by DAMASK_NUM_THREADS
|
2009-03-04 17:18:54 +05:30
|
|
|
|
2012-06-12 15:14:05 +05:30
|
|
|
implicit none
|
2012-06-15 21:40:21 +05:30
|
|
|
!$ include "omp_lib.h" ! the openMP function library
|
2009-03-04 17:18:54 +05:30
|
|
|
! ** Start of generated type statements **
|
|
|
|
real(pReal) coord, d, de, disp, dispt, dt, e, eigvn, eigvn1, ffn, ffn1
|
|
|
|
real(pReal) frotn, frotn1, g
|
|
|
|
integer(pInt) ifr, ifu, itel, jtype, kcus, lclass, matus, n, ncrd, ndeg
|
|
|
|
integer(pInt) ndi, ndm, ngens, nn, nnode, nshear
|
|
|
|
real(pReal) s, strechn, strechn1, t
|
2012-10-02 18:16:58 +05:30
|
|
|
logical :: cutBack
|
2009-03-04 17:18:54 +05:30
|
|
|
! ** End of generated type statements **
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2008-03-15 03:02:57 +05:30
|
|
|
dimension e(*),de(*),t(*),dt(*),g(*),d(ngens,*),s(*), n(2),coord(ncrd,*),disp(ndeg,*),matus(2),dispt(ndeg,*),ffn(itel,*),&
|
2009-04-22 19:51:18 +05:30
|
|
|
frotn(itel,*),strechn(itel),eigvn(itel,*),ffn1(itel,*),frotn1(itel,*),strechn1(itel),eigvn1(itel,*),kcus(2), lclass(2)
|
2008-03-15 03:02:57 +05:30
|
|
|
|
2009-03-04 17:18:54 +05:30
|
|
|
! Marc common blocks are in fixed format so they have to be reformated to free format (f90)
|
|
|
|
! Beware of changes in newer Marc versions
|
|
|
|
|
2011-05-11 22:10:51 +05:30
|
|
|
include "include/concom%%MARCVERSION%%" ! concom is needed for inc, subinc, ncycle, lovl
|
|
|
|
include "include/creeps%%MARCVERSION%%" ! creeps is needed for timinc (time increment)
|
2007-10-16 18:52:39 +05:30
|
|
|
|
2010-02-18 15:53:02 +05:30
|
|
|
real(pReal), dimension(6) :: stress
|
|
|
|
real(pReal), dimension(6,6) :: ddsdde
|
2010-07-07 15:28:18 +05:30
|
|
|
|
2010-11-04 23:45:50 +05:30
|
|
|
real(pReal), dimension (3,3) :: pstress ! dummy argument for call of cpfem_general (used by mpie_spectral)
|
|
|
|
real(pReal), dimension (3,3,3,3) :: dPdF ! dummy argument for call of cpfem_general (used by mpie_spectral)
|
2010-02-18 15:53:02 +05:30
|
|
|
|
2012-11-14 20:08:10 +05:30
|
|
|
integer(pInt) computationMode, i, cp_en
|
|
|
|
integer(pInt) node, FEnodeID
|
2011-02-08 15:55:51 +05:30
|
|
|
|
2010-12-02 16:34:29 +05:30
|
|
|
! OpenMP variable
|
openmp parallelization working again (at least for j2 and nonlocal constitutive model).
In order to keep it like that, please follow these simple rules:
DON'T use implicit array subscripts:
example: real, dimension(3,3) :: A,B
A(:,2) = B(:,1) <--- DON'T USE
A(1:3,2) = B(1:3,1) <--- BETTER USE
In many cases the use of explicit array subscripts is inevitable for parallelization. Additionally, it is an easy means to prevent memory leaks.
Enclose all write statements with the following:
!$OMP CRITICAL (write2out)
<your write statement>
!$OMP END CRITICAL (write2out)
Whenever you change something in the code and are not sure if it affects parallelization and leads to nonconforming behavior, please ask me and/or Franz to check this.
2011-03-17 16:16:17 +05:30
|
|
|
!$ integer(pInt) defaultNumThreadsInt ! default value set by Marc
|
2010-11-19 23:15:27 +05:30
|
|
|
|
|
|
|
|
openmp parallelization working again (at least for j2 and nonlocal constitutive model).
In order to keep it like that, please follow these simple rules:
DON'T use implicit array subscripts:
example: real, dimension(3,3) :: A,B
A(:,2) = B(:,1) <--- DON'T USE
A(1:3,2) = B(1:3,1) <--- BETTER USE
In many cases the use of explicit array subscripts is inevitable for parallelization. Additionally, it is an easy means to prevent memory leaks.
Enclose all write statements with the following:
!$OMP CRITICAL (write2out)
<your write statement>
!$OMP END CRITICAL (write2out)
Whenever you change something in the code and are not sure if it affects parallelization and leads to nonconforming behavior, please ask me and/or Franz to check this.
2011-03-17 16:16:17 +05:30
|
|
|
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
|
2010-12-02 16:34:29 +05:30
|
|
|
|
2010-11-03 20:09:18 +05:30
|
|
|
if (.not. CPFEM_init_done) call CPFEM_initAll(t(1),n(1),nn)
|
2009-10-12 21:31:49 +05:30
|
|
|
|
2011-05-28 15:12:25 +05:30
|
|
|
!$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
|
2010-12-02 16:34:29 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
if (lovl == 4 ) then
|
|
|
|
if(timinc < theDelta .and. theInc == inc ) & ! first after cutback
|
|
|
|
computationMode = CPFEM_RESTOREJACOBIAN
|
2010-11-03 20:09:18 +05:30
|
|
|
else ! stress requested (lovl == 6)
|
2011-03-17 18:43:13 +05:30
|
|
|
cp_en = mesh_FEasCP('elem',n(1))
|
2010-11-04 23:45:50 +05:30
|
|
|
if (cptim > theTime .or. inc /= theInc) then ! reached "convergence"
|
2009-08-11 22:01:57 +05:30
|
|
|
terminallyIll = .false.
|
2010-11-04 23:45:50 +05:30
|
|
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
|
|
|
if (inc == 0) then ! >> start of analysis <<
|
2010-11-03 20:09:18 +05:30
|
|
|
lastIncConverged = .false. ! no Jacobian backup
|
|
|
|
outdatedByNewInc = .false. ! no aging of state
|
|
|
|
lastMode = .false. ! pretend last step was collection
|
|
|
|
calcMode = .false. ! pretend last step was collection
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-10-02 18:16:58 +05:30
|
|
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> start of analysis..! ',n(1),nn
|
2012-11-06 21:20:20 +05:30
|
|
|
flush(6)
|
2010-11-03 20:09:18 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
2010-11-04 23:45:50 +05:30
|
|
|
else if (inc - theInc > 1) then ! >> restart of broken analysis <<
|
2010-11-03 20:09:18 +05:30
|
|
|
lastIncConverged = .false. ! no Jacobian backup
|
|
|
|
outdatedByNewInc = .false. ! no aging of state
|
|
|
|
lastMode = .true. ! pretend last step was calculation
|
|
|
|
calcMode = .true. ! pretend last step was calculation
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-10-02 18:16:58 +05:30
|
|
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> restart of analysis..! ',n(1),nn
|
2012-11-06 21:20:20 +05:30
|
|
|
flush(6)
|
2010-11-03 20:09:18 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
2010-11-04 23:45:50 +05:30
|
|
|
else ! >> just the next inc <<
|
|
|
|
lastIncConverged = .true. ! request Jacobian backup
|
|
|
|
outdatedByNewInc = .true. ! request aging of state
|
2010-11-03 20:09:18 +05:30
|
|
|
lastMode = .true. ! assure last step was calculation
|
|
|
|
calcMode = .true. ! assure last step was calculation
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-10-02 18:16:58 +05:30
|
|
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> new increment..! ',n(1),nn
|
2012-11-06 21:20:20 +05:30
|
|
|
flush(6)
|
2010-11-03 20:09:18 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
endif
|
2010-11-04 23:45:50 +05:30
|
|
|
else if ( timinc < theDelta ) then ! >> cutBack <<
|
2009-10-12 21:31:49 +05:30
|
|
|
terminallyIll = .false.
|
2010-11-04 23:45:50 +05:30
|
|
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
2010-11-03 20:09:18 +05:30
|
|
|
calcMode = .true. ! pretend last step was calculation
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-02-02 01:50:05 +05:30
|
|
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> cutback detected..! ',n(1),nn
|
2012-11-06 21:20:20 +05:30
|
|
|
flush(6)
|
2010-11-03 20:09:18 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
endif ! convergence treatment end
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
calcMode(nn,cp_en) = .not. calcMode(nn,cp_en) ! ping pong (calc <--> collect)
|
|
|
|
|
2010-09-02 02:34:02 +05:30
|
|
|
if ( calcMode(nn,cp_en) ) then ! now --- CALC ---
|
2010-11-03 20:09:18 +05:30
|
|
|
if ( lastMode /= calcMode(nn,cp_en) ) then ! first after ping pong
|
2009-10-12 21:31:49 +05:30
|
|
|
call debug_reset() ! resets debugging
|
2010-09-02 02:34:02 +05:30
|
|
|
outdatedFFN1 = .false.
|
2010-11-04 23:45:50 +05:30
|
|
|
cycleCounter = cycleCounter + 1_pInt
|
2012-11-15 18:01:39 +05:30
|
|
|
call mesh_build_subNodeCoords() ! update subnodal coordinates
|
|
|
|
call mesh_build_ipCoordinates() ! update ip coordinates
|
2009-10-12 21:31:49 +05:30
|
|
|
endif
|
|
|
|
if ( outdatedByNewInc ) then
|
2013-03-01 17:18:29 +05:30
|
|
|
computationMode = ior(CPFEM_CALCRESULTS,CPFEM_AGERESULTS)
|
2010-11-04 23:45:50 +05:30
|
|
|
outdatedByNewInc = .false. ! reset flag
|
2009-10-12 21:31:49 +05:30
|
|
|
else
|
2013-03-01 17:18:29 +05:30
|
|
|
computationMode = CPFEM_CALCRESULTS
|
2009-10-12 21:31:49 +05:30
|
|
|
endif
|
2010-09-02 02:34:02 +05:30
|
|
|
else ! now --- COLLECT ---
|
2010-11-03 20:09:18 +05:30
|
|
|
if ( lastMode /= calcMode(nn,cp_en) .and. &
|
2011-02-08 15:55:51 +05:30
|
|
|
.not. terminallyIll ) then
|
|
|
|
call debug_info() ! first after ping pong reports (meaningful) debugging
|
|
|
|
endif
|
2009-10-12 21:31:49 +05:30
|
|
|
if ( lastIncConverged ) then
|
2013-03-01 17:18:29 +05:30
|
|
|
computationMode = ior(CPFEM_COLLECT,CPFEM_BACKUPJACOBIAN) ! collect and backup Jacobian after convergence
|
2010-11-04 23:45:50 +05:30
|
|
|
lastIncConverged = .false. ! reset flag
|
2009-10-12 21:31:49 +05:30
|
|
|
else
|
2013-03-01 17:18:29 +05:30
|
|
|
computationMode = CPFEM_COLLECT ! plain collect
|
2009-10-12 21:31:49 +05:30
|
|
|
endif
|
2012-11-16 04:15:20 +05:30
|
|
|
do node = 1,FE_Nnodes(FE_geomtype(mesh_element(2,cp_en)))
|
2012-11-14 20:08:10 +05:30
|
|
|
FEnodeID = mesh_FEasCP('node',mesh_element(4+node,cp_en))
|
|
|
|
mesh_node(1:3,FEnodeID) = mesh_node0(1:3,FEnodeID) + numerics_unitlength * dispt(1:3,node)
|
|
|
|
enddo
|
2008-07-14 20:08:19 +05:30
|
|
|
endif
|
2008-03-15 03:02:57 +05:30
|
|
|
|
2009-10-12 21:31:49 +05:30
|
|
|
theTime = cptim ! record current starting time
|
|
|
|
theDelta = timinc ! record current time increment
|
|
|
|
theInc = inc ! record current increment number
|
2009-10-19 18:16:02 +05:30
|
|
|
lastMode = calcMode(nn,cp_en) ! record calculationMode
|
2009-10-12 21:31:49 +05:30
|
|
|
endif
|
2008-02-19 00:19:06 +05:30
|
|
|
|
2012-11-14 20:08:10 +05:30
|
|
|
call CPFEM_general(computationMode,ffn,ffn1,t(1),timinc,n(1),nn,stress,ddsdde, pstress, dPdF)
|
2008-02-19 00:19:06 +05:30
|
|
|
|
|
|
|
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
|
|
|
! Marc: 11, 22, 33, 12, 23, 13
|
2010-02-18 15:53:02 +05:30
|
|
|
! Marc: 11, 22, 33, 12
|
|
|
|
|
|
|
|
forall(i=1:ngens) d(1:ngens,i) = invnrmMandel(i)*ddsdde(1:ngens,i)*invnrmMandel(1:ngens)
|
|
|
|
s(1:ngens) = stress(1:ngens)*invnrmMandel(1:ngens)
|
2008-09-22 14:06:51 +05:30
|
|
|
if(symmetricSolver) d(1:ngens,1:ngens) = 0.5_pReal*(d(1:ngens,1:ngens)+transpose(d(1:ngens,1:ngens)))
|
2011-02-08 15:55:51 +05:30
|
|
|
|
2010-12-02 16:34:29 +05:30
|
|
|
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
|
2010-11-19 23:15:27 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end subroutine hypela2
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2008-04-07 20:24:29 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief sets user defined output variables for Marc
|
|
|
|
!> @details select a variable contour plotting (user subroutine).
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2009-05-07 21:57:36 +05:30
|
|
|
subroutine plotv(&
|
2013-03-01 17:18:29 +05:30
|
|
|
v,& !< variable
|
|
|
|
s,& !< stress array
|
|
|
|
sp,& !< stresses in preferred direction
|
|
|
|
etot,& !< total strain (generalized)
|
|
|
|
eplas,& !< total plastic strain
|
|
|
|
ecreep,& !< total creep strain
|
|
|
|
t,& !< current temperature
|
|
|
|
m,& !< element number
|
|
|
|
nn,& !< integration point number
|
|
|
|
layer,& !< layer number
|
|
|
|
ndi,& !< number of direct stress components
|
|
|
|
nshear,& !< number of shear stress components
|
|
|
|
jpltcd & !< user variable index
|
2009-05-07 21:57:36 +05:30
|
|
|
)
|
2007-10-16 18:52:39 +05:30
|
|
|
use prec, only: pReal,pInt
|
|
|
|
use mesh, only: mesh_FEasCP
|
2011-05-04 21:32:18 +05:30
|
|
|
use IO, only: IO_error
|
|
|
|
use homogenization, only: materialpoint_results,materialpoint_sizeResults
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2007-03-22 17:39:37 +05:30
|
|
|
implicit none
|
|
|
|
real(pReal) s(*),etot(*),eplas(*),ecreep(*),sp(*)
|
|
|
|
real(pReal) v, t(*)
|
2007-10-16 18:52:39 +05:30
|
|
|
integer(pInt) m, nn, layer, ndi, nshear, jpltcd
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
if (jpltcd > materialpoint_sizeResults) call IO_error(700_pInt,jpltcd) ! complain about out of bounds error
|
2011-05-04 21:32:18 +05:30
|
|
|
|
2009-05-07 21:57:36 +05:30
|
|
|
v = materialpoint_results(jpltcd,nn,mesh_FEasCP('elem', m))
|
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end subroutine plotv
|