changed all remaining routines in f2py to more clever determination of array size (requires f2py >= 2.0)
enabled 3D visualize to work with odd resolution by switching to linear reconstruction
PLEASE NOTE: Redefinition of routines for f2py might cause trouble -> DELETE DAMASK_ROOT/lib/damask/core.so in this case
further changes: added pure statement where possible, polished, unified use of "Q" for "Quaternion" and reordered math to have similar routines together
introduced 'isotropic' and 'orthorhombic' lattice types to use corresponding symmetries in stiffness tensor. intended to be used with non-crystal plasticity models (j2, constitutive_none with isotropic, cubic or orthotropic elasticity).
saves to copy same geometry description for different elements that are essentially similar regarding the IP number but differ in total node count.
introduced quadratic tetrahedron (Marc element 127 -- element 157 might also work, but did not perform well in fully elastic calc so far)
fixed bug in the adaptive Euler integrator and the RK4 integrator, which could not reach the stateJump function, because of erroneous check for converged flag; also corrected the state counter for the RK4 integrator
added some OMP FLUSH statements were necessary
replaced openmp do by forall construct where possible; this is much safer and perhaps even as fast for small loops
Removed "leapfrogging" (increase of step for next guess, when last guess was ok); Replaced Armijo rule testing for step size by simple check if the residuum got better, since the former virtually did not have any effect; consistently using the 2-norm of the residuum rather than infinity-norm for the convergence check throughout the function
new function in IO to print integers without leading zeros, implemented it at some places in the new spectral solver (reporting still needs some serious polishing)
updated preprocessing for documentation to handle precision correctly
also introduced check for inversion into DAMASK_spectral_Utilities.f90 for the stress BC calculation. This part is further improved by using 5% of the reference stiffness to avoid trouble in the fully plastic regime (where the stiffness is underestimated)
Test for Marc 2010 is updated because the new inversion give slightly different results near 0 (order of e-13)
when winding forward to last substep in increment, also do the calculation if this substep is below "subStepMinCryst";
output of "wind forward" and "cutback" info only for crystallites that are still "todo"
integrateStress:
maximum component in Lp determines absolute convergence criterium:
aTol = max(maxLpComp * rTol_fromConfig , aTol_fromConfig)
this ensures that small values in Lp do not spoil the convergence, similar to the effect of the relevantStrain parameter before (not needed anymore in the stress integration)
removed cut_off parameter for damask_spectral
removed outpot of derived divergence measures and added RMS output in brackets
added comments and options to the makefile
added compiler switches for gfortran and ifort to check for standard conformity
old gnu compilers <4.4 are not longer supported because they don't provide the c binding for fftw
renamed some math functions, so that we have a universal naming scheme: for matrix multiplications use an "x" (e.g. math_mul33x3); don't use the "x" to describe the shape of the tensor that the function is applied to (e.g. math_invert33 instead of math_invert3x3)
-removed to long lines
-restructured f2py modules and merged make_DAMASK2Python into setup processing
-setup_code.py now sets library path in makefile and asks for compile switches for spectral code
-substituted \ in format strings with $
restructured DAMASK_spectral:
-more logical output and structure of code
-better input for spectral debug parameters
- removed unnecessary "return" before end of subroutine or function:
- changed undetermined array length (:) to (1:3)
To prevent problems with some code analysing tools:
- "3D oneliner loops" (with ";) only for "do" and "enddo" at the same time
- removed line continuation in OMP statements
made the makefile more flexible, removed heap-arrays switch
* replaced "dble" intrinsic function by "real" with pReal kind in constitutive_nonlocal.f90
* removed useless line breaks in output of state in CPFEM.f90
* Also added some more openmp directives to increase percentage of parallelized code.
* "implicit none" was missing in two subroutines of homogenization and constitutive.
0 : only version infos and all from "hypela2"/"umat"
1 : basic outputs from "CPFEM.f90", basic output from initialization routines, debug_info
2 : extensive outputs from "CPFEM.f90", extensive output from initialization routines
3 : basic outputs from "homogenization.f90"
4 : extensive outputs from "homogenization.f90"
5 : basic outputs from "crystallite.f90"
6 : extensive outputs from "crystallite.f90"
7 : basic outputs from the constitutive files
8 : extensive outputs from the constitutive files
If verbosity is equal to zero, all counters in debug are not set during calculation (e.g. debug_StressLoopDistribution or debug_cumDotStateTicks). This might speed up parallel calculation, because all these need critical statements which extremely slow down parallel computation.
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.
* removed input variables in constitutive_collectDotState and constitutive_postResults that are not needed anymore (because of recent changes in constitutive_nonlocal)
* better use SINGLE (having an implicit barrier at the end) instead of MASTER construct
* deleted all explicit BARRIERs after do loops since parallel loop construct implies barrier at the end
* had to add some BARRIER constructs
* only the master thread is allowed to increase the state counter
yet parallelization seems not to give a significant decrease in calculation time with nonlocal model (because of too many CRITICAL statements?)
* also put a call to constitutive_microstructure at the start of each crystallite_integration subroutine like it was before. need that for nonlocal model in case of crystallite cutback
numerics: polishing
mpie_cpfem_marc: polishing
..powerlaw: aware of symmetryType function
crystallite: aware of symmetryType function, smaller leapfrog acceleration
IO: new warning 101
CPFEM: range of odd stress is now -1e15...+1e15, H_sym is used for stiffness
* in Fixed Point Iteration: update dependent states after state preguess was missing; on the other hand, the first call to constitutive_microstructure was obsolete
* now remembering stiffness similar to how we do it for Lp etc.; avoids undefined stiffness values for nonconverged stiffness calculation
* non-local stuff:
* changed non-local kinetics (Gilman2002)
* enforce zero shearrate for overall carrrier density below relevant density
* enforce zero density for those states that become negative and were below relevant density before
* dislocation velocity is not limited by V^(1/3) / dt anymore
2) local stiffness calculation is now standard for non-local grains
3) stressLoopDistribution discriminates between (a) central solution and (b) stiffness perturbation
4) debugger is switched on as standard... (but verboseDebugger not!)
rather perturb all components at once (and optionally decrease the frequency of the Jacobian update with the iJaco parameter) than perturbing only a single component per cycle
- grainrotation calculation now is done with symmetryID 0, i.e. without symmetry reduction since we want the absolute misorientation.
- While math has everything in radians, post results eulerangles and axisangle are given in degrees.
And: grain rotation seems OK after the previous changes in math module.
beware that crystallite output "orientation" now by default returns the orientation as quaternion. if you want euler angles instead, you have to add "eulerangles" as a crystallite output in your material.config file (see material.config template).
for input of orientations in the texture block of the material.config you still have to specify the rotation in terms of euler angles, quaternions are not yet supported for input.
- nonlocal stiffness calculation: we perturb all material points at the same time, so instead of N^2 loops we just need N
- set "forceLocalStiffnessCalculation" to false as standard
--> new "crystallite" part in config file
--> new "crystallite" option for microstructures
--> new output file "...job.outputCrystallite" to be used in conjunction with marc_addUserOutput for meaningful naming of User Defined Vars.
- reworked contribution of immobile dislocation density for rate equations
- flux is now calculated on the basis of interpolated velocities and densities at the interface; both incoming and outgoing fluxes are considered, so every material point only changes his own dotState
- dislocation velocity is now globally defined and calculated by subroutine constitutive_nonlocal_kinetics; the subroutine is called inside _LpAndItsTangent as well as _microstructure; therefore, microstructure now needs Tstar_v as additional input; in the future one should perhaps create a subroutine constitutive_kinetics that calls constitutive_nonlocal_kinetics separately, to clearly distinguish between microstructural and kinetic variables
- better use flux density vector as output variable instead of scalar flux values for each interface
- added output variables internal and external resolved stress
crystallite:
- added flag to force local stiffness calculation in case of nonlocal model
- misorientation angle is explicitly set to zero when no neighbor can be found
debug:
- added flag "selectiveDebugger" that is used when debugging statements should only affect a specific element, ip and grain; these are specified with the new variables debug_e, debug_i and debug_g
- debugger can now be used in its original sense
The calculation of the misorientation is now done once in crystallite init and at the end of every FE increment. This saves a lot of time compared to doing it in dotState for every crystallite subinc.
- corrected flux term
- multiplication is now aware of dislocation type
- corrected change rate for "dipole size" dupper
- corrected term for dipole dissociation by stress change
- added transmissivity term in fluxes which accounts for misorientation between two neighboring grains (yet hardcoded transmissivity according to misorientation angle)
- added more output variables
constitutive:
- 2 additional variables "previousDotState" and "previousDotState2", which are used to store the previous and second previous dotState (used in crystallite for acceleration/stabilization of state integration)
- timer for dotState now measures the time for calls to constitutive_ collectState (used to reside in crystallite_updateState, which is not critical in terms of calculation time anymore)
crystallite:
- convergence check for nonlocal elments is now done at end of crystallite loop, not at the beginning; we simple set all elements to not converged if there is at least one nonlocal element that did not converge
- need call to microstructure before first call to collect dotState for dependent states
- stiffness calculation (jacobian): if there are nonlocal elements, we also have to consider changes in our neighborhood's states; so for every perturbed component in a single ip, we have to loop over all elements; since this is extremely time-consuming, we just perturb one component per cycle, starting with the one that changes the most during regular time step.
- updateState gets a damping prefactor for our dotState that helps to improve convergence; prefactor is calculated according to change of dotState
IO:
- additional warning message for unknown crystal symmetry
(1) subStepSizeHomog and subStepSizeCryst := size of substep when cut-back is applied (initially was hard-coded).
(2) stepIncreaseHomog and stepIncreaseCryst := step increase when calculation for substep converge (was also hardcoded).
introduced a possibility to choose different finite difference scheme, i.e., forward-, backward- and central-difference, for computing grain numerical tangent. note that central-difference scheme will slow down the computation significantly. please use it only if necessary.
parameters to set these new features have been included in numerics.f90 and numerics.config, whereas corresponding error messages have been introduced in the IO.f90
- read in activation energy for dislocation glide from material.config
- changed naming of dDipMin/Max to dLower/dUpper
- added new outputs: rho_dot, rho_dot_dip, rho_dot_gen, rho_dot_sgl2dip, rho_dot_dip2sgl, rho_dot_ann_ath, rho_dot_ann_the, rho_dot_flux, d_upper_edge, d_upper_screw, d_upper_dot_edge, d_upper_dot_screw
- poisson's ratio is now calculated from elastic constants
- microstrucutre has state as first argument, since this is our output variable
- periodic boundary conditions are taken into account for fluxes and internal stresses. for the moment, flag has to be set in constitutive_nonlocal.
- corrected calculation for dipole formation by glide
- added terms for dipole formation/annihilation by stress decrease/increase
constitutive:
- passing of arguments is adapted for constitutive_nonlocal model
crystallite:
- in stiffness calculation: call to collect_dotState used wrong arguments
- crystallite_postResults uses own Tstar_v and temperature, no need for passing them from materialpoint_postResults
homogenization:
- crystallite_postResults uses own Tstar_v and temperature, no need for passing them from materialpoint_postResults
IO:
- changed error message 229
material.config:
- changed example for nonlocal constitution according to constitutive_nonlocal
all:
- added some flush statements
crystallite does not accelerate anymore, since, typically, longer step immediately fails and uses resources in vain. (future: remember number of successful steps to increase step size after x of those...)
- take orientation gradients into account when calculating dislocation stress and dislocation fluxes
- hard coded value for nu
- changed kinetics (parameter G0 is currently defined as a parameter, needs to be read from material.config)
- added some output statements
constitutive:
- some functions and subroutines needed additional input variables for passing to constitutive_nonlocal
crystallite:
- some functions and subroutines needed additional input variables for passing to constitutive
- call microstructure with current temperature, Fp, Fe, not "sub0" values
- show number of IPs, that are "onTrack" instead of those not "onTrack"
- calculate Fe at beginning of substep, since we need it for state preguess
(state < relevant state) or (residuum < relative tolerance * state)
since the relevant value for the state variables depend on their nature and can vary by large scales (e.g. volume fraction: 1e-10, dislocation density: 1e5) it is not possible to set a unique value. instead the constitutive law has to decide what is relevant. therefore, all constitutive laws now read in parameters from the material.config that determine the values for relevantState [@luc: in dislobased law relevant State is for the moment generally set to 1e-200, so no additional parameters necessary in material.config. if you also want this feature, we can still implement it, no big deal]
- added sanity checks in constitutive_nonlocal.f90
- corrected coordinate transformation for backstress calculation in constitutive_nonlocal.f90
- corrected equations for evolution of dipole dislocation densities (athermal annihilation and formation by glide)
homogenization.f90 and crystallite.f90 >>> Correction in the algorithm to count the iteration distribution (for better statistics).
material.config and numerics.config >>> more collection of parameters.
- dipole dislocations with evolution
crystallite.f90:
- collect state uses subdt and subTstar0_v
- in nonlocal modus: set all crystallites to broken if one is not on track anymore after either stress integration or state update
- constitutive_microstructure is now called inside state update and not in integrate_stress anymore
material.config:
- new parameter for nonlocal constitution
CPFEM.f90:
- age Tstar after increment was finished
constitutive_phenopowerlaw.f90 >>> adding new parameter: constitutive_phenopowerlaw_w0_slip, i.e., the hardening rate exponent.
homogenization.f90 >>> most important change is to add an if-else statement (line 379-380) to switch crystallite_requeted = .false. for already converged material point iteration (el/ip). the rest of the changes are cosmetics and debugging stuffs.
crystallite.f90 >>> similar to homogenization.f90, the most important change is to add additional if-else statement (line 574) in the jacobian (perturbation) loop. now the jacobian calculation will only be performed when crystallite_requested = .true.. the rest is only cosmetic.
- completed postResults output function
- connecting vector of neighboring material points is mapped to intermediate configuration of my neighbor
crystallite.f90
- zero out dotState only when crystallite is non-finished
- set nonfinished flag to false if crystallite is not on Track after state update
- in updateState: set onTrack flag to false if encounter NaN
- removed some old debugging outputs and added others
homogenization.f90
- in debugging mode now telling when a cutback happens
debugging memory leak closed
debugging counters corrected
center of gravity stored in mesh
state updated is now split into a collecting loop and an execution
updateState and updateTemperature fill sequentially separate logicals and evaluate afterwards to converged
added 3x3 transposition function, norm for 3x1 matrix and 33x3 matrix multiplication in math
non-converged crystallite triggers materialpoint cutback (used to respond elastically)
non-converged materialpoint raises terminal illness which in turn renders whole FE increment useless by means of odd stress/stiffness and thus waits for FE cutback
# non-greedy memory allocation
# generation of outputConstitutive to allow for script-based T16 extraction
# exchange of phenomenological by more general phenopowerlaw
# lattice is based on slip and twin families which can be treated as individual entities (switched on/off, separate hardening, etc.)
# nicer debugging output
# changed some error/warning codes
# plus potentially some minor additional brushes here and there