DAMASK with grid solvers  Revision: v2.0.3-2204-gdb1f2151
The Düsseldorf Advanced Material Simulation Kit with Grid Solvers
math Module Reference

Mathematical library, including random number generation and tensor representations. More...

Data Types

interface  math_eye
 

Functions/Subroutines

subroutine math_init
 initialization of random seed generator and internal checks More...
 
recursive subroutine math_sort (a, istart, iend, sortDim)
 Quicksort algorithm for two-dimensional integer arrays. More...
 
pure real(preal) function, dimension(sum(how)) math_expand (what, how)
 vector expansion More...
 
pure integer function, dimension(n) math_range (N)
 range of integers starting at one More...
 
pure real(preal) function, dimension(d, d) math_identity2nd (d)
 second rank identity tensor of specified dimension More...
 
pure real(preal) function, dimension(d, d, d, d) math_identity4th (d)
 symmetric fourth rank identity tensor of specified dimension More...
 
real(preal) pure function math_levicivita (i, j, k)
 permutation tensor e_ijk More...
 
real(preal) pure function math_delta (i, j)
 kronecker delta function d_ij More...
 
pure real(preal) function, dimension(3) math_cross (A, B)
 cross product a x b More...
 
pure real(preal) function, dimension(size(a, 1), size(b, 1)) math_outer (A, B)
 outer product of arbitrary sized vectors (A ⊗ B / i,j) More...
 
real(preal) pure function math_inner (A, B)
 inner product of arbitrary sized vectors (A · B / i,i) More...
 
real(preal) pure function math_tensordot (A, B)
 double contraction of 3x3 matrices (A : B / ij,ij) More...
 
pure real(preal) function, dimension(3, 3) math_mul3333xx33 (A, B)
 matrix double contraction 3333x33 = 33 (ijkl,kl) More...
 
pure real(preal) function, dimension(3, 3, 3, 3) math_mul3333xx3333 (A, B)
 matrix multiplication 3333x3333 = 3333 (ijkl,klmn) More...
 
pure real(preal) function, dimension(3, 3) math_exp33 (A, n)
 3x3 matrix exponential up to series approximation order n (default 5) More...
 
pure real(preal) function, dimension(3, 3) math_inv33 (A)
 Cramer inversion of 3x3 matrix (function) More...
 
pure subroutine math_invert33 (InvA, DetA, error, A)
 Cramer inversion of 3x3 matrix (subroutine) More...
 
real(preal) function, dimension(3, 3, 3, 3) math_invsym3333 (A)
 Inversion of symmetriced 3x3x3x3 matrix. More...
 
subroutine math_invert (InvA, error, A)
 invert quadratic matrix of arbitrary dimension More...
 
pure real(preal) function, dimension(3, 3) math_symmetric33 (m)
 symmetrize a 3x3 matrix More...
 
pure real(preal) function, dimension(6, 6) math_symmetric66 (m)
 symmetrize a 6x6 matrix More...
 
pure real(preal) function, dimension(3, 3) math_skew33 (m)
 skew part of a 3x3 matrix More...
 
pure real(preal) function, dimension(3, 3) math_spherical33 (m)
 hydrostatic part of a 3x3 matrix More...
 
pure real(preal) function, dimension(3, 3) math_deviatoric33 (m)
 deviatoric part of a 3x3 matrix More...
 
real(preal) pure function math_trace33 (m)
 trace of a 3x3 matrix More...
 
real(preal) pure function math_det33 (m)
 determinant of a 3x3 matrix More...
 
real(preal) pure function math_detsym33 (m)
 determinant of a symmetric 3x3 matrix More...
 
pure real(preal) function, dimension(9) math_33to9 (m33)
 convert 3x3 matrix into vector 9 More...
 
pure real(preal) function, dimension(3, 3) math_9to33 (v9)
 convert 9 vector into 3x3 matrix More...
 
pure real(preal) function, dimension(6) math_sym33to6 (m33, weighted)
 convert symmetric 3x3 matrix into 6 vector More...
 
pure real(preal) function, dimension(3, 3) math_6tosym33 (v6, weighted)
 convert 6 vector into symmetric 3x3 matrix More...
 
