Merge branch 'development' into docstring-sphinx-adjustments

This commit is contained in:
Martin Diehl 2020-05-17 00:10:58 +02:00
commit 2550447169
34 changed files with 376 additions and 235 deletions

View File

@ -108,9 +108,9 @@ if (DAMASK_SOLVER STREQUAL "grid")
project (damask-grid Fortran C) project (damask-grid Fortran C)
add_definitions (-DGrid) add_definitions (-DGrid)
message ("Building Grid Solver\n") message ("Building Grid Solver\n")
elseif (DAMASK_SOLVER STREQUAL "fem" OR DAMASK_SOLVER STREQUAL "mesh") elseif (DAMASK_SOLVER STREQUAL "mesh")
project (damask-mesh Fortran C) project (damask-mesh Fortran C)
add_definitions (-DFEM) add_definitions (-DMesh)
message ("Building Mesh Solver\n") message ("Building Mesh Solver\n")
else () else ()
message (FATAL_ERROR "Build target (DAMASK_SOLVER) is not defined") message (FATAL_ERROR "Build target (DAMASK_SOLVER) is not defined")

View File

@ -2,19 +2,23 @@ SHELL = /bin/sh
######################################################################################## ########################################################################################
# Makefile for the installation of DAMASK # Makefile for the installation of DAMASK
######################################################################################## ########################################################################################
DAMASK_ROOT = $(shell python -c "import os,sys; print(os.path.normpath(os.path.realpath(os.path.expanduser('$(pwd)'))))") DAMASK_ROOT = $(shell python3 -c "import os,sys; print(os.path.normpath(os.path.realpath(os.path.expanduser('$(pwd)'))))")
.PHONY: all .PHONY: all
all: grid mesh processing all: grid mesh processing
.PHONY: grid .PHONY: grid
grid: build/grid grid: build/grid
@(cd build/grid;make -j${DAMASK_NUM_THREADS} all install;) @(cd build/grid;make -j${DAMASK_NUM_THREADS} all install;)
@rm -f ${DAMASK_ROOT}/bin/DAMASK_spectral > /dev/null || true
@ln -s ${DAMASK_ROOT}/bin/DAMASK_grid ${DAMASK_ROOT}/bin/DAMASK_spectral || true
.PHONY: spectral .PHONY: spectral
spectral: grid spectral: grid
.PHONY: mesh .PHONY: mesh
mesh: build/mesh mesh: build/mesh
@(cd build/mesh; make -j${DAMASK_NUM_THREADS} all install;) @(cd build/mesh; make -j${DAMASK_NUM_THREADS} all install;)
@rm -f ${DAMASK_ROOT}/bin/DAMASK_FEM > /dev/null || true
@ln -s ${DAMASK_ROOT}/bin/DAMASK_mesh ${DAMASK_ROOT}/bin/DAMASK_FEM || true
.PHONY: FEM .PHONY: FEM
FEM: mesh FEM: mesh

@ -1 +1 @@
Subproject commit c595994cd8880acadf50b5dedb79156d04d35b91 Subproject commit 72d526e5750366a9efe4d1fd9d92e0d1ecd2cd38

View File

@ -14,7 +14,7 @@ elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
set (OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -ftree-vectorize") set (OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -ftree-vectorize")
endif () endif ()
set (STANDARD_CHECK "-std=f2008ts -pedantic-errors" ) set (STANDARD_CHECK "-std=f2018 -pedantic-errors" )
set (LINKER_FLAGS "${LINKER_FLAGS} -Wl") set (LINKER_FLAGS "${LINKER_FLAGS} -Wl")
# options parsed directly to the linker # options parsed directly to the linker
set (LINKER_FLAGS "${LINKER_FLAGS},-undefined,dynamic_lookup" ) set (LINKER_FLAGS "${LINKER_FLAGS},-undefined,dynamic_lookup" )
@ -25,6 +25,9 @@ set (LINKER_FLAGS "${LINKER_FLAGS},-undefined,dynamic_lookup" )
set (COMPILE_FLAGS "${COMPILE_FLAGS} -xf95-cpp-input") set (COMPILE_FLAGS "${COMPILE_FLAGS} -xf95-cpp-input")
# preprocessor # preprocessor
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC -fPIE")
# position independent code
set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffree-line-length-132") set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffree-line-length-132")
# restrict line length to the standard 132 characters (lattice.f90 require more characters) # restrict line length to the standard 132 characters (lattice.f90 require more characters)

2
env/DAMASK.csh vendored
View File

