|  | DAMASK with grid solvers
    Revision: v2.0.3-2204-gdb1f2151
    The Düsseldorf Advanced Material Simulation Kit with Grid Solvers |  | 
 
 
 
Go to the documentation of this file.    1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/discretization_grid.f90" 
    4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/discretization_grid.f90" 
   13 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 1 
   26 # 1 "/opt/petsc-3.10.3/Intel-18.4-IntelMPI-2018/include/petscconf.h" 1 
 1234 # 13 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2 
 1239 # 1 "/opt/petsc-3.10.3/include/petscversion.h" 1 
 1285 # 17 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2 
 1287 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h" 1 
 1304 # 31 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h" 
 1306 # 18 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2 
 1308 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h" 1 
 1317 # 24 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h" 
 1319 # 38 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h" 
 1336 # 19 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2 
 1338 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petsclog.h" 1 
 1341 # 20 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2 
 1343 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscbag.h" 1 
 1356 # 21 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2 
 1364 # 41 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 
 1374 # 63 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 
 1388 # 85 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 
 1407 # 128 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 
 1409 # 150 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 
 1413 # 174 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 
 1446 # 215 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 
 1459 # 9 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/discretization_grid.f90" 2 
 1476   integer,     
dimension(3), 
public, 
protected :: &
 
 1478   integer,                   
public, 
protected :: &
 
 1479     grid3, &                                                                                        !< (local) grid in 3rd direction
 
 1481   real(
preal), 
dimension(3), 
public, 
protected :: &
 
 1484     size3, &                                                                                        !< (local) size in 3rd direction
 
 1498   include 
'fftw3-mpi.f03' 
 1499   real(
preal), 
dimension(3) :: &
 
 1500     mysize, &                                                                                       !< domain size of this process
 
 1502   integer,     
dimension(3) :: &
 
 1505   integer,     
