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

input/output functions, partly depending on chosen solver More...

Functions/Subroutines

subroutine, public io_init
 does nothing. More...
 
character(len=pstringlen) function, dimension(:), allocatable, public io_read_ascii (fileName)
 reads an entire ASCII file into an array More...
 
integer function, public io_open_binary (fileName, mode)
 opens an existing file for reading or a new file for writing. More...
 
logical pure function, public io_isblank (string)
 identifies strings without content More...
 
pure character(len=:) function, allocatable, public io_gettag (string, openChar, closeChar)
 get tagged content of string More...
 
pure integer function, dimension(:), allocatable, public io_stringpos (string)
 locates all whitespace-separated chunks in given string and returns array containing number them and the left/right position to be used by IO_xxxVal Array size is dynamically adjusted to number of chunks found in string IMPORTANT: first element contains number of chunks! More...
 
character(len=:) function, allocatable, public io_stringvalue (string, chunkPos, myChunk)
 reads string value at myChunk from string More...
 
integer function, public io_intvalue (string, chunkPos, myChunk)
 reads integer value at myChunk from string More...
 
real(preal) function, public io_floatvalue (string, chunkPos, myChunk)
 reads float value at myChunk from string More...
 
pure character(len=len(string)) function, public io_lc (string)
 changes characters in string to lower case More...
 
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 More...
 
subroutine, public io_warning (warning_ID, el, ip, g, ext_msg)
 writes warning statement to standard out More...
 
integer function verifyintvalue (string)
 returns verified integer value in given string More...
 
real(preal) function verifyfloatvalue (string)
 returns verified float value in given string More...
 
subroutine unittest
 check correctness of some IO functions More...
 

Variables

character(len= *), parameter, public io_eof = '#EOF#'
 end of file string More...
 
character(len= *), parameter, public io_whitespace = achar(44)//achar(32)//achar(9)//achar(10)//achar(13)
 whitespace characters More...
 
character, parameter, public io_eol = new_line('DAMASK')
 end of line character More...
 
character, parameter, public io_comment = '#'
 
character(len= *), parameter, private io_divider = '───────────────────'// '───────────────────'// '───────────────────'// '────────────'
 

Detailed Description

input/output functions, partly depending on chosen solver

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

◆ io_error()

subroutine, public io::io_error ( integer, intent(in)  error_ID,
integer, intent(in), optional  el,
integer, intent(in), optional  ip,
integer, intent(in), optional  g,
integer, intent(in), optional  instance,
character(len=*), intent(in), optional  ext_msg 
)

write error statements to standard out and terminate the Marc/spectral run with exit #9xxx

Definition at line 305 of file IO.f90.

References io_divider, and quit().

