DAMASK with MSC.Marc FEM solver  Revision: v2.0.3-2204-gdb1f2151
The Düsseldorf Advanced Material Simulation Kit with MSC.Marc
discretization_marc Module Reference

Sets up the mesh for the solver MSC.Marc. More...

Data Types

type  tcellnodedefinition
 

Functions/Subroutines

subroutine, public discretization_marc_init (ip, el)
 initializes the mesh by calling all necessary private routines the mesh module Order and routines strongly depend on type of solver More...
 
subroutine writegeometry (elem, connectivity_elem, connectivity_cell, coordinates_nodes, coordinates_points)
 Write all information needed for the DADF5 geometry. More...
 
subroutine inputread (elem, node0_elem, connectivity_elem, microstructureAt, homogenizationAt)
 Read mesh from marc input file. More...
 
subroutine inputread_fileformat (fileFormat, fileContent)
 Figures out version of Marc input file format. More...
 
subroutine inputread_tablestyles (initialcond, hypoelastic, fileContent)
 Figures out table styles for initial cond and hypoelastic. More...
 
subroutine inputread_matnumber (matNumber, tableStyle, fileContent)
 Figures out material number of hypoelastic material. More...
 
subroutine inputread_nnodesandelements (nNodes, nElems, fileContent)
 Count overall number of nodes and elements. More...
 
subroutine inputread_nelemsets (nElemSets, maxNelemInSet, fileContent)
 Count overall number of element sets in mesh. More...
 
subroutine inputread_mapelemsets (nameElemSet, mapElemSet, fileContent)
 map element sets More...
 
subroutine inputread_mapelems (FEM2DAMASK, nElems, nNodesPerElem, fileContent)
 Maps elements from FE ID to internal (consecutive) representation. More...
 
subroutine inputread_mapnodes (FEM2DAMASK, nNodes, fileContent)
 Maps node from FE ID to internal (consecutive) representation. More...
 
subroutine inputread_elemnodes (nodes, nNode, fileContent)
 store x,y,z coordinates of all nodes in mesh. More...
 
subroutine inputread_elemtype (elem, nElem, fileContent)
 Gets element type (and checks if the whole mesh comprises of only one type) More...
 
integer function, dimension(nnodes, nelem) inputread_connectivityelem (nElem, nNodes, fileContent)
 Stores node IDs. More...
 
subroutine inputread_microstructureandhomogenization (microstructureAt, homogenizationAt, nElem, nNodes, nameElemSet, mapElemSet, initialcondTableStyle, fileContent)
 Stores homogenization and microstructure ID. More...
 
subroutine buildcells (connectivity_cell, cellNodeDefinition, elem, connectivity_elem)
 Calculates cell node coordinates from element node coordinates. More...
 
subroutine buildcellnodes (node_cell, definition, node_elem)
 Calculates cell node coordinates from element node coordinates. More...
 
subroutine buildipcoordinates (IPcoordinates, connectivity_cell, node_cell)
 Calculates IP coordinates as center of cell. More...
 
real(preal) function, dimension(elem%nips, size(connectivity, 3)) ipvolume (elem, node, connectivity)
 Calculates IP volume. More...
 
real(preal) function, dimension(3, elem%nipneighbors, elem%nips, nelem) ipareanormal (elem, nElem, connectivity, node)
 calculation of IP interface areas More...
 
integer function, dimension(1+maxn) continuousintvalues (fileContent, maxN, lookupName, lookupMap, lookupMaxN)
 return integer list corresponding to items in consecutive lines. First integer in array is counter More...
 
logical function containsrange (str, chunkPos)
 return whether a line contains a range ('X to Y') More...
 

Variables

type(tcellnodedefinition), dimension(:), allocatable cellnodedefinition
 
real(preal), public, protected mesh_unitlength
 physical length of one unit in mesh More...
 
integer, dimension(:), allocatable, public mesh_fem2damask_elem
 DAMASK element ID for Marc element ID. More...
 
integer, dimension(:), allocatable, public mesh_fem2damask_node
 DAMASK node ID for Marc node ID. More...
 

Detailed Description

Sets up the mesh for the solver MSC.Marc.

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

◆ buildcellnodes()

subroutine discretization_marc::buildcellnodes ( real(preal), dimension(:,:), intent(out)  node_cell,
type(tcellnodedefinition), dimension(:), intent(in)  definition,
real(preal), dimension(:,:), intent(in)  node_elem 
)
private

Calculates cell node coordinates from element node coordinates.

Parameters
[out]node_cellcell node coordinates
[in]definitioncell node definition (weights and parents)
[in]node_elemelement nodes