pure real(preal) function, dimension(9, 9) math_3333to99 (m3333)
 convert 3x3x3x3 matrix into 9x9 matrix More...
 
pure real(preal) function, dimension(3, 3, 3, 3) math_99to3333 (m99)
 convert 9x9 matrix into 3x3x3x3 matrix More...
 
pure real(preal) function, dimension(6, 6) math_sym3333to66 (m3333, weighted)
 convert symmetric 3x3x3x3 matrix into 6x6 matrix More...
 
pure real(preal) function, dimension(3, 3, 3, 3) math_66tosym3333 (m66, weighted)
 convert 66 matrix into symmetric 3x3x3x3 matrix More...
 
pure real(preal) function, dimension(3, 3, 3, 3) math_voigt66to3333 (m66)
 convert 66 Voigt matrix into symmetric 3x3x3x3 matrix More...
 
real(preal) function math_samplegaussvar (meanvalue, stddev, width)
 draw a random sample from Gauss variable More...
 
subroutine math_eigh (m, w, v, error)
 eigenvalues and eigenvectors of symmetric matrix More...
 
subroutine math_eigh33 (m, w, v)
 eigenvalues and eigenvectors of symmetric 3x3 matrix using an analytical expression and the general LAPACK powered version for arbritrary sized matrices as fallback More...
 
real(preal) function, dimension(3, 3) math_rotationalpart (m)
 rotational part from polar decomposition of 3x3 tensor More...
 
real(preal) function, dimension(size(m, 1)) math_eigvalsh (m)
 Eigenvalues of symmetric matrix. More...
 
real(preal) function, dimension(3) math_eigvalsh33 (m)
 eigenvalues of symmetric 3x3 matrix using an analytical expression More...
 
pure real(preal) function, dimension(3) math_invariantssym33 (m)
 invariants of symmetrix 3x3 matrix More...
 
integer pure function math_factorial (n)
 factorial More...
 
integer pure function math_binomial (n, k)
 binomial coefficient More...
 
integer pure function math_multinomial (alpha)
 multinomial coefficient More...
 
real(preal) pure function math_voltetrahedron (v1, v2, v3, v4)
 volume of tetrahedron given by four vertices More...
 
real(preal) pure function math_areatriangle (v1, v2, v3)
 area of triangle given by three vertices More...
 
real(preal) pure elemental function math_clip (a, left, right)
 limits a scalar value to a certain range (either one or two sided) More...
 
subroutine, private unittest
 check correctness of some math functions More...
 

Variables

real(preal), parameter pi = acos(-1.0_pReal)
 ratio of a circle's circumference to its diameter More...
 
real(preal), parameter indeg = 180.0_pReal/PI
 conversion from radian into degree More...
 
real(preal), parameter inrad = PI/180.0_pReal
 conversion from degree into radian More...
 
complex(preal), parameter twopiimg = cmplx(0.0_pReal, 2.0_pReal*PI)
 Re(0.0), Im(2xPi) More...
 
real(preal), dimension(3, 3), parameter math_i3 = reshape([ 1.0_pReal,0.0_pReal,0.0_pReal, 0.0_pReal,1.0_pReal,0.0_pReal, 0.0_pReal,0.0_pReal,1.0_pReal ], [3,3])
 3x3 Identity More...
 
real(preal), dimension(6), parameter, private nrmmandel = [ 1.0_pReal, 1.0_pReal, 1.0_pReal, sqrt(2.0_pReal), sqrt(2.0_pReal), sqrt(2.0_pReal) ]
 forward weighting for Mandel notation More...
 
real(preal), dimension(6), parameter, private invnrmmandel = 1.0_pReal/NRMMANDEL
 backward weighting for Mandel notation More...
 
integer, dimension(2, 6), parameter, private mapnye = reshape([ 1,1, 2,2, 3,3, 1,2, 2,3, 1,3 ], [2,6])
 arrangement in Nye notation. More...
 
integer, dimension(2, 6), parameter, private mapvoigt = reshape([ 1,1, 2,2, 3,3, 2,3, 1,3, 1,2 ], [2,6])
 arrangement in Voigt notation More...
 