Referenced by lattice::applylatticesymmetryc66(), lattice::buildcoordinatesystem(), lattice::buildinteraction(), lattice::buildtransformationsystem(), config::config_deallocate(), config::config_init(), lattice::coordinatesystem_slip(), crystallite::crystallite_init(), damask_spectral(), discretization_grid::discretization_grid_init(), lattice::equivalent_mu(), lattice::equivalent_nu(), hdf5_utilities::finalize_read(), hdf5_utilities::finalize_write(), rotations::fromaxisangle(), rotations::fromeulers(), rotations::frommatrix(), rotations::fromquaternion(), list::getfloat(), list::getfloats(), list::getint(), list::getints(), list::getstring(), list::getstrings(), hdf5_utilities::hdf5_addattribute_int(), hdf5_utilities::hdf5_addattribute_int_array(), hdf5_utilities::hdf5_addattribute_real(), hdf5_utilities::hdf5_addattribute_real_array(), hdf5_utilities::hdf5_addattribute_str(), hdf5_utilities::hdf5_addgroup(), hdf5_utilities::hdf5_closefile(), hdf5_utilities::hdf5_closegroup(), hdf5_utilities::hdf5_objectexists(), hdf5_utilities::hdf5_openfile(), hdf5_utilities::hdf5_opengroup(), hdf5_utilities::hdf5_read_int1(), hdf5_utilities::hdf5_read_int2(), hdf5_utilities::hdf5_read_int3(), hdf5_utilities::hdf5_read_int4(), hdf5_utilities::hdf5_read_int5(), hdf5_utilities::hdf5_read_int6(), hdf5_utilities::hdf5_read_int7(), hdf5_utilities::hdf5_read_real1(), hdf5_utilities::hdf5_read_real2(), hdf5_utilities::hdf5_read_real3(), hdf5_utilities::hdf5_read_real4(), hdf5_utilities::hdf5_read_real5(), hdf5_utilities::hdf5_read_real6(), hdf5_utilities::hdf5_read_real7(), hdf5_utilities::hdf5_setlink(), hdf5_utilities::hdf5_utilities_init(), hdf5_utilities::hdf5_write_int1(), hdf5_utilities::hdf5_write_int2(), hdf5_utilities::hdf5_write_int3(), hdf5_utilities::hdf5_write_int4(), hdf5_utilities::hdf5_write_int5(), hdf5_utilities::hdf5_write_int6(), hdf5_utilities::hdf5_write_int7(), hdf5_utilities::hdf5_write_real1(), hdf5_utilities::hdf5_write_real2(), hdf5_utilities::hdf5_write_real3(), hdf5_utilities::hdf5_write_real4(), hdf5_utilities::hdf5_write_real5(), hdf5_utilities::hdf5_write_real6(), hdf5_utilities::hdf5_write_real7(), hdf5_utilities::hdf5_write_rotation(), homogenization::homogenization_init(), hdf5_utilities::initialize_read(), hdf5_utilities::initialize_write(), io_open_binary(), io_read_ascii(), io_stringvalue(), kinematics_cleavage_opening::kinematics_cleavage_opening_init(), kinematics_slipplane_opening::kinematics_slipplane_opening_init(), lattice::lattice_applylatticesymmetry33(), lattice::lattice_c66_trans(), lattice::lattice_c66_twin(), lattice::lattice_characteristicshear_twin(), lattice::lattice_init(), lattice::lattice_interaction_slipbyslip(), lattice::lattice_interaction_slipbytrans(), lattice::lattice_interaction_slipbytwin(), lattice::lattice_interaction_transbytrans(), lattice::lattice_interaction_twinbyslip(), lattice::lattice_interaction_twinbytwin(), lattice::lattice_labels_slip(), lattice::lattice_labels_twin(), lattice::lattice_nonschmidmatrix(), lattice::lattice_schmidmatrix_cleavage(), lattice::lattice_schmidmatrix_slip(), lattice::lattice_schmidmatrix_trans(), lattice::lattice_schmidmatrix_twin(), material::material_init(), material::material_parsehomogenization(), material::material_parsemicrostructure(), material::material_parsephase(), material::material_parsetexture(), numerics::numerics_init(), rotations::om2ax(), parse_materialconfig(), read_materialconfig(), discretization_grid::readgeom(), source_damage_anisobrittle::source_damage_anisobrittle_init(), source_damage_anisoductile::source_damage_anisoductile_init(), source_damage_isobrittle::source_damage_isobrittle_init(), source_damage_isoductile::source_damage_isoductile_init(), element::telement_init(), unittest(), rotations::unittest(), lattice::unittest(), spectral_utilities::utilities_constitutiveresponse(), spectral_utilities::utilities_curlrms(), spectral_utilities::utilities_divergencerms(), spectral_utilities::utilities_init(), spectral_utilities::utilities_maskedcompliance(), spectral_utilities::utilities_updatecoords(), verifyfloatvalue(), and verifyintvalue().

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

◆ io_floatvalue()

real(preal) function, public io::io_floatvalue ( character(len=*), intent(in)  string,
integer, dimension(:), intent(in)  chunkPos,
integer, intent(in)  myChunk 
)