@ -3,7 +3,7 @@
set CALLED=($_) set CALLED=($_)
set ENV_ROOT=`dirname $CALLED[2]` set ENV_ROOT=`dirname $CALLED[2]`
set DAMASK_ROOT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $ENV_ROOT"/../"` set DAMASK_ROOT=`python3 -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $ENV_ROOT"/../"`
source $ENV_ROOT/CONFIG source $ENV_ROOT/CONFIG

2
env/DAMASK.sh vendored
View File

@ -2,7 +2,7 @@
# usage: source DAMASK.sh # usage: source DAMASK.sh
function canonicalPath { function canonicalPath {
python -c "import os,sys; print(os.path.normpath(os.path.realpath(os.path.expanduser(sys.argv[1]))))" $1 python3 -c "import os,sys; print(os.path.normpath(os.path.realpath(os.path.expanduser(sys.argv[1]))))" $1
} }
function blink { function blink {

2
env/DAMASK.zsh vendored
View File

@ -2,7 +2,7 @@
# usage: source DAMASK.zsh # usage: source DAMASK.zsh
function canonicalPath { function canonicalPath {
python -c "import os,sys; print(os.path.normpath(os.path.realpath(os.path.expanduser(sys.argv[1]))))" $1 python3 -c "import os,sys; print(os.path.normpath(os.path.realpath(os.path.expanduser(sys.argv[1]))))" $1
} }
function blink { function blink {

View File

@ -1,3 +0,0 @@
hydrogenflux cahnhilliard
initialHydrogenConc 0.0
(output) hydrogenconc

View File

@ -2,6 +2,8 @@ import multiprocessing
import re import re
import glob import glob
import os import os
import xml.etree.ElementTree as ET
import xml.dom.minidom
from functools import partial from functools import partial
import h5py import h5py
@ -65,6 +67,10 @@ class Result:
self.materialpoints = [m.decode() for m in np.unique(f['mapping/cellResults/materialpoint']['Name'])] self.materialpoints = [m.decode() for m in np.unique(f['mapping/cellResults/materialpoint']['Name'])]
self.constituents = [c.decode() for c in np.unique(f['mapping/cellResults/constituent'] ['Name'])] self.constituents = [c.decode() for c in np.unique(f['mapping/cellResults/constituent'] ['Name'])]
# faster, but does not work with (deprecated) DADF5_postResults
#self.materialpoints = [m for m in f['inc0/materialpoint']]
#self.constituents = [c for c in f['inc0/constituent']]
self.con_physics = [] self.con_physics = []
for c in self.constituents: for c in self.constituents:
self.con_physics += f['/'.join([self.increments[0],'constituent',c])].keys() self.con_physics += f['/'.join([self.increments[0],'constituent',c])].keys()
@ -80,7 +86,7 @@ class Result:
'con_physics': self.con_physics, 'mat_physics': self.mat_physics 'con_physics': self.con_physics, 'mat_physics': self.mat_physics
} }
self.fname = fname self.fname = os.path.abspath(fname)
def __repr__(self): def __repr__(self):
@ -1036,6 +1042,102 @@ class Result:
pool.join() pool.join()
def write_XMDF(self):
"""
Write XDMF file to directly visualize data in DADF5 file.
This works only for scalar, 3-vector and 3x3-tensor data.
Selection is not taken into account.
"""
if len(self.constituents) != 1 or not self.structured:
raise NotImplementedError
xdmf=ET.Element('Xdmf')
xdmf.attrib={'Version': '2.0',
'xmlns:xi': 'http://www.w3.org/2001/XInclude'}
domain=ET.SubElement(xdmf, 'Domain')
collection = ET.SubElement(domain, 'Grid')
collection.attrib={'GridType': 'Collection',
'CollectionType': 'Temporal'}
time = ET.SubElement(collection, 'Time')
time.attrib={'TimeType': 'List'}
time_data = ET.SubElement(time, 'DataItem')
time_data.attrib={'Format': 'XML',
'NumberType': 'Float',
'Dimensions': '{}'.format(len(self.times))}
time_data.text = ' '.join(map(str,self.times))
attributes = []
data_items = []
for inc in self.increments:
grid=ET.SubElement(collection,'Grid')
grid.attrib = {'GridType': 'Uniform',
'Name': inc}
topology=ET.SubElement(grid, 'Topology')
topology.attrib={'TopologyType': '3DCoRectMesh',
'Dimensions': '{} {} {}'.format(*self.grid+1)}
geometry=ET.SubElement(grid, 'Geometry')
geometry.attrib={'GeometryType':'Origin_DxDyDz'}
origin=ET.SubElement(geometry, 'DataItem')
origin.attrib={'Format': 'XML',
'NumberType': 'Float',
'Dimensions': '3'}
origin.text="{} {} {}".format(*self.origin)
delta=ET.SubElement(geometry, 'DataItem')
delta.attrib={'Format': 'XML',
'NumberType': 'Float',
'Dimensions': '3'}
delta.text="{} {} {}".format(*(self.size/self.grid))
with h5py.File(self.fname,'r') as f:
attributes.append(ET.SubElement(grid, 'Attribute'))
attributes[-1].attrib={'Name': 'u',
'Center': 'Node',
'AttributeType': 'Vector'}
data_items.append(ET.SubElement(attributes[-1], 'DataItem'))
data_items[-1].attrib={'Format': 'HDF',
'Precision': '8',
'Dimensions': '{} {} {} 3'.format(*(self.grid+1))}
data_items[-1].text='{}:/{}/geometry/u_n'.format(os.path.split(self.fname)[1],inc)
for o,p in zip(['constituents','materialpoints'],['con_physics','mat_physics']):
for oo in getattr(self,o):
for pp in getattr(self,p):
g = '/'.join([inc,o[:-1],oo,pp])
for l in f[g]:
name = '/'.join([g,l])
shape = f[name].shape[1:]
dtype = f[name].dtype
prec = f[name].dtype.itemsize
if (shape not in [(1,), (3,), (3,3)]) or dtype != np.float64: continue
attributes.append(ET.SubElement(grid, 'Attribute'))
attributes[-1].attrib={'Name': '{}'.format(name.split('/',2)[2]),
'Center': 'Cell',
'AttributeType': 'Tensor'}
data_items.append(ET.SubElement(attributes[-1], 'DataItem'))
data_items[-1].attrib={'Format': 'HDF',
'NumberType': 'Float',
'Precision': '{}'.format(prec),
'Dimensions': '{} {} {} {}'.format(*self.grid,np.prod(shape))}
data_items[-1].text='{}:{}'.format(os.path.split(self.fname)[1],name)
with open(os.path.splitext(self.fname)[0]+'.xdmf','w') as f:
f.write(xml.dom.minidom.parseString(ET.tostring(xdmf).decode()).toprettyxml())
def to_vtk(self,labels=[],mode='cell'): def to_vtk(self,labels=[],mode='cell'):
""" """
Export to vtk cell/point data. Export to vtk cell/point data.

View File

@ -238,12 +238,13 @@ def cell_coord0_gridSizeOrigin(coord0,ordered=True):
start = origin + delta*.5 start = origin + delta*.5
end = origin - delta*.5 + size end = origin - delta*.5 + size
if not (_np.allclose(coords[0],_np.linspace(start[0],end[0],grid[0])) and \ atol = _np.max(size)*5e-2
_np.allclose(coords[1],_np.linspace(start[1],end[1],grid[1])) and \ if not (_np.allclose(coords[0],_np.linspace(start[0],end[0],grid[0]),atol=atol) and \
_np.allclose(coords[2],_np.linspace(start[2],end[2],grid[2]))): _np.allclose(coords[1],_np.linspace(start[1],end[1],grid[1]),atol=atol) and \
_np.allclose(coords[2],_np.linspace(start[2],end[2],grid[2]),atol=atol)):
raise ValueError('Regular grid spacing violated.') raise ValueError('Regular grid spacing violated.')
if ordered and not _np.allclose(coord0.reshape(tuple(grid)+(3,),order='F'),cell_coord0(grid,size,origin)): if ordered and not _np.allclose(coord0.reshape(tuple(grid)+(3,),order='F'),cell_coord0(grid,size,origin),atol=atol):
raise ValueError('Input data is not ordered (x fast, z slow).') raise ValueError('Input data is not ordered (x fast, z slow).')
return (grid,size,origin) return (grid,size,origin)
@ -360,7 +361,7 @@ def node_2_cell(node_data):
+ _np.roll(node_data,1,(0,)) + _np.roll(node_data,1,(1,)) + _np.roll(node_data,1,(2,)) + _np.roll(node_data,1,(0,)) + _np.roll(node_data,1,(1,)) + _np.roll(node_data,1,(2,))
+ _np.roll(node_data,1,(0,1)) + _np.roll(node_data,1,(1,2)) + _np.roll(node_data,1,(2,0)))*0.125 + _np.roll(node_data,1,(0,1)) + _np.roll(node_data,1,(1,2)) + _np.roll(node_data,1,(2,0)))*0.125
return c[:-1,:-1,:-1] return c[1:,1:,1:]
def node_coord0_gridSizeOrigin(coord0,ordered=True): def node_coord0_gridSizeOrigin(coord0,ordered=True):
@ -385,12 +386,13 @@ def node_coord0_gridSizeOrigin(coord0,ordered=True):
if (grid+1).prod() != len(coord0): if (grid+1).prod() != len(coord0):
raise ValueError('Data count {} does not match grid {}.'.format(len(coord0),grid)) raise ValueError('Data count {} does not match grid {}.'.format(len(coord0),grid))
if not (_np.allclose(coords[0],_np.linspace(mincorner[0],maxcorner[0],grid[0]+1)) and \ atol = _np.max(size)*5e-2
_np.allclose(coords[1],_np.linspace(mincorner[1],maxcorner[1],grid[1]+1)) and \ if not (_np.allclose(coords[0],_np.linspace(mincorner[0],maxcorner[0],grid[0]+1),atol=atol) and \
_np.allclose(coords[2],_np.linspace(mincorner[2],maxcorner[2],grid[2]+1))): _np.allclose(coords[1],_np.linspace(mincorner[1],maxcorner[1],grid[1]+1),atol=atol) and \
_np.allclose(coords[2],_np.linspace(mincorner[2],maxcorner[2],grid[2]+1),atol=atol)):
raise ValueError('Regular grid spacing violated.') raise ValueError('Regular grid spacing violated.')
if ordered and not _np.allclose(coord0.reshape(tuple(grid+1)+(3,),order='F'),node_coord0(grid,size,origin)): if ordered and not _np.allclose(coord0.reshape(tuple(grid+1)+(3,),order='F'),node_coord0(grid,size,origin),atol=atol):
raise ValueError('Input data is not ordered (x fast, z slow).') raise ValueError('Input data is not ordered (x fast, z slow).')
return (grid,size,origin) return (grid,size,origin)

View File

@ -112,8 +112,8 @@ def execute(cmd,
""" """
initialPath = os.getcwd() initialPath = os.getcwd()
os.chdir(wd)
myEnv = os.environ if env is None else env myEnv = os.environ if env is None else env
os.chdir(wd)
process = subprocess.Popen(shlex.split(cmd), process = subprocess.Popen(shlex.split(cmd),
stdout = subprocess.PIPE, stdout = subprocess.PIPE,
stderr = subprocess.PIPE, stderr = subprocess.PIPE,
@ -121,9 +121,9 @@ def execute(cmd,
env = myEnv) env = myEnv)
out,error = [i for i in (process.communicate() if streamIn is None out,error = [i for i in (process.communicate() if streamIn is None
else process.communicate(streamIn.read().encode('utf-8')))] else process.communicate(streamIn.read().encode('utf-8')))]
os.chdir(initialPath)
out = out.decode('utf-8').replace('\x08','') out = out.decode('utf-8').replace('\x08','')
error = error.decode('utf-8').replace('\x08','') error = error.decode('utf-8').replace('\x08','')
os.chdir(initialPath)
if process.returncode != 0: if process.returncode != 0:
raise RuntimeError('{} failed with returncode {}'.format(cmd,process.returncode)) raise RuntimeError('{} failed with returncode {}'.format(cmd,process.returncode))
return out,error return out,error

View File

@ -75,6 +75,11 @@ class TestTable:
d=default.get('F') d=default.get('F')
assert np.allclose(d,0.0) and d.shape[1:] == (3,3) assert np.allclose(d,0.0) and d.shape[1:] == (3,3)
def test_set_component(self,default):
default.set('1_F',np.zeros((5)),'set to zero')
d=default.get('F')
assert np.allclose(d[...,0,0],0.0) and d.shape[1:] == (3,3)
def test_labels(self,default): def test_labels(self,default):
assert default.labels == ['F','v','s'] assert default.labels == ['F','v','s']

View File

@ -42,12 +42,25 @@ class TestGridFilters:
assert np.allclose(grid_filters.node_displacement_fluct(size,F), assert np.allclose(grid_filters.node_displacement_fluct(size,F),
grid_filters.cell_2_node(grid_filters.cell_displacement_fluct(size,F))) grid_filters.cell_2_node(grid_filters.cell_displacement_fluct(size,F)))
def test_interpolation_nonperiodic(self): def test_interpolation_to_node(self):
size = np.random.random(3) size = np.random.random(3)
grid = np.random.randint(8,32,(3)) grid = np.random.randint(8,32,(3))
F = np.random.random(tuple(grid)+(3,3)) F = np.random.random(tuple(grid)+(3,3))
assert np.allclose(grid_filters.node_coord(size,F) [1:-1,1:-1,1:-1],grid_filters.cell_2_node( assert np.allclose(grid_filters.node_coord(size,F) [1:-1,1:-1,1:-1],
grid_filters.cell_coord(size,F))[1:-1,1:-1,1:-1]) grid_filters.cell_2_node(grid_filters.cell_coord(size,F))[1:-1,1:-1,1:-1])
def test_interpolation_to_cell(self):
grid = np.random.randint(1,30,(3))
node_coord_x = np.linspace(0,np.pi*2,num=grid[0]+1)
node_field_x = np.cos(node_coord_x)
node_field = np.broadcast_to(node_field_x.reshape(-1,1,1),grid+1)
cell_coord_x = node_coord_x[:-1]+node_coord_x[1]*.5
cell_field_x = np.interp(cell_coord_x,node_coord_x,node_field_x,period=np.pi*2.)
cell_field = np.broadcast_to(cell_field_x.reshape(-1,1,1),grid)
assert np.allclose(cell_field,grid_filters.node_2_cell(node_field))
@pytest.mark.parametrize('mode',['cell','node']) @pytest.mark.parametrize('mode',['cell','node'])
def test_coord0_origin(self,mode): def test_coord0_origin(self,mode):

View File

@ -17,10 +17,10 @@ if (PROJECT_NAME STREQUAL "damask-grid")
file(GLOB grid-sources grid/*.f90) file(GLOB grid-sources grid/*.f90)
if(NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY") if(NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
add_executable(DAMASK_spectral ${damask-sources} ${grid-sources}) add_executable(DAMASK_grid ${damask-sources} ${grid-sources})
install (TARGETS DAMASK_spectral RUNTIME DESTINATION bin) install (TARGETS DAMASK_grid RUNTIME DESTINATION bin)
else() else()
add_library(DAMASK_spectral OBJECT ${damask-sources} ${grid-sources}) add_library(DAMASK_grid OBJECT ${damask-sources} ${grid-sources})
exec_program (mktemp OUTPUT_VARIABLE nothing) exec_program (mktemp OUTPUT_VARIABLE nothing)
exec_program (mktemp ARGS -d OUTPUT_VARIABLE black_hole) exec_program (mktemp ARGS -d OUTPUT_VARIABLE black_hole)
install (PROGRAMS ${nothing} DESTINATION ${black_hole}) install (PROGRAMS ${nothing} DESTINATION ${black_hole})
@ -30,7 +30,7 @@ elseif (PROJECT_NAME STREQUAL "damask-mesh")
file(GLOB mesh-sources mesh/*.f90) file(GLOB mesh-sources mesh/*.f90)
add_executable(DAMASK_FEM ${damask-sources} ${mesh-sources}) add_executable(DAMASK_mesh ${damask-sources} ${mesh-sources})
install (TARGETS DAMASK_FEM RUNTIME DESTINATION bin) install (TARGETS DAMASK_mesh RUNTIME DESTINATION bin)
endif() endif()

View File

@ -85,10 +85,10 @@ subroutine CPFEM_initAll(el,ip)
call rotations_init call rotations_init
call YAML_types_init call YAML_types_init
call HDF5_utilities_init call HDF5_utilities_init
call results_init call results_init(.false.)
call discretization_marc_init(ip, el) call discretization_marc_init(ip, el)
call lattice_init call lattice_init
call material_init call material_init(.false.)
call constitutive_init call constitutive_init
call crystallite_init call crystallite_init
call homogenization_init call homogenization_init

View File

@ -22,7 +22,7 @@ module CPFEM2
use homogenization use homogenization
use constitutive use constitutive
use crystallite use crystallite
#if defined(FEM) #if defined(Mesh)
use FEM_quadrature use FEM_quadrature
use discretization_mesh use discretization_mesh
#elif defined(Grid) #elif defined(Grid)
@ -43,7 +43,7 @@ subroutine CPFEM_initAll
call DAMASK_interface_init ! Spectral and FEM interface to commandline call DAMASK_interface_init ! Spectral and FEM interface to commandline
call prec_init call prec_init
call IO_init call IO_init
#ifdef FEM #ifdef Mesh
call FEM_quadrature_init call FEM_quadrature_init
#endif #endif
call numerics_init call numerics_init
@ -54,13 +54,13 @@ subroutine CPFEM_initAll
call YAML_types_init call YAML_types_init
call lattice_init call lattice_init
call HDF5_utilities_init call HDF5_utilities_init
call results_init call results_init(restart=interface_restartInc>0)
#if defined(FEM) #if defined(Mesh)
call discretization_mesh_init call discretization_mesh_init(restart=interface_restartInc>0)
#elif defined(Grid) #elif defined(Grid)
call discretization_grid_init call discretization_grid_init(restart=interface_restartInc>0)
#endif #endif
call material_init call material_init(restart=interface_restartInc>0)
call constitutive_init call constitutive_init
call crystallite_init call crystallite_init
call homogenization_init call homogenization_init

View File

@ -106,7 +106,7 @@ subroutine DAMASK_interface_init
typeSize typeSize
integer, dimension(8) :: & integer, dimension(8) :: &
dateAndTime dateAndTime
integer :: mpi_err integer :: err
PetscErrorCode :: petsc_err PetscErrorCode :: petsc_err
external :: & external :: &
quit quit
@ -118,8 +118,8 @@ subroutine DAMASK_interface_init
#ifdef _OPENMP #ifdef _OPENMP
! If openMP is enabled, check if the MPI libary supports it and initialize accordingly. ! If openMP is enabled, check if the MPI libary supports it and initialize accordingly.
! Otherwise, the first call to PETSc will do the initialization. ! Otherwise, the first call to PETSc will do the initialization.
call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,mpi_err) call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,err)
if (mpi_err /= 0) call quit(1) if (err /= 0) call quit(1)
if (threadLevel<MPI_THREAD_FUNNELED) then if (threadLevel<MPI_THREAD_FUNNELED) then
write(6,'(/,a)') ' ERROR: MPI library does not support OpenMP' write(6,'(/,a)') ' ERROR: MPI library does not support OpenMP'
call quit(1) call quit(1)
@ -128,10 +128,10 @@ subroutine DAMASK_interface_init
call PETScInitializeNoArguments(petsc_err) ! according to PETSc manual, that should be the first line in the code call PETScInitializeNoArguments(petsc_err) ! according to PETSc manual, that should be the first line in the code
CHKERRQ(petsc_err) ! this is a macro definition, it is case sensitive CHKERRQ(petsc_err) ! this is a macro definition, it is case sensitive
call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,mpi_err) call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,err)
if (mpi_err /= 0) call quit(1) if (err /= 0) call quit(1)
call MPI_Comm_size(PETSC_COMM_WORLD,worldsize,mpi_err) call MPI_Comm_size(PETSC_COMM_WORLD,worldsize,err)
if (mpi_err /= 0) call quit(1) if (err /= 0) call quit(1)
mainProcess: if (worldrank == 0) then mainProcess: if (worldrank == 0) then
if (output_unit /= 6) then if (output_unit /= 6) then
@ -181,22 +181,23 @@ subroutine DAMASK_interface_init
write(6,'(/,a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1) write(6,'(/,a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1)
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7) write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7)
call MPI_Type_size(MPI_INTEGER,typeSize,mpi_err) call MPI_Type_size(MPI_INTEGER,typeSize,err)
if (mpi_err /= 0) call quit(1) if (err /= 0) call quit(1)
if (typeSize*8 /= bit_size(0)) then if (typeSize*8 /= bit_size(0)) then
write(6,'(a)') ' Mismatch between MPI and DAMASK integer' write(6,'(a)') ' Mismatch between MPI and DAMASK integer'
call quit(1) call quit(1)
endif endif
call MPI_Type_size(MPI_DOUBLE,typeSize,mpi_err) call MPI_Type_size(MPI_DOUBLE,typeSize,err)
if (mpi_err /= 0) call quit(1) if (err /= 0) call quit(1)
if (typeSize*8 /= storage_size(0.0_pReal)) then if (typeSize*8 /= storage_size(0.0_pReal)) then
write(6,'(a)') ' Mismatch between MPI and DAMASK real' write(6,'(a)') ' Mismatch between MPI and DAMASK real'
call quit(1) call quit(1)
endif endif
do i = 1, command_argument_count() do i = 1, command_argument_count()
call get_command_argument(i,arg) call get_command_argument(i,arg,status=err)
if (err /= 0) call quit(1)
select case(trim(arg)) ! extract key select case(trim(arg)) ! extract key
case ('-h','--help') case ('-h','--help')
write(6,'(a)') ' #######################################################################' write(6,'(a)') ' #######################################################################'
@ -206,7 +207,7 @@ subroutine DAMASK_interface_init
write(6,'(a,/)')' Valid command line switches:' write(6,'(a,/)')' Valid command line switches:'
write(6,'(a)') ' --geom (-g, --geometry)' write(6,'(a)') ' --geom (-g, --geometry)'
write(6,'(a)') ' --load (-l, --loadcase)' write(6,'(a)') ' --load (-l, --loadcase)'
write(6,'(a)') ' --workingdir (-w, --wd, --workingdirectory, -d, --directory)' write(6,'(a)') ' --workingdir (-w, --wd, --workingdirectory)'
write(6,'(a)') ' --restart (-r, --rs)' write(6,'(a)') ' --restart (-r, --rs)'
write(6,'(a)') ' --help (-h)' write(6,'(a)') ' --help (-h)'
write(6,'(/,a)')' -----------------------------------------------------------------------' write(6,'(/,a)')' -----------------------------------------------------------------------'
@ -223,12 +224,12 @@ subroutine DAMASK_interface_init
write(6,'(a)') ' directory.' write(6,'(a)') ' directory.'
write(6,'(a)') ' For further configuration place "numerics.config"' write(6,'(a)') ' For further configuration place "numerics.config"'
write(6,'(a)')' and "debug.config" in that directory.' write(6,'(a)')' and "debug.config" in that directory.'
write(6,'(/,a)')' --restart XX' write(6,'(/,a)')' --restart N'
write(6,'(a)') ' Reads in increment XX and continues with calculating' write(6,'(a)') ' Reads in increment N and continues with calculating'
write(6,'(a)') ' increment XX+1 based on this.' write(6,'(a)') ' increment N+1 based on this.'
write(6,'(a)') ' Appends to existing results file' write(6,'(a)') ' Appends to existing results file'
write(6,'(a)') ' "NameOfGeom_NameOfLoadFile".' write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.hdf5".'
write(6,'(a)') ' Works only if the restart information for increment XX' write(6,'(a)') ' Works only if the restart information for increment N'
write(6,'(a)') ' is available in the working directory.' write(6,'(a)') ' is available in the working directory.'
write(6,'(/,a)')' -----------------------------------------------------------------------' write(6,'(/,a)')' -----------------------------------------------------------------------'
write(6,'(a)') ' Help:' write(6,'(a)') ' Help:'
@ -236,19 +237,20 @@ subroutine DAMASK_interface_init
write(6,'(a,/)')' Prints this message and exits' write(6,'(a,/)')' Prints this message and exits'
call quit(0) ! normal Termination call quit(0) ! normal Termination
case ('-l', '--load', '--loadcase') case ('-l', '--load', '--loadcase')
call get_command_argument(i+1,loadCaseArg) call get_command_argument(i+1,loadCaseArg,status=err)
case ('-g', '--geom', '--geometry') case ('-g', '--geom', '--geometry')
call get_command_argument(i+1,geometryArg) call get_command_argument(i+1,geometryArg,status=err)
case ('-w', '-d', '--wd', '--directory', '--workingdir', '--workingdirectory') case ('-w', '--wd', '--workingdir', '--workingdirectory')
call get_command_argument(i+1,workingDirArg) call get_command_argument(i+1,workingDirArg,status=err)
case ('-r', '--rs', '--restart') case ('-r', '--rs', '--restart')
call get_command_argument(i+1,arg) call get_command_argument(i+1,arg,status=err)
read(arg,*,iostat=stat) interface_restartInc read(arg,*,iostat=stat) interface_restartInc
if (interface_restartInc < 0 .or. stat /=0) then if (interface_restartInc < 0 .or. stat /=0) then
write(6,'(/,a)') ' ERROR: Could not parse restart increment: '//trim(arg) write(6,'(/,a)') ' ERROR: Could not parse restart increment: '//trim(arg)
call quit(1) call quit(1)
endif endif
end select end select
if (err /= 0) call quit(1)
enddo enddo
if (len_trim(loadcaseArg) == 0 .or. len_trim(geometryArg) == 0) then if (len_trim(loadcaseArg) == 0 .or. len_trim(geometryArg) == 0) then

View File

@ -81,7 +81,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief open libary and do sanity checks !> @brief initialize HDF5 libary and do sanity checks
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine HDF5_utilities_init subroutine HDF5_utilities_init

View File

@ -49,7 +49,7 @@ subroutine IO_init
write(6,'(/,a)') ' <<<+- IO init -+>>>'; flush(6) write(6,'(/,a)') ' <<<+- IO init -+>>>'; flush(6)
call unitTest call selfTest
end subroutine IO_init end subroutine IO_init
@ -696,7 +696,7 @@ end subroutine IO_warning
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief check correctness of some IO functions !> @brief check correctness of some IO functions
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine unitTest subroutine selfTest
integer, dimension(:), allocatable :: chunkPos integer, dimension(:), allocatable :: chunkPos
character(len=:), allocatable :: str character(len=:), allocatable :: str
@ -745,6 +745,6 @@ subroutine unitTest
str = IO_rmComment(' ab #') str = IO_rmComment(' ab #')
if (str /= ' ab'.or. len(str) /= 3) call IO_error(0,ext_msg='IO_rmComment/7') if (str /= ' ab'.or. len(str) /= 3) call IO_error(0,ext_msg='IO_rmComment/7')
end subroutine unitTest end subroutine selfTest
end module IO end module IO

View File

@ -180,7 +180,7 @@ subroutine YAML_types_init
write(6,'(/,a)') ' <<<+- YAML_types init -+>>>' write(6,'(/,a)') ' <<<+- YAML_types init -+>>>'
call unitTest call selfTest
end subroutine YAML_types_init end subroutine YAML_types_init
@ -188,7 +188,7 @@ end subroutine YAML_types_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief check correctness of some type bound procedures !> @brief check correctness of some type bound procedures
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine unitTest subroutine selfTest
class(tNode), pointer :: s1,s2 class(tNode), pointer :: s1,s2
allocate(tScalar::s1) allocate(tScalar::s1)
@ -260,7 +260,7 @@ subroutine unitTest
if(n%get_asString(1) /= 'True') call IO_error(0,ext_msg='byIndex_asString') if(n%get_asString(1) /= 'True') call IO_error(0,ext_msg='byIndex_asString')
end block end block
end subroutine unitTest end subroutine selfTest
!--------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------

View File

@ -160,7 +160,7 @@ module subroutine plastic_phenopowerlaw_init
config%getFloats('interaction_twintwin'), & config%getFloats('interaction_twintwin'), &
config%getString('lattice_structure')) config%getString('lattice_structure'))
prm%gamma_twin_char = lattice_characteristicShear_twin(N_tw,config%getString('lattice_structure'),& prm%gamma_twin_char = lattice_characteristicShear_twin(N_tw,config%getString('lattice_structure'),&
config%getFloat('c/a')) config%getFloat('c/a',defaultVal=0.0_pReal))
xi_twin_0 = config%getFloats('tau0_twin',requiredSize=size(N_tw)) xi_twin_0 = config%getFloats('tau0_twin',requiredSize=size(N_tw))

View File

@ -6,7 +6,7 @@
!> @details doing cutbacking, forwarding in case of restart, reporting statistics, writing !> @details doing cutbacking, forwarding in case of restart, reporting statistics, writing
!> results !> results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
program DAMASK_spectral program DAMASK_grid
#include <petsc/finclude/petscsys.h> #include <petsc/finclude/petscsys.h>
use PETScsys use PETScsys
use prec use prec
@ -495,4 +495,4 @@ program DAMASK_spectral
call quit(0) ! no complains ;) call quit(0) ! no complains ;)
end program DAMASK_spectral end program DAMASK_grid

View File

@ -42,7 +42,9 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief reads the geometry file to obtain information on discretization !> @brief reads the geometry file to obtain information on discretization
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine discretization_grid_init subroutine discretization_grid_init(restart)
logical, intent(in) :: restart
include 'fftw3-mpi.f03' include 'fftw3-mpi.f03'
real(pReal), dimension(3) :: & real(pReal), dimension(3) :: &
@ -100,13 +102,14 @@ subroutine discretization_grid_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! store geometry information for post processing ! store geometry information for post processing
if(.not. restart) then
call results_openJobFile call results_openJobFile
call results_closeGroup(results_addGroup('geometry')) call results_closeGroup(results_addGroup('geometry'))
call results_addAttribute('grid', grid, 'geometry') call results_addAttribute('grid', grid, 'geometry')
call results_addAttribute('size', geomSize,'geometry') call results_addAttribute('size', geomSize,'geometry')
call results_addAttribute('origin',origin, 'geometry') call results_addAttribute('origin',origin, 'geometry')
call results_closeJobFile call results_closeJobFile
endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! geometry information required by the nonlocal CP model ! geometry information required by the nonlocal CP model
call geometry_plastic_nonlocal_setIPvolume(reshape([(product(mySize/real(myGrid,pReal)),j=1,product(myGrid))], & call geometry_plastic_nonlocal_setIPvolume(reshape([(product(mySize/real(myGrid,pReal)),j=1,product(myGrid))], &

View File

@ -529,7 +529,7 @@ subroutine lattice_init
lattice_DamageMobility(p) = config_phase(p)%getFloat('damage_mobility',defaultVal=0.0_pReal) lattice_DamageMobility(p) = config_phase(p)%getFloat('damage_mobility',defaultVal=0.0_pReal)
! SHOULD NOT BE PART OF LATTICE END ! SHOULD NOT BE PART OF LATTICE END
call unitTest call selfTest
enddo enddo
@ -1436,6 +1436,7 @@ function lattice_SchmidMatrix_slip(Nslip,structure,cOverA) result(SchmidMatrix)
NslipMax = BCT_NSLIPSYSTEM NslipMax = BCT_NSLIPSYSTEM
slipSystems = BCT_SYSTEMSLIP slipSystems = BCT_SYSTEMSLIP
case default case default
allocate(NslipMax(0))
call IO_error(137,ext_msg='lattice_SchmidMatrix_slip: '//trim(structure)) call IO_error(137,ext_msg='lattice_SchmidMatrix_slip: '//trim(structure))
end select end select
@ -1485,6 +1486,7 @@ function lattice_SchmidMatrix_twin(Ntwin,structure,cOverA) result(SchmidMatrix)
NtwinMax = HEX_NTWINSYSTEM NtwinMax = HEX_NTWINSYSTEM
twinSystems = HEX_SYSTEMTWIN twinSystems = HEX_SYSTEMTWIN
case default case default
allocate(NtwinMax(0))
call IO_error(137,ext_msg='lattice_SchmidMatrix_twin: '//trim(structure)) call IO_error(137,ext_msg='lattice_SchmidMatrix_twin: '//trim(structure))
end select end select
@ -1564,6 +1566,7 @@ function lattice_SchmidMatrix_cleavage(Ncleavage,structure,cOverA) result(Schmid
NcleavageMax = BCC_NCLEAVAGESYSTEM NcleavageMax = BCC_NCLEAVAGESYSTEM
cleavageSystems = BCC_SYSTEMCLEAVAGE cleavageSystems = BCC_SYSTEMCLEAVAGE
case default case default
allocate(NcleavageMax(0))
call IO_error(137,ext_msg='lattice_SchmidMatrix_cleavage: '//trim(structure)) call IO_error(137,ext_msg='lattice_SchmidMatrix_cleavage: '//trim(structure))
end select end select
@ -1919,6 +1922,7 @@ function coordinateSystem_slip(Nslip,structure,cOverA) result(coordinateSystem)
NslipMax = BCT_NSLIPSYSTEM NslipMax = BCT_NSLIPSYSTEM
slipSystems = BCT_SYSTEMSLIP slipSystems = BCT_SYSTEMSLIP
case default case default
allocate(NslipMax(0))
call IO_error(137,ext_msg='coordinateSystem_slip: '//trim(structure)) call IO_error(137,ext_msg='coordinateSystem_slip: '//trim(structure))
end select end select
@ -2291,7 +2295,7 @@ end function equivalent_mu
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief check correctness of some lattice functions !> @brief check correctness of some lattice functions
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine unitTest subroutine selfTest
real(pReal), dimension(:,:,:), allocatable :: CoSy real(pReal), dimension(:,:,:), allocatable :: CoSy
real(pReal), dimension(:,:), allocatable :: system real(pReal), dimension(:,:), allocatable :: system
@ -2304,7 +2308,6 @@ subroutine unitTest
system = reshape([1.0_pReal+r(1),0.0_pReal,0.0_pReal, 0.0_pReal,1.0_pReal+r(2),0.0_pReal],[6,1]) system = reshape([1.0_pReal+r(1),0.0_pReal,0.0_pReal, 0.0_pReal,1.0_pReal+r(2),0.0_pReal],[6,1])
CoSy = buildCoordinateSystem([1],[1],system,'fcc',0.0_pReal) CoSy = buildCoordinateSystem([1],[1],system,'fcc',0.0_pReal)
if(any(dNeq(CoSy(1:3,1:3,1),math_I3))) & if(any(dNeq(CoSy(1:3,1:3,1),math_I3))) &
call IO_error(0) call IO_error(0)
@ -2321,6 +2324,6 @@ subroutine unitTest
if(dNeq(lambda*0.5_pReal/(lambda+equivalent_mu(C,'reuss')),equivalent_nu(C,'reuss'),1.0e-12_pReal)) & if(dNeq(lambda*0.5_pReal/(lambda+equivalent_mu(C,'reuss')),equivalent_nu(C,'reuss'),1.0e-12_pReal)) &
call IO_error(0,ext_msg='equivalent_nu/reuss') call IO_error(0,ext_msg='equivalent_nu/reuss')
end subroutine unitTest end subroutine selfTest
end module lattice end module lattice

View File

@ -207,7 +207,9 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief parses material configuration file !> @brief parses material configuration file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_init subroutine material_init(restart)
logical, intent(in) :: restart
integer :: i,e,m,c,h, myDebug, myPhase, myHomog, myMicro integer :: i,e,m,c,h, myDebug, myPhase, myHomog, myMicro
integer, dimension(:), allocatable :: & integer, dimension(:), allocatable :: &
@ -339,11 +341,12 @@ subroutine material_init
call config_deallocate('material.config/microstructure') call config_deallocate('material.config/microstructure')
call config_deallocate('material.config/texture') call config_deallocate('material.config/texture')
if (.not. restart) then
call results_openJobFile call results_openJobFile
call results_mapping_constituent(material_phaseAt,material_phaseMemberAt,config_name_phase) call results_mapping_constituent(material_phaseAt,material_phaseMemberAt,config_name_phase)
call results_mapping_materialpoint(material_homogenizationAt,material_homogenizationMemberAt,config_name_homogenization) call results_mapping_materialpoint(material_homogenizationAt,material_homogenizationMemberAt,config_name_homogenization)
call results_closeJobFile call results_closeJobFile
endif
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! BEGIN DEPRECATED ! BEGIN DEPRECATED

View File

@ -79,7 +79,7 @@ module math
!--------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------
private :: & private :: &
unitTest selfTest
contains contains
@ -113,7 +113,7 @@ subroutine math_init
call random_seed(put = randInit) call random_seed(put = randInit)
call unitTest call selfTest
end subroutine math_init end subroutine math_init
@ -1192,7 +1192,7 @@ end function math_clip
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief check correctness of some math functions !> @brief check correctness of some math functions
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine unitTest subroutine selfTest
integer, dimension(2,4) :: & integer, dimension(2,4) :: &
sort_in_ = reshape([+1,+5, +5,+6, -1,-1, +3,-2],[2,4]) sort_in_ = reshape([+1,+5, +5,+6, -1,-1, +3,-2],[2,4])
@ -1330,6 +1330,6 @@ subroutine unitTest
if(dNeq0(math_LeviCivita(ijk(1),ijk(2),ijk(3))))& if(dNeq0(math_LeviCivita(ijk(1),ijk(2),ijk(3))))&
call IO_error(0,ext_msg='math_LeviCivita') call IO_error(0,ext_msg='math_LeviCivita')
end subroutine unitTest end subroutine selfTest
end module math end module math

View File

@ -6,7 +6,7 @@
!> @details doing cutbacking, reporting statistics, writing !> @details doing cutbacking, reporting statistics, writing
!> results !> results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
program DAMASK_FEM program DAMASK_mesh
#include <petsc/finclude/petscsys.h> #include <petsc/finclude/petscsys.h>
use PetscDM use PetscDM
use prec use prec
@ -367,4 +367,4 @@ program DAMASK_FEM
call quit(0) ! no complains ;) call quit(0) ! no complains ;)
end program DAMASK_FEM end program DAMASK_mesh

View File

@ -63,7 +63,9 @@ contains
!> @brief initializes the mesh by calling all necessary private routines the mesh module !> @brief initializes the mesh by calling all necessary private routines the mesh module
!! Order and routines strongly depend on type of solver !! Order and routines strongly depend on type of solver
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine discretization_mesh_init subroutine discretization_mesh_init(restart)
logical, intent(in) :: restart
integer, dimension(1), parameter:: FE_geomtype = [1] !< geometry type of particular element type integer, dimension(1), parameter:: FE_geomtype = [1] !< geometry type of particular element type
integer, dimension(1) :: FE_Nips !< number of IPs in a specific type of element integer, dimension(1) :: FE_Nips !< number of IPs in a specific type of element

View File

@ -17,11 +17,9 @@ module mesh_mech_FEM
use prec use prec
use FEM_utilities use FEM_utilities
use discretization_mesh use discretization_mesh
use IO
use DAMASK_interface use DAMASK_interface
use numerics use numerics
use FEM_quadrature use FEM_quadrature
use FEsolving
use homogenization use homogenization
use math use math

View File

@ -63,8 +63,8 @@ module numerics
#endif #endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! FEM parameters: ! Mesh parameters:
#ifdef FEM #ifdef Mesh
integer, protected, public :: & integer, protected, public :: &
integrationOrder = 2, & !< order of quadrature rule required integrationOrder = 2, & !< order of quadrature rule required
structOrder = 2 !< order of displacement shape functions structOrder = 2 !< order of displacement shape functions
@ -200,8 +200,8 @@ subroutine numerics_init
#endif #endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! FEM parameters ! Mesh parameters
#ifdef FEM #ifdef Mesh
case ('integrationorder') case ('integrationorder')
integrationorder = IO_intValue(line,chunkPos,2) integrationorder = IO_intValue(line,chunkPos,2)
case ('structorder') case ('structorder')
@ -267,7 +267,7 @@ subroutine numerics_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! spectral parameters ! spectral parameters
#ifdef FEM #ifdef Mesh
write(6,'(a24,1x,i8)') ' integrationOrder: ',integrationOrder write(6,'(a24,1x,i8)') ' integrationOrder: ',integrationOrder
write(6,'(a24,1x,i8)') ' structOrder: ',structOrder write(6,'(a24,1x,i8)') ' structOrder: ',structOrder
write(6,'(a24,1x,L8)') ' B-Bar stabilisation: ',BBarStabilisation write(6,'(a24,1x,L8)') ' B-Bar stabilisation: ',BBarStabilisation

View File

@ -75,7 +75,7 @@ module prec
emptyStringArray = [character(len=pStringLen)::] emptyStringArray = [character(len=pStringLen)::]
private :: & private :: &
unitTest selfTest
contains contains
@ -94,7 +94,7 @@ subroutine prec_init
write(6,'(a,e10.3)') ' Minimum value: ',tiny(0.0_pReal) write(6,'(a,e10.3)') ' Minimum value: ',tiny(0.0_pReal)
write(6,'(a,i3)') ' Decimal precision: ',precision(0.0_pReal) write(6,'(a,i3)') ' Decimal precision: ',precision(0.0_pReal)
call unitTest call selfTest
end subroutine prec_init end subroutine prec_init
@ -233,7 +233,7 @@ end function cNeq
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief check correctness of some prec functions !> @brief check correctness of some prec functions
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine unitTest subroutine selfTest
integer, allocatable, dimension(:) :: realloc_lhs_test integer, allocatable, dimension(:) :: realloc_lhs_test
real(pReal), dimension(2) :: r real(pReal), dimension(2) :: r
@ -249,6 +249,6 @@ subroutine unitTest
realloc_lhs_test = [1,2] realloc_lhs_test = [1,2]
if (any(realloc_lhs_test/=[1,2])) call quit(9000) if (any(realloc_lhs_test/=[1,2])) call quit(9000)
end subroutine unitTest end subroutine selfTest
end module prec end module prec

View File

@ -112,7 +112,7 @@ contains
subroutine quaternions_init subroutine quaternions_init
write(6,'(/,a)') ' <<<+- quaternions init -+>>>'; flush(6) write(6,'(/,a)') ' <<<+- quaternions init -+>>>'; flush(6)
call unitTest call selfTest
end subroutine quaternions_init end subroutine quaternions_init
@ -457,7 +457,7 @@ end function inverse
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief check correctness of some quaternions functions !> @brief check correctness of some quaternions functions
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine unitTest subroutine selfTest
real(pReal), dimension(4) :: qu real(pReal), dimension(4) :: qu
type(quaternion) :: q, q_2 type(quaternion) :: q, q_2
@ -524,7 +524,7 @@ subroutine unitTest
endif endif
#endif #endif
end subroutine unitTest end subroutine selfTest
end module quaternions end module quaternions

View File

@ -59,7 +59,9 @@ module results
results_mapping_materialpoint results_mapping_materialpoint
contains contains
subroutine results_init subroutine results_init(restart)
logical, intent(in) :: restart
character(len=pStringLen) :: commandLine character(len=pStringLen) :: commandLine
@ -68,6 +70,7 @@ subroutine results_init
write(6,'(/,a)') ' Diehl et al., Integrating Materials and Manufacturing Innovation 6(1):8391, 2017' write(6,'(/,a)') ' Diehl et al., Integrating Materials and Manufacturing Innovation 6(1):8391, 2017'
write(6,'(a)') ' https://doi.org/10.1007/s40192-017-0084-5' write(6,'(a)') ' https://doi.org/10.1007/s40192-017-0084-5'
if(.not. restart) then
resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.) resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.)
call results_addAttribute('DADF5_version_major',0) call results_addAttribute('DADF5_version_major',0)
call results_addAttribute('DADF5_version_minor',6) call results_addAttribute('DADF5_version_minor',6)
@ -77,6 +80,7 @@ subroutine results_init
call results_closeGroup(results_addGroup('mapping')) call results_closeGroup(results_addGroup('mapping'))
call results_closeGroup(results_addGroup('mapping/cellResults')) call results_closeGroup(results_addGroup('mapping/cellResults'))
call results_closeJobFile call results_closeJobFile
endif
end subroutine results_init end subroutine results_init

View File

@ -105,7 +105,7 @@ subroutine rotations_init
call quaternions_init call quaternions_init
write(6,'(/,a)') ' <<<+- rotations init -+>>>'; flush(6) write(6,'(/,a)') ' <<<+- rotations init -+>>>'; flush(6)
call unitTest call selfTest
end subroutine rotations_init end subroutine rotations_init
@ -1340,7 +1340,7 @@ end function GetPyramidOrder
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief check correctness of some rotations functions !> @brief check correctness of some rotations functions
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine unitTest subroutine selfTest
type(rotation) :: R type(rotation) :: R
real(pReal), dimension(4) :: qu, ax, ro real(pReal), dimension(4) :: qu, ax, ro
@ -1443,7 +1443,7 @@ subroutine unitTest
enddo enddo
end subroutine unitTest end subroutine selfTest
end module rotations end module rotations