integer, dimension(2, 9), parameter, private mapplain = reshape([ 1,1, 1,2, 1,3, 2,1, 2,2, 2,3, 3,1, 3,2, 3,3 ], [2,9])
 arrangement in Plain notation More...
 

Detailed Description

Mathematical library, including random number generation and tensor representations.

Author
Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH

Function/Subroutine Documentation

◆ math_3333to99()

pure real(preal) function, dimension(9,9) math::math_3333to99 ( real(preal), dimension(3,3,3,3), intent(in)  m3333)

convert 3x3x3x3 matrix into 9x9 matrix

Definition at line 741 of file math.f90.

References mapplain.

Referenced by crystallite::crystallite_stresstangent(), crystallite::integratestress(), unittest(), and spectral_utilities::utilities_maskedcompliance().

+ Here is the caller graph for this function:

◆ math_33to9()

pure real(preal) function, dimension(9) math::math_33to9 ( real(preal), dimension(3,3), intent(in)  m33)

convert 3x3 matrix into vector 9

Definition at line 650 of file math.f90.

References mapplain.

Referenced by crystallite::integratestress(), and unittest().

+ Here is the caller graph for this function:

◆ math_66tosym3333()

pure real(preal) function, dimension(3,3,3,3) math::math_66tosym3333 ( real(preal), dimension(6,6), intent(in)  m66,
logical, intent(in), optional  weighted 
)

convert 66 matrix into symmetric 3x3x3x3 matrix

Weighted conversion (default) rearranges according to Nye and weights shear

Parameters
[in]m666x6 matrix
[in]weightedweight according to Mandel (.true. by default)

Definition at line 806 of file math.f90.

References invnrmmandel, and mapnye.

Referenced by constitutive::constitutive_hooke_sanditstangents(), math_invsym3333(), rotations::rottensor4sym(), and unittest().

+ Here is the caller graph for this function:

◆ math_6tosym33()

pure real(preal) function, dimension(3,3) math::math_6tosym33 ( real(preal), dimension(6), intent(in)  v6,
logical, intent(in), optional  weighted 
)

convert 6 vector into symmetric 3x3 matrix

Weighted conversion (default) rearranges according to Nye and weights shear

Parameters
[in]v66 vector
[in]weightedweight according to Mandel (.true. by default)

Definition at line 715 of file math.f90.

References invnrmmandel, and mapnye.

Referenced by unittest().

+ Here is the caller graph for this function:

◆ math_99to3333()

pure real(preal) function, dimension(3,3,3,3) math::math_99to3333 ( real(preal), dimension(9,9), intent(in)  m99)

convert 9x9 matrix into 3x3x3x3 matrix

Definition at line 758 of file math.f90.

References mapplain.

Referenced by crystallite::crystallite_stresstangent(), unittest(), and spectral_utilities::utilities_maskedcompliance().

+ Here is the caller graph for this function:

◆ math_9to33()

pure real(preal) function, dimension(3,3) math::math_9to33 ( real(preal), dimension(9), intent(in)  v9)

convert 9 vector into 3x3 matrix

Definition at line 667 of file math.f90.

References mapplain.

Referenced by damask_spectral(), crystallite::integratestress(), and unittest().

+ Here is the caller graph for this function:

◆ math_areatriangle()

real(preal) pure function math::math_areatriangle ( real(preal), dimension (3), intent(in)  v1,
real(preal), dimension (3), intent(in)  v2,
real(preal), dimension (3), intent(in)  v3 
)

area of triangle given by three vertices

Definition at line 1184 of file math.f90.

References math_cross().

+ Here is the call graph for this function:

◆ math_binomial()

integer pure function math::math_binomial ( integer, intent(in)  n,
integer, intent(in)  k 
)

binomial coefficient

Definition at line 1132 of file math.f90.

Referenced by math_multinomial(), and unittest().

+ Here is the caller graph for this function:

◆ math_clip()

real(preal) pure elemental function math::math_clip ( real(preal), intent(in)  a,
real(preal), intent(in), optional  left,
real(preal), intent(in), optional  right 
)

limits a scalar value to a certain range (either one or two sided)

Definition at line 1197 of file math.f90.