reads float value at myChunk from string

Parameters
[in]stringraw input with known start and end of each chunk
[in]chunkpospositions of start and end of each tag/chunk in given string
[in]mychunkposition number of desired chunk

Definition at line 266 of file IO.f90.

References io_stringvalue(), and verifyfloatvalue().

Referenced by damask_spectral(), list::getfloat(), list::getfloats(), material::material_parsemicrostructure(), material::material_parsetexture(), numerics::numerics_init(), discretization_grid::readgeom(), and unittest().

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

◆ io_gettag()

pure character(len=:) function, allocatable, public io::io_gettag ( character(len=*), intent(in)  string,
character, intent(in)  openChar,
character, intent(in)  closeChar 
)

get tagged content of string

Parameters
[in]stringstring to check for tag
[in]closecharindicates end of tag
Parameters
openCharindicates beginning of tag

Definition at line 175 of file IO.f90.

References io_whitespace.

Referenced by config::config_init(), and parse_materialconfig().

+ Here is the caller graph for this function:

◆ io_init()

subroutine, public io::io_init

does nothing.

Definition at line 49 of file IO.f90.

References unittest().

Referenced by cpfem2::cpfem_initall().

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

◆ io_intvalue()

integer function, public io::io_intvalue ( character(len=*), intent(in)  string,
integer, dimension(:), intent(in)  chunkPos,
integer, intent(in)  myChunk 
)

reads integer value at myChunk from string

Parameters
[in]stringraw input with known start and end of each chunk
[in]chunkpospositions of start and end of each tag/chunk in given string
[in]mychunkposition number of desired chunk

Definition at line 252 of file IO.f90.

References io_stringvalue(), and verifyintvalue().

Referenced by damask_spectral(), debug::debug_init(), list::getint(), list::getints(), material::material_parsemicrostructure(), numerics::numerics_init(), discretization_grid::readgeom(), and unittest().

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

◆ io_isblank()

logical pure function, public io::io_isblank ( character(len=*), intent(in)  string)

identifies strings without content

Parameters
[in]stringstring to check for content

Definition at line 160 of file IO.f90.

References io_comment, and io_whitespace.

Referenced by list::add(), damask_spectral(), debug::debug_init(), numerics::numerics_init(), and unittest().

+ Here is the caller graph for this function:

◆ io_lc()

pure character(len=len(string)) function, public io::io_lc ( character(len=*), intent(in)  string)

changes characters in string to lower case

Parameters
[in]stringstring to convert

Definition at line 280 of file IO.f90.

Referenced by list::add(), config::config_init(), damask_spectral(), debug::debug_init(), lattice::equivalent_mu(), lattice::equivalent_nu(), numerics::numerics_init(), discretization_grid::readgeom(), and spectral_utilities::utilities_init().

+ Here is the caller graph for this function:

◆ io_open_binary()

integer function, public io::io_open_binary ( character(len=*), intent(in)  fileName,
character, intent(in), optional  mode 
)

opens an existing file for reading or a new file for writing.

replaces an existing file when writing

Definition at line 128 of file IO.f90.

References io_error().

Referenced by spectral_utilities::utilities_savereferencestiffness().

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

◆ io_read_ascii()

character(len=pstringlen) function, dimension(:), allocatable, public io::io_read_ascii ( character(len=*), intent(in)  fileName)

reads an entire ASCII file into an array

Returns
file content, separated per lines

Definition at line 61 of file IO.f90.

References io_eol, io_error(), io_warning(), and prec::pstringlen.

Referenced by config::config_init(), damask_spectral(), debug::debug_init(), and numerics::numerics_init().

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

◆ io_stringpos()

pure integer function, dimension(:), allocatable, public io::io_stringpos ( character(len=*), intent(in)  string)

locates all whitespace-separated chunks in given string and returns array containing number them and the left/right position to be used by IO_xxxVal Array size is dynamically adjusted to number of chunks found in string IMPORTANT: first element contains number of chunks!