dimension(:),   
allocatable :: &
 
 1510   integer(C_INTPTR_T) :: &
 
 1511     devnull, z, z_offset
 
 1513   write(6,
'(/,a)') 
' <<<+-  discretization_grid init  -+>>>'; 
flush(6)
 
 1522   devnull = fftw_mpi_local_size_3d(int(
grid(3),c_intptr_t), &
 
 1523                                    int(
grid(2),c_intptr_t), &
 
 1524                                    int(
grid(1),c_intptr_t)/2+1, &
 
 1537   microstructureat = microstructureat(product(
grid(1:2))*
grid3offset+1: &
 
 1539   homogenizationat = homogenizationat(product(
grid(1:2))*
grid3offset+1: &
 
 1564                                                      [1,product(mygrid)]))
 
 1582 subroutine readgeom(grid,geomSize,origin,microstructure,homogenization)
 
 1584   integer,     
dimension(3), 
intent(out) :: &
 
 1586   real(pReal), 
dimension(3), 
intent(out) :: &
 
 1589   integer,     
dimension(:), 
intent(out), 
allocatable :: &
 
 1593   character(len=:),      
allocatable :: rawData
 
 1594   character(len=65536)               :: line
 
 1595   integer, 
allocatable, 
dimension(:) :: chunkPos
 
 1598     headerlength = -1, &                                                                            
 
 1610   geomsize = -1.0_preal
 
 1615   open(newunit=fileunit, file=trim(
geometryfile), access=
'stream',&
 
 1616        status=
'old', position=
'rewind', action=
'read',iostat=mystat)
 
 1618   allocate(
character(len=fileLength)::rawData)
 
 1619   read(fileunit) rawdata
 
 1624   endpos = index(rawdata,
io_eol)
 
 1625   if(endpos <= index(rawdata,
'head')) 
then                                                           
 1626     startpos = len(rawdata)
 
 1627     call io_error(error_id=841, ext_msg=
'readGeom')
 
 1630     if (chunkpos(1) < 2) 
call io_error(error_id=841, ext_msg=
'readGeom')
 
 1631     headerlength = 
io_intvalue(rawdata(1:endpos),chunkpos,1)
 
 1632     startpos = endpos + 1
 
 1639   do while (l < headerlength .and. startpos < len(rawdata))
 
 1640     endpos = startpos + index(rawdata(startpos:),
io_eol) - 1
 
 1641     if (endpos < startpos) endpos = len(rawdata)                                                    
 
 1642     line = rawdata(startpos:endpos)
 
 1643     startpos = endpos + 1
 
 1647     if (chunkpos(1) < 2) cycle                                                                      
 
 1651         if (chunkpos(1) > 6) 
then 
 1665         if (chunkpos(1) > 6) 
then 
 1679         if (chunkpos(1) > 6) 
then 
 1692       case (
'homogenization')
 
 1693         if (chunkpos(1) > 1) h = 
io_intvalue(line,chunkpos,2)
 
 1702     call io_error(error_id = 842, ext_msg=
'homogenization (readGeom)')
 
 1704     call io_error(error_id = 842, ext_msg=
'grid (readGeom)')
 
 1705   if(any(geomsize < 0.0_preal)) &
 
 1706     call io_error(error_id = 842, ext_msg=
'size (readGeom)')
 
 1708   allocate(microstructure(product(grid)), source = -1)                                              
 
 1714   do while (startpos < len(rawdata))
 
 1715     endpos = startpos + index(rawdata(startpos:),
io_eol) - 1
 
 1716     if (endpos < startpos) endpos = len(rawdata)                                                    
 
 1717     line = rawdata(startpos:endpos)
 
 1718     startpos = endpos + 1
 
 1722     nocompression: 
if (chunkpos(1) /= 3) 
then 
 1724       microstructure(e:e+c-1) =  [(
io_intvalue(line,chunkpos,i+1), i=0, c-1)]
 
 1735         microstructure(e:e+c-1) = [(
io_intvalue(line,chunkpos,i+1), i=0, c-1)]
 
 1742   if (e-1 /= product(grid)) 
call io_error(error_id = 843, el=e)
 
 1752   integer,     
dimension(3), 
intent(in) :: 
grid                                                      
 1763   do c = 1, 
grid(3); 
do b = 1, 
grid(2); 
do a = 1, 
grid(1)
 
 1774 pure function nodes0(grid,geomSize,grid3Offset)
 
 1776   integer,     
dimension(3), 
intent(in) :: 
grid                                                      
 1780   real(
preal), 
dimension(3,product(grid+1)) :: 
nodes0 
 1801   integer,     
dimension(3), 
intent(in) :: 
grid                                                      
 1817   integer, 
intent(in) :: nelems
 
 1821   cellsurfacenormal(1:3,1,1,:) = spread([+1.0_preal, 0.0_preal, 0.0_preal],2,nelems)
 
 1822   cellsurfacenormal(1:3,2,1,:) = spread([-1.0_preal, 0.0_preal, 0.0_preal],2,nelems)
 
 1823   cellsurfacenormal(1:3,3,1,:) = spread([ 0.0_preal,+1.0_preal, 0.0_preal],2,nelems)
 
 1824   cellsurfacenormal(1:3,4,1,:) = spread([ 0.0_preal,-1.0_preal, 0.0_preal],2,nelems)
 
 1825   cellsurfacenormal(1:3,5,1,:) = spread([ 0.0_preal, 0.0_preal,+1.0_preal],2,nelems)
 
 1826   cellsurfacenormal(1:3,6,1,:) = spread([ 0.0_preal, 0.0_preal,-1.0_preal],2,nelems)
 
 1836   integer, 
dimension(3), 
intent(in) :: 
grid                                                          
 1845   do z = 0,
grid(3)-1; 
do y = 0,
grid(2)-1; 
do x = 0,
grid(1)-1
 
 1850                             + modulo(x+1,
grid(1)) &
 
 1854                             + modulo(x-1,
grid(1)) &
 
 
 
integer, dimension(2) fesolving_execip
for ping-pong scheme always range to max IP, otherwise one specific IP
pure integer function, dimension(:), allocatable, public io_stringpos(string)
locates all whitespace-separated chunks in given string and returns array containing number them and ...
subroutine, public results_closejobfile
closes the results file
subroutine, public io_error(error_ID, el, ip, g, instance, ext_msg)
write error statements to standard out and terminate the Marc/spectral run with exit #9xxx
integer, public, protected debug_i
character, parameter, public io_eol
end of line character
subroutine geometry_plastic_nonlocal_setipneighborhood(IPneighborhood)
Set the integration point (IP) neighborhood.
character(len=:), allocatable, public, protected geometryfile
parameter given for geometry file
real(preal), public, protected size3
(local) size in 3rd direction
real(preal), public, protected size3offset
(local) size offset in 3rd direction
integer, public, protected worldsize
MPI worldsize (/=1 for MPI simulations only)
pure real(preal) function, dimension(3, product(grid+1)) nodes0(grid, geomSize, grid3Offset)
Calculate position of undeformed nodes (pretend to be an element)
integer, public, protected grid3
(local) grid in 3rd direction
Geometric information about the IP cells needed for the nonlocal.
subroutine readgeom(grid, geomSize, origin, microstructure, homogenization)
Parses geometry file.
Parse geometry file to set up discretization and geometry for nonlocal model.
setting precision for real and int type
real(preal), dimension(3), public, protected geomsize
(global) physical size
pure real(preal) function, dimension(3, 6, 1, nelems) cellsurfacenormal(nElems)
Calculate IP interface areas normals.
subroutine geometry_plastic_nonlocal_setiparea(IParea)
Set the initial areas of the unit triangle/unit quadrilateral/tetrahedron/hexahedron.
pure real(preal) function, dimension(6, 1, product(grid)) cellsurfacearea(geomSize, grid)
Calculate IP interface areas.
input/output functions, partly depending on chosen solver
homogenization manager, organizing deformation partitioning and stress homogenization
integer, parameter preal
number with 15 significant digits, up to 1e+-307 (typically 64 bit)
Reading in and interpretating the debugging settings for the various modules.
subroutine, public discretization_grid_init
reads the geometry file to obtain information on discretization
real(preal) function, dimension(3, product(grid)) ipcoordinates0(grid, geomSize, grid3Offset)
Calculate undeformed position of IPs/cell centers (pretend to be an element)
integer(hid_t) function, public results_addgroup(groupName)
adds a new group to the results file
provides wrappers to C routines
subroutine, public discretization_init(homogenizationAt, microstructureAt, IPcoords0, NodeCoords0, sharedNodesBegin)
stores the relevant information in globally accesible variables
integer, public, protected grid3offset
(local) grid offset in 3rd direction
integer function, public io_intvalue(string, chunkPos, myChunk)
reads integer value at myChunk from string
Interfacing between the 1-based solvers and the material subroutines provided by DAMASK.
subroutine, public results_openjobfile
opens the results file to append data
integer, public, protected worldrank
MPI worldrank (/=0 for MPI simulations only)
integer, dimension(3), public, protected grid
(global) grid
integer, public, protected debug_e
pure integer function, dimension(3, 6, 1, product(grid)) ipneighborhood(grid)
Build IP neighborhood relations.
subroutine geometry_plastic_nonlocal_setipareanormal(IPareaNormal)
Set the direction normal of the areas of the triangle/quadrilateral/tetrahedron/hexahedron.
subroutine, public results_closegroup(group_id)
close a group
pure character(len=len(string)) function, public io_lc(string)
changes characters in string to lower case
integer, dimension(2) fesolving_execelem
for ping-pong scheme always whole range, otherwise one specific element
character(len=:) function, allocatable, public io_stringvalue(string, chunkPos, myChunk)
reads string value at myChunk from string
subroutine geometry_plastic_nonlocal_setipvolume(IPvolume)
Set the initial volume associated with an integration point.
Managing of parameters related to numerics.
global variables for flow control
real(preal) function, public io_floatvalue(string, chunkPos, myChunk)
reads float value at myChunk from string