Referenced by eigenvectorbasis(), lambert::lambert_balltocube(), math_eigvalsh33(), rotations::om2ax(), rotations::qu2ax(), rotations::qu2ho(), rotations::qu2ro(), and unittest().

+ Here is the caller graph for this function:

◆ math_cross()

pure real(preal) function, dimension(3) math::math_cross ( real(preal), dimension(3), intent(in)  A,
real(preal), dimension(3), intent(in)  B 
)

cross product a x b

Definition at line 312 of file math.f90.

Referenced by lattice::buildcoordinatesystem(), lattice::buildtransformationsystem(), lattice::lattice_nonschmidmatrix(), math_areatriangle(), math_eigh33(), and unittest().

+ Here is the caller graph for this function:

◆ math_delta()

real(preal) pure function math::math_delta ( integer, intent(in)  i,
integer, intent(in)  j 
)

kronecker delta function d_ij

Definition at line 300 of file math.f90.

◆ math_det33()

real(preal) pure function math::math_det33 ( real(preal), dimension(3,3), intent(in)  m)

determinant of a 3x3 matrix

Definition at line 623 of file math.f90.

Referenced by constitutive::constitutive_lianditstangents(), crystallite::crystallite_init(), rotations::frommatrix(), crystallite::integratestress(), math_voltetrahedron(), unittest(), spectral_utilities::utilities_fouriergammaconvolution(), and spectral_utilities::utilities_updategamma().

+ Here is the caller graph for this function:

◆ math_detsym33()

real(preal) pure function math::math_detsym33 ( real(preal), dimension(3,3), intent(in)  m)

determinant of a symmetric 3x3 matrix

Definition at line 637 of file math.f90.

Referenced by math_invariantssym33(), and unittest().

+ Here is the caller graph for this function:

◆ math_deviatoric33()

pure real(preal) function, dimension(3,3) math::math_deviatoric33 ( real(preal), dimension(3,3), intent(in)  m)

deviatoric part of a 3x3 matrix

Definition at line 598 of file math.f90.

References math_spherical33().

+ Here is the call graph for this function:

◆ math_eigh()

subroutine math::math_eigh ( real(preal), dimension(:,:), intent(in)  m,
real(preal), dimension(size(m,1)), intent(out)  w,
real(preal), dimension(size(m,1),size(m,1)), intent(out)  v,
logical, intent(out)  error 
)

eigenvalues and eigenvectors of symmetric matrix

Parameters
[in]mquadratic matrix to compute eigenvectors and values of
[out]weigenvalues
[out]veigenvectors

Definition at line 888 of file math.f90.

Referenced by math_eigh33().

+ Here is the caller graph for this function:

◆ math_eigh33()

subroutine math::math_eigh33 ( real(preal), dimension(3,3), intent(in)  m,
real(preal), dimension(3), intent(out)  w,
real(preal), dimension(3,3), intent(out)  v 
)

eigenvalues and eigenvectors of symmetric 3x3 matrix using an analytical expression and the general LAPACK powered version for arbritrary sized matrices as fallback

Author
Joachim Kopp, Max-Planck-Institut für Kernphysik, Heidelberg (Copyright (C) 2006)
Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH

See http://arxiv.org/abs/physics/0610206 (DSYEVH3)

Parameters
[in]m3x3 matrix to compute eigenvectors and values of
[out]weigenvalues
[out]veigenvectors

Definition at line 915 of file math.f90.

References math_cross(), math_eigh(), and math_eigvalsh33().

+ Here is the call graph for this function:

◆ math_eigvalsh()

real(preal) function, dimension(size(m,1)) math::math_eigvalsh ( real(preal), dimension(:,:), intent(in)  m)

Eigenvalues of symmetric matrix.

Parameters
[in]msymmetric matrix to compute eigenvalues of

Definition at line 1046 of file math.f90.

Referenced by math_eigvalsh33().

+ Here is the caller graph for this function:

◆ math_eigvalsh33()

real(preal) function, dimension(3) math::math_eigvalsh33 ( real(preal), dimension(3,3), intent(in)  m)

eigenvalues of symmetric 3x3 matrix using an analytical expression

Author
Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH

similar to http://arxiv.org/abs/physics/0610206 (DSYEVC3) but apparently more stable solution and has general LAPACK powered version for arbritrary sized matrices as fallback

Parameters
[in]m3x3 symmetric matrix to compute eigenvalues of

Definition at line 1071 of file math.f90.

References math_clip(), math_eigvalsh(), math_invariantssym33(), and pi.

Referenced by math_eigh33().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_exp33()

pure real(preal) function, dimension(3,3) math::math_exp33 ( real(preal), dimension(3,3), intent(in)  A,
integer, intent(in), optional  n 
)

3x3 matrix exponential up to series approximation order n (default 5)

Definition at line 402 of file math.f90.

References math_i3.

Referenced by unittest().

+ Here is the caller graph for this function:

◆ math_expand()

pure real(preal) function, dimension(sum(how)) math::math_expand ( real(preal), dimension(:), intent(in)  what,
integer, dimension(:), intent(in)  how 
)

vector expansion

takes a set of numbers (a,b,c,...) and corresponding multiples (x,y,z,...) to return a vector of x times a, y times b, z times c, ...

Definition at line 207 of file math.f90.

Referenced by kinematics_cleavage_opening::kinematics_cleavage_opening_init(), kinematics_slipplane_opening::kinematics_slipplane_opening_init(), source_damage_anisobrittle::source_damage_anisobrittle_init(), source_damage_anisoductile::source_damage_anisoductile_init(), and unittest().

+ Here is the caller graph for this function:

◆ math_factorial()

integer pure function math::math_factorial ( integer, intent(in)  n)

factorial

Definition at line 1120 of file math.f90.

References math_range().

Referenced by unittest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_identity2nd()

pure real(preal) function, dimension(d,d) math::math_identity2nd ( integer, intent(in)  d)

second rank identity tensor of specified dimension

Parameters
[in]dtensor dimension

Definition at line 240 of file math.f90.

Referenced by crystallite::crystallite_stresstangent(), crystallite::integratestress(), math_identity4th(), unittest(), and spectral_utilities::utilities_maskedcompliance().

+ Here is the caller graph for this function:

◆ math_identity4th()

pure real(preal) function, dimension(d,d,d,d) math::math_identity4th ( integer, intent(in)  d)

symmetric fourth rank identity tensor of specified dimension

Parameters
[in]dtensor dimension

Definition at line 258 of file math.f90.

References math_identity2nd().

+ Here is the call graph for this function:

◆ math_init()

subroutine math::math_init

initialization of random seed generator and internal checks

Definition at line 95 of file math.f90.

References numerics::randomseed, and io::unittest().

Referenced by cpfem2::cpfem_initall().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_inner()

real(preal) pure function math::math_inner ( real(preal), dimension(:), intent(in)  A,
real(preal), dimension(size(a,1)), intent(in)  B 
)

inner product of arbitrary sized vectors (A · B / i,i)

Definition at line 343 of file math.f90.

Referenced by lattice::slipprojection_direction(), and lattice::slipprojection_transverse().

+ Here is the caller graph for this function:

◆ math_inv33()

pure real(preal) function, dimension(3,3) math::math_inv33 ( real(preal), dimension(3,3), intent(in)  A)

Cramer inversion of 3x3 matrix (function)

Direct Cramer inversion of matrix A. Returns all zeroes if not possible, i.e.

Definition at line 435 of file math.f90.

References math_invert33().

Referenced by constitutive::constitutive_lianditstangents(), crystallite::crystallite_init(), crystallite::crystallite_push33toref(), crystallite::crystallite_stress(), crystallite::crystallite_stresstangent(), crystallite::integratestress(), math_rotationalpart(), and unittest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_invariantssym33()

pure real(preal) function, dimension(3) math::math_invariantssym33 ( real(preal), dimension(3,3), intent(in)  m)

invariants of symmetrix 3x3 matrix

Definition at line 1104 of file math.f90.

References math_detsym33(), and math_trace33().

Referenced by eigenvectorbasis(), and math_eigvalsh33().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_invert()

subroutine math::math_invert ( real(preal), dimension(size(a,1),size(a,1)), intent(out)  InvA,
logical, intent(out)  error,
real(preal), dimension(:,:), intent(in)  A 
)