Parameters
[in]stringstring in which chunk positions are searched for

Definition at line 204 of file IO.f90.

References io_comment, and io_whitespace.

Referenced by list::add(), damask_spectral(), debug::debug_init(), material::material_parsemicrostructure(), material::material_parsetexture(), numerics::numerics_init(), discretization_grid::readgeom(), and unittest().

+ Here is the caller graph for this function:

◆ io_stringvalue()

character(len=:) function, allocatable, public io::io_stringvalue ( character(len=*), intent(in)  string,
integer, dimension(:), intent(in)  chunkPos,
integer, intent(in)  myChunk 
)

reads string value at myChunk from string

Parameters
[in]stringraw input with known start and end of each chunk
[in]chunkpospositions of start and end of each tag/chunk in given string
[in]mychunkposition number of desired chunk

Definition at line 232 of file IO.f90.

References io_error().

Referenced by list::countkeys(), damask_spectral(), debug::debug_init(), list::getfloat(), list::getfloats(), list::getint(), list::getints(), list::getstring(), list::getstrings(), io_floatvalue(), io_intvalue(), list::keyexists(), material::material_parsemicrostructure(), material::material_parsetexture(), numerics::numerics_init(), and discretization_grid::readgeom().

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

◆ io_warning()

subroutine, public io::io_warning ( integer, intent(in)  warning_ID,
integer, intent(in), optional  el,
integer, intent(in), optional  ip,
integer, intent(in), optional  g,
character(len=*), intent(in), optional  ext_msg 
)

writes warning statement to standard out

Definition at line 535 of file IO.f90.

References io_divider.

Referenced by crystallite::crystallite_stresstangent(), damask_spectral(), io_read_ascii(), read_materialconfig(), and spectral_utilities::utilities_init().

+ Here is the caller graph for this function:

◆ unittest()

subroutine io::unittest
private

check correctness of some IO functions

Definition at line 662 of file IO.f90.

References io_error(), io_floatvalue(), io_intvalue(), io_isblank(), io_stringpos(), verifyfloatvalue(), and verifyintvalue().

Referenced by io_init(), lattice::lattice_init(), math::math_init(), quaternions::quaternions_init(), and rotations::rotations_init().

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

◆ verifyfloatvalue()

real(preal) function io::verifyfloatvalue ( character(len=*), intent(in)  string)
private

returns verified float value in given string

Parameters
[in]stringstring for conversion to float value

Definition at line 641 of file IO.f90.

References io_error().

Referenced by io_floatvalue(), and unittest().

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

◆ verifyintvalue()

integer function io::verifyintvalue ( character(len=*), intent(in)  string)
private

returns verified integer value in given string

Parameters
[in]stringstring for conversion to int value

Definition at line 620 of file IO.f90.

References io_error().

Referenced by io_intvalue(), and unittest().

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

Variable Documentation

◆ io_comment

character, parameter, public io::io_comment = '#'

Definition at line 20 of file IO.f90.

Referenced by io_isblank(), and io_stringpos().

◆ io_divider

character(len=*), parameter, private io::io_divider = '───────────────────'// '───────────────────'// '───────────────────'// '────────────'
private

Definition at line 23 of file IO.f90.

Referenced by io_error(), and io_warning().

◆ io_eof

character(len=*), parameter, public io::io_eof = '#EOF#'

end of file string

Definition at line 17 of file IO.f90.

◆ io_eol

character, parameter, public io::io_eol = new_line('DAMASK')

end of line character

Definition at line 20 of file IO.f90.

Referenced by io_read_ascii(), read_materialconfig(), and discretization_grid::readgeom().

◆ io_whitespace

character(len=*), parameter, public io::io_whitespace = achar(44)//achar(32)//achar(9)//achar(10)//achar(13)

whitespace characters

Definition at line 17 of file IO.f90.

Referenced by io_gettag(), io_isblank(), and io_stringpos().