Definition at line 10933 of file DAMASK_marc.f90.

References cellnodedefinition.

Referenced by discretization_marc_init().

+ Here is the caller graph for this function:

◆ buildcells()

subroutine discretization_marc::buildcells ( integer, dimension(:,:,:), intent(out)  connectivity_cell,
type(tcellnodedefinition), dimension(:), intent(out)  cellNodeDefinition,
type(telement), intent(in)  elem,
integer, dimension(:,:), intent(in)  connectivity_elem 
)
private

Calculates cell node coordinates from element node coordinates.

Definition at line 10776 of file DAMASK_marc.f90.

References math::math_sort(), and uniquerows().

Referenced by discretization_marc_init().

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

◆ buildipcoordinates()

subroutine discretization_marc::buildipcoordinates ( real(preal), dimension(:,:), intent(out)  IPcoordinates,
integer, dimension(:,:), intent(in)  connectivity_cell,
real(preal), dimension(:,:), intent(in)  node_cell 
)
private

Calculates IP coordinates as center of cell.

Parameters
[out]ipcoordinatescell-center/IP coordinates
[in]connectivity_cellconnectivity for each cell
[in]node_cellcell node coordinates

Definition at line 10963 of file DAMASK_marc.f90.

Referenced by discretization_marc_init().

+ Here is the caller graph for this function:

◆ containsrange()

logical function discretization_marc::containsrange ( character(len=*), intent(in)  str,
integer, dimension(:), intent(in)  chunkPos 
)
private

return whether a line contains a range ('X to Y')

Parameters
[in]chunkpospositions of start and end of each tag/chunk in given string

Definition at line 11153 of file DAMASK_marc.f90.

References io::io_lc(), and io::io_stringvalue().

Referenced by continuousintvalues(), and inputread_nelemsets().

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

◆ continuousintvalues()

integer function, dimension(1+maxn) discretization_marc::continuousintvalues ( character(len=*), dimension(:), intent(in)  fileContent,
integer, intent(in)  maxN,
character(len=*), dimension(:), intent(in)  lookupName,
integer, dimension(:,:), intent(in)  lookupMap,
integer, intent(in)  lookupMaxN 
)
private

return integer list corresponding to items in consecutive lines. First integer in array is counter

ints concatenated by "c" as last char, range of a "to" b, or named set

Parameters
[in]filecontentfile content, separated per lines

Definition at line 11097 of file DAMASK_marc.f90.

References containsrange(), io::io_intvalue(), io::io_lc(), io::io_stringpos(), and io::io_stringvalue().

Referenced by inputread_mapelemsets(), and inputread_microstructureandhomogenization().

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

◆ discretization_marc_init()

subroutine, public discretization_marc::discretization_marc_init ( integer, intent(in)  ip,
integer, intent(in)  el 
)

initializes the mesh by calling all necessary private routines the mesh module Order and routines strongly depend on type of solver

Definition at line 10093 of file DAMASK_marc.f90.

References buildcellnodes(), buildcells(), buildipcoordinates(), fesolving::calcmode, cellnodedefinition, debug::debug_e, debug::debug_i, discretization::discretization_init(), fesolving::fesolving_execelem, fesolving::fesolving_execip, geometry_plastic_nonlocal::geometry_plastic_nonlocal_results(), geometry_plastic_nonlocal::geometry_plastic_nonlocal_setiparea(), geometry_plastic_nonlocal::geometry_plastic_nonlocal_setipareanormal(), geometry_plastic_nonlocal::geometry_plastic_nonlocal_setipvolume(), inputread(), io::io_error(), ipareanormal(), ipvolume(), mesh_fem2damask_elem, mesh_unitlength, numerics::numerics_unitlength, and writegeometry().

Referenced by cpfem_initall().

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

◆ inputread()

subroutine discretization_marc::inputread ( type(telement), intent(out)  elem,
real(preal), dimension(:,:), intent(out), allocatable  node0_elem,
integer, dimension(:,:), intent(out), allocatable  connectivity_elem,
integer, dimension(:), intent(out), allocatable  microstructureAt,
integer, dimension(:), intent(out), allocatable  homogenizationAt 
)
private

Read mesh from marc input file.

Parameters
[out]node0_elemnode x,y,z coordinates (initially!)

Definition at line 10214 of file DAMASK_marc.f90.

References damask_interface::getsolverjobname(), damask_interface::inputfileextension, inputread_connectivityelem(), inputread_elemnodes(), inputread_elemtype(), inputread_fileformat(), inputread_mapelems(), inputread_mapelemsets(), inputread_mapnodes(), inputread_matnumber(), inputread_microstructureandhomogenization(), inputread_nnodesandelements(), inputread_tablestyles(), io::io_read_ascii(), mesh_fem2damask_elem, and mesh_fem2damask_node.