invert quadratic matrix of arbitrary dimension

Definition at line 521 of file math.f90.

Referenced by crystallite::crystallite_stresstangent(), lattice::equivalent_mu(), lattice::equivalent_nu(), unittest(), spectral_utilities::utilities_fouriergammaconvolution(), spectral_utilities::utilities_maskedcompliance(), and spectral_utilities::utilities_updategamma().

+ Here is the caller graph for this function:

◆ math_invert33()

pure subroutine math::math_invert33 ( real(preal), dimension(3,3), intent(out)  InvA,
real(preal), intent(out)  DetA,
logical, intent(out)  error,
real(preal), dimension(3,3), intent(in)  A 
)

Cramer inversion of 3x3 matrix (subroutine)

Direct Cramer inversion of matrix A. Also returns determinant

Definition at line 454 of file math.f90.

Referenced by crystallite::integratestress(), math_inv33(), and unittest().

+ Here is the caller graph for this function:

◆ math_invsym3333()

real(preal) function, dimension(3,3,3,3) math::math_invsym3333 ( real(preal), dimension(3,3,3,3), intent(in)  A)

Inversion of symmetriced 3x3x3x3 matrix.

Definition at line 489 of file math.f90.

References math_66tosym3333(), and math_sym3333to66().

Referenced by grid_mech_spectral_polarisation::formresidual(), grid_mech_spectral_polarisation::grid_mech_spectral_polarisation_init(), and grid_mech_spectral_polarisation::grid_mech_spectral_polarisation_solution().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_levicivita()

real(preal) pure function math::math_levicivita ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  k 
)

permutation tensor e_ijk

Definition at line 280 of file math.f90.

Referenced by unittest().

+ Here is the caller graph for this function:

◆ math_mul3333xx33()

pure real(preal) function, dimension(3,3) math::math_mul3333xx33 ( real(preal), dimension(3,3,3,3), intent(in)  A,
real(preal), dimension(3,3), intent(in)  B 
)

matrix double contraction 3333x33 = 33 (ijkl,kl)

Definition at line 368 of file math.f90.

Referenced by constitutive::constitutive_hooke_sanditstangents(), grid_mech_spectral_basic::formresidual(), grid_mech_fem::formresidual(), grid_mech_spectral_polarisation::formresidual(), and grid_mech_spectral_polarisation::grid_mech_spectral_polarisation_forward().

+ Here is the caller graph for this function:

◆ math_mul3333xx3333()

pure real(preal) function, dimension(3,3,3,3) math::math_mul3333xx3333 ( real(preal), dimension(3,3,3,3), intent(in)  A,
real(preal), dimension(3,3,3,3), intent(in)  B 
)

matrix multiplication 3333x3333 = 3333 (ijkl,klmn)

Definition at line 385 of file math.f90.

Referenced by crystallite::crystallite_stresstangent(), and crystallite::integratestress().

+ Here is the caller graph for this function:

◆ math_multinomial()

integer pure function math::math_multinomial ( integer, dimension(:), intent(in)  alpha)

multinomial coefficient

Definition at line 1151 of file math.f90.

References math_binomial().

+ Here is the call graph for this function:

◆ math_outer()

pure real(preal) function, dimension(size(a,1),size(b,1)) math::math_outer ( real(preal), dimension(:), intent(in)  A,
real(preal), dimension(:), intent(in)  B 
)

outer product of arbitrary sized vectors (A ⊗ B / i,j)

Definition at line 327 of file math.f90.

Referenced by lattice::buildtransformationsystem(), kinematics_slipplane_opening::kinematics_slipplane_opening_init(), lattice::lattice_nonschmidmatrix(), lattice::lattice_schmidmatrix_cleavage(), lattice::lattice_schmidmatrix_slip(), and lattice::lattice_schmidmatrix_twin().

+ Here is the caller graph for this function:

◆ math_range()

pure integer function, dimension(n) math::math_range ( integer, intent(in)  N)

range of integers starting at one

Parameters
[in]nlength of range

Definition at line 226 of file math.f90.

Referenced by math_factorial(), and unittest().

+ Here is the caller graph for this function:

◆ math_rotationalpart()

real(preal) function, dimension(3,3) math::math_rotationalpart ( real(preal), dimension(3,3), intent(in)  m)

rotational part from polar decomposition of 3x3 tensor

Definition at line 962 of file math.f90.

References eigenvectorbasis(), math_i3, and math_inv33().

Referenced by crystallite::crystallite_orientations(), and unittest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_samplegaussvar()

real(preal) function math::math_samplegaussvar ( real(preal), intent(in)  meanvalue,
real(preal), intent(in)  stddev,
real(preal), intent(in), optional  width 
)

draw a random sample from Gauss variable

Parameters
[in]stddevstandard deviation of gauss distribution
[in]widthwidth of considered values as multiples of standard deviation
Parameters
meanvaluemeanvalue of gauss distribution

Definition at line 853 of file math.f90.

◆ math_skew33()

pure real(preal) function, dimension(3,3) math::math_skew33 ( real(preal), dimension(3,3), intent(in)  m)

skew part of a 3x3 matrix

Definition at line 572 of file math.f90.

References math_symmetric33().

+ Here is the call graph for this function:

◆ math_sort()

recursive subroutine math::math_sort ( integer, dimension(:,:), intent(inout)  a,
integer, intent(in), optional  istart,
integer, intent(in), optional  iend,
integer, intent(in), optional  sortDim 
)

Quicksort algorithm for two-dimensional integer arrays.

Definition at line 132 of file math.f90.

References qsort_partition().

Referenced by unittest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_spherical33()

pure real(preal) function, dimension(3,3) math::math_spherical33 ( real(preal), dimension(3,3), intent(in)  m)

hydrostatic part of a 3x3 matrix

Definition at line 585 of file math.f90.

References math_i3, and math_trace33().

Referenced by math_deviatoric33().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ math_sym3333to66()

pure real(preal) function, dimension(6,6) math::math_sym3333to66 ( real(preal), dimension(3,3,3,3), intent(in)  m3333,
logical, intent(in), optional  weighted 
)

convert symmetric 3x3x3x3 matrix into 6x6 matrix

Weighted conversion (default) rearranges according to Nye and weights shear

Parameters
[in]m3333symmetric 3x3x3x3 matrix (no internal check)
[in]weightedweight according to Mandel (.true. by default)

Definition at line 778 of file math.f90.

References mapnye, and nrmmandel.

Referenced by lattice::lattice_init(), math_invsym3333(), rotations::rottensor4sym(), and unittest().

+ Here is the caller graph for this function:

◆ math_sym33to6()

pure real(preal) function, dimension(6) math::math_sym33to6 ( real(preal), dimension(3,3), intent(in)  m33,
logical, intent(in), optional  weighted 
)

convert symmetric 3x3 matrix into 6 vector

Weighted conversion (default) rearranges according to Nye and weights shear

Parameters
[in]m33symmetric 3x3 matrix (no internal check)
[in]weightedweight according to Mandel (.true. by default)

Definition at line 687 of file math.f90.

References mapnye, and nrmmandel.

Referenced by unittest().

+ Here is the caller graph for this function:

◆ math_symmetric33()

pure real(preal) function, dimension(3,3) math::math_symmetric33 ( real(preal), dimension(3,3), intent(in)  m)

symmetrize a 3x3 matrix

Definition at line 546 of file math.f90.

Referenced by math_skew33(), and unittest().

+ Here is the caller graph for this function:

◆ math_symmetric66()

pure real(preal) function, dimension(6,6) math::math_symmetric66 ( real(preal), dimension(6,6), intent(in)  m)

symmetrize a 6x6 matrix

Definition at line 559 of file math.f90.

◆ math_tensordot()

real(preal) pure function math::math_tensordot ( real(preal), dimension(3,3), intent(in)  A,
real(preal), dimension(3,3), intent(in)  B 
)

double contraction of 3x3 matrices (A : B / ij,ij)

Definition at line 356 of file math.f90.

◆ math_trace33()

real(preal) pure function math::math_trace33 ( real(preal), dimension(3,3), intent(in)  m)

trace of a 3x3 matrix

Definition at line 611 of file math.f90.