Referenced by discretization_marc_init().

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

◆ inputread_connectivityelem()

integer function, dimension(nnodes,nelem) discretization_marc::inputread_connectivityelem ( integer, intent(in)  nElem,
integer, intent(in)  nNodes,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Stores node IDs.

Parameters
[in]nnodesnumber of nodes per element
[in]filecontentfile content, separated per lines

Definition at line 10670 of file DAMASK_marc.f90.

References io::io_intvalue(), io::io_lc(), io::io_stringpos(), io::io_stringvalue(), mesh_fem2damask_elem, and mesh_fem2damask_node.

Referenced by inputread().

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

◆ inputread_elemnodes()

subroutine discretization_marc::inputread_elemnodes ( real(preal), dimension(:,:), intent(out), allocatable  nodes,
integer, intent(in)  nNode,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

store x,y,z coordinates of all nodes in mesh.

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10554 of file DAMASK_marc.f90.

References io::io_floatvalue(), io::io_intvalue(), io::io_lc(), io::io_stringpos(), io::io_stringvalue(), mesh_fem2damask_node, and mesh_unitlength.

Referenced by inputread().

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

◆ inputread_elemtype()

subroutine discretization_marc::inputread_elemtype ( type(telement), intent(out)  elem,
integer, intent(in)  nElem,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Gets element type (and checks if the whole mesh comprises of only one type)

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10587 of file DAMASK_marc.f90.

References io::io_error(), io::io_lc(), io::io_stringpos(), io::io_stringvalue(), and mapelemtype().

Referenced by inputread().

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

◆ inputread_fileformat()

subroutine discretization_marc::inputread_fileformat ( integer, intent(out)  fileFormat,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Figures out version of Marc input file format.

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10279 of file DAMASK_marc.f90.

References io::io_intvalue(), io::io_lc(), io::io_stringpos(), and io::io_stringvalue().

Referenced by inputread().

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

◆ inputread_mapelems()

subroutine discretization_marc::inputread_mapelems ( integer, dimension(:), intent(out), allocatable  FEM2DAMASK,
integer, intent(in)  nElems,
integer, intent(in)  nNodesPerElem,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Maps elements from FE ID to internal (consecutive) representation.

Parameters
[in]nnodesperelemnumber of nodes per element
[in]filecontentfile content, separated per lines
Parameters
nElemsnumber of elements

Definition at line 10474 of file DAMASK_marc.f90.

References io::io_intvalue(), io::io_lc(), io::io_stringpos(), io::io_stringvalue(), and math::math_sort().

Referenced by inputread().

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

◆ inputread_mapelemsets()

subroutine discretization_marc::inputread_mapelemsets ( character(len=pstringlen), dimension(:), intent(out), allocatable  nameElemSet,
integer, dimension(:,:), intent(out), allocatable  mapElemSet,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

map element sets

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10441 of file DAMASK_marc.f90.

References continuousintvalues(), inputread_nelemsets(), io::io_lc(), io::io_stringpos(), and io::io_stringvalue().

Referenced by inputread().

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

◆ inputread_mapnodes()

subroutine discretization_marc::inputread_mapnodes ( integer, dimension(:), intent(out), allocatable  FEM2DAMASK,
integer, intent(in)  nNodes,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Maps node from FE ID to internal (consecutive) representation.

Parameters
[in]nnodesnumber of nodes
[in]filecontentfile content, separated per lines

Definition at line 10518 of file DAMASK_marc.f90.

References io::io_intvalue(), io::io_lc(), io::io_stringpos(), io::io_stringvalue(), and math::math_sort().

Referenced by inputread().

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

◆ inputread_matnumber()

subroutine discretization_marc::inputread_matnumber ( integer, dimension(:), intent(out), allocatable  matNumber,
integer, intent(in)  tableStyle,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Figures out material number of hypoelastic material.

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10330 of file DAMASK_marc.f90.

References io::io_intvalue(), io::io_lc(), io::io_stringpos(), and io::io_stringvalue().

Referenced by inputread().

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

◆ inputread_microstructureandhomogenization()

subroutine discretization_marc::inputread_microstructureandhomogenization ( integer, dimension(:), intent(out), allocatable  microstructureAt,
integer, dimension(:), intent(out), allocatable  homogenizationAt,
integer, intent(in)  nElem,
integer, intent(in)  nNodes,
character(len=*), dimension(:), intent(in)  nameElemSet,
integer, dimension(:,:), intent(in)  mapElemSet,
integer, intent(in)  initialcondTableStyle,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Stores homogenization and microstructure ID.

Parameters
[in]mapelemsetlist of elements in elementSet
[in]filecontentfile content, separated per lines
Parameters
nNodesnumber of nodes per element

Definition at line 10721 of file DAMASK_marc.f90.

References continuousintvalues(), io::io_floatvalue(), io::io_intvalue(), io::io_lc(), io::io_stringpos(), io::io_stringvalue(), and mesh_fem2damask_elem.

Referenced by inputread().

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

◆ inputread_nelemsets()

subroutine discretization_marc::inputread_nelemsets ( integer, intent(out)  nElemSets,
integer, intent(out)  maxNelemInSet,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Count overall number of element sets in mesh.

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10395 of file DAMASK_marc.f90.

References containsrange(), io::io_intvalue(), io::io_lc(), io::io_stringpos(), and io::io_stringvalue().

Referenced by inputread_mapelemsets().

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

◆ inputread_nnodesandelements()

subroutine discretization_marc::inputread_nnodesandelements ( integer, intent(out)  nNodes,
integer, intent(out)  nElems,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Count overall number of nodes and elements.

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10366 of file DAMASK_marc.f90.

References io::io_intvalue(), io::io_lc(), io::io_stringpos(), and io::io_stringvalue().

Referenced by inputread().

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

◆ inputread_tablestyles()

subroutine discretization_marc::inputread_tablestyles ( integer, intent(out)  initialcond,
integer, intent(out)  hypoelastic,
character(len=*), dimension(:), intent(in)  fileContent 
)
private

Figures out table styles for initial cond and hypoelastic.

Parameters
[in]filecontentfile content, separated per lines

Definition at line 10302 of file DAMASK_marc.f90.

References io::io_intvalue(), io::io_lc(), io::io_stringpos(), and io::io_stringvalue().

Referenced by inputread().

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

◆ ipareanormal()

real(preal) function, dimension(3,elem%nipneighbors,elem%nips,nelem) discretization_marc::ipareanormal ( type(telement), intent(in)  elem,
integer, intent(in)  nElem,
integer, dimension(:,:,:), intent(in)  connectivity,
real(preal), dimension(:,:), intent(in)  node 
)
private

calculation of IP interface areas

Definition at line 11046 of file DAMASK_marc.f90.

References math::math_cross().

Referenced by discretization_marc_init().

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

◆ ipvolume()

real(preal) function, dimension(elem%nips,size(connectivity,3)) discretization_marc::ipvolume ( type(telement), intent(in)  elem,
real(preal), dimension(:,:), intent(in)  node,
integer, dimension(:,:,:), intent(in)  connectivity 
)
private

Calculates IP volume.

The IP volume is calculated differently depending on the cell type. 2D cells assume an element depth of 1.0

Definition at line 10988 of file DAMASK_marc.f90.

References math::math_areatriangle(), math::math_cross(), and math::math_voltetrahedron().

Referenced by discretization_marc_init().

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

◆ writegeometry()

subroutine discretization_marc::writegeometry ( type(telement), intent(in)  elem,
integer, dimension(:,:), intent(in)  connectivity_elem,
integer, dimension(:,:), intent(in)  connectivity_cell,
real(preal), dimension(:,:), intent(in)  coordinates_nodes,
real(preal), dimension(:,:), intent(in)  coordinates_points 
)
private

Write all information needed for the DADF5 geometry.

Definition at line 10170 of file DAMASK_marc.f90.

References results::results_addgroup(), results::results_closegroup(), results::results_closejobfile(), and results::results_openjobfile().

Referenced by discretization_marc_init().

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

Variable Documentation

◆ cellnodedefinition

type(tcellnodedefinition), dimension(:), allocatable discretization_marc::cellnodedefinition
private

Definition at line 10074 of file DAMASK_marc.f90.

Referenced by buildcellnodes(), and discretization_marc_init().

◆ mesh_fem2damask_elem

integer, dimension(:), allocatable, public discretization_marc::mesh_fem2damask_elem

◆ mesh_fem2damask_node

integer, dimension(:), allocatable, public discretization_marc::mesh_fem2damask_node

DAMASK node ID for Marc node ID.

Definition at line 10079 of file DAMASK_marc.f90.

Referenced by inputread(), inputread_connectivityelem(), and inputread_elemnodes().

◆ mesh_unitlength

real(preal), public, protected discretization_marc::mesh_unitlength

physical length of one unit in mesh

Definition at line 10076 of file DAMASK_marc.f90.

Referenced by discretization_marc_init(), and inputread_elemnodes().