Referenced by lattice::lattice_schmidmatrix_slip(), lattice::lattice_schmidmatrix_twin(), math_invariantssym33(), math_spherical33(), and rotations::om2ax().

+ Here is the caller graph for this function:

◆ math_voigt66to3333()

pure real(preal) function, dimension(3,3,3,3) math::math_voigt66to3333 ( real(preal), dimension(6,6), intent(in)  m66)

convert 66 Voigt matrix into symmetric 3x3x3x3 matrix

Parameters
[in]m666x6 matrix

Definition at line 834 of file math.f90.

References mapvoigt.

Referenced by lattice::lattice_init().

+ Here is the caller graph for this function:

◆ math_voltetrahedron()

real(preal) pure function math::math_voltetrahedron ( real(preal), dimension (3), intent(in)  v1,
real(preal), dimension (3), intent(in)  v2,
real(preal), dimension (3), intent(in)  v3,
real(preal), dimension (3), intent(in)  v4 
)

volume of tetrahedron given by four vertices

Definition at line 1167 of file math.f90.

References math_det33().

Referenced by unittest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unittest()

subroutine, private math::unittest
private

check correctness of some math functions

Definition at line 1214 of file math.f90.

References math_3333to99(), math_33to9(), math_66tosym3333(), math_6tosym33(), math_99to3333(), math_9to33(), math_binomial(), math_clip(), math_cross(), math_det33(), math_detsym33(), math_exp33(), math_expand(), math_factorial(), math_i3, math_identity2nd(), math_inv33(), math_invert(), math_invert33(), math_levicivita(), math_range(), math_rotationalpart(), math_sort(), math_sym3333to66(), math_sym33to6(), math_symmetric33(), and math_voltetrahedron().

+ Here is the call graph for this function:

Variable Documentation

◆ indeg

real(preal), parameter math::indeg = 180.0_pReal/PI

conversion from radian into degree

Definition at line 28 of file math.f90.

◆ inrad

real(preal), parameter math::inrad = PI/180.0_pReal

conversion from degree into radian

Definition at line 29 of file math.f90.

Referenced by rotations::fromaxisangle(), and rotations::fromeulers().

◆ invnrmmandel

real(preal), dimension(6), parameter, private math::invnrmmandel = 1.0_pReal/NRMMANDEL
private

backward weighting for Mandel notation

Definition at line 44 of file math.f90.

Referenced by math_66tosym3333(), and math_6tosym33().

◆ mapnye

integer, dimension (2,6), parameter, private math::mapnye = reshape([ 1,1, 2,2, 3,3, 1,2, 2,3, 1,3 ], [2,6])
private

arrangement in Nye notation.

Definition at line 47 of file math.f90.

Referenced by math_66tosym3333(), math_6tosym33(), math_sym3333to66(), and math_sym33to6().

◆ mapplain

integer, dimension (2,9), parameter, private math::mapplain = reshape([ 1,1, 1,2, 1,3, 2,1, 2,2, 2,3, 3,1, 3,2, 3,3 ], [2,9])
private

arrangement in Plain notation

Definition at line 67 of file math.f90.

Referenced by math_3333to99(), math_33to9(), math_99to3333(), and math_9to33().

◆ mapvoigt

integer, dimension (2,6), parameter, private math::mapvoigt = reshape([ 1,1, 2,2, 3,3, 2,3, 1,3, 1,2 ], [2,6])
private

arrangement in Voigt notation

Definition at line 57 of file math.f90.

Referenced by math_voigt66to3333().

◆ math_i3

◆ nrmmandel

real(preal), dimension(6), parameter, private math::nrmmandel = [ 1.0_pReal, 1.0_pReal, 1.0_pReal, sqrt(2.0_pReal), sqrt(2.0_pReal), sqrt(2.0_pReal) ]
private

forward weighting for Mandel notation

Definition at line 39 of file math.f90.

Referenced by math_sym3333to66(), and math_sym33to6().

◆ pi

◆ twopiimg

complex(preal), parameter math::twopiimg = cmplx(0.0_pReal, 2.0_pReal*PI)

Re(0.0), Im(2xPi)

Definition at line 30 of file math.f90.