Skip to content

Commit 2b4ba78

Browse files
committed
small polishing
1 parent bad79ca commit 2b4ba78

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

PRIVATE

src/mesh/DAMASK_mesh.f90

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ program DAMASK_mesh
139139
if (boundary == 0) & ! label not defined in mesh file
140140
call IO_error(812_pI16, 'label', trim(bc_label_name), 'not defined', emph = [2])
141141
if (read_BC_entries(boundary)) & ! duplicated label/tag
142-
call IO_error(812_pI16, 'duplicated entries: label', trim(bc_label_name), "and tag", &
142+
call IO_error(812_pI16, 'duplicated entries: label', trim(bc_label_name), 'and tag', &
143143
mesh_boundariesIS(boundary), emph = [2,4])
144144
read_BC_entries(boundary) = .true.
145145
loadCases(l)%mechBC(boundary)%use_label = .true.
@@ -154,8 +154,7 @@ program DAMASK_mesh
154154
read_BC_entries(boundary) = .true.
155155
loadCases(l)%mechBC(boundary)%use_label = .false.
156156
else
157-
call IO_error(837_pI16, 'entry'//IO_intAsStr(m)//': at least one of &
158-
& "tag/label" required')
157+
call IO_error(812_pI16, 'neither "label" nor "tag" given for boundary condition', m, emph=[2])
159158
end if
160159
mech_u => mech_BC%get_list('dot_u')
161160
do component = 1, dimPlex
@@ -186,11 +185,9 @@ program DAMASK_mesh
186185
skip_T2 = skip_T1+1+floor(log10(real(maxval(mesh_boundariesIS))))+1+1+1 ! T1+"("+NumDigits(floor()+1)+")"+blank
187186
checkLoadcases: do l = 1, size(load_steps)
188187
if (loadCases(l)%N < 1) &
189-
call IO_error(813_pI16, 'loadcase', IO_intAsStr(l)//':', 'N', &
190-
'must be positive', emph = [3])
188+
call IO_error(813_pI16, 'loadcase', l, 'has non-positive number of steps ("N")', emph = [2])
191189
if (loadCases(l)%f_out < 1) &
192-
call IO_error(813_pI16, 'loadcase', IO_intAsStr(l)//':', 'f_out', &
193-
'must be positive', emph = [3])
190+
call IO_error(813_pI16, 'loadcase', l, 'has non-positive output frequency ("f_out")', emph = [2])
194191

195192
print'(/,1x,a,1x,i0)', 'load case:', l
196193
if (.not. loadCases(l)%estimate_rate) print'(2x,a)', 'drop guessing along trajectory'
@@ -208,7 +205,7 @@ program DAMASK_mesh
208205
if (loadCases(l)%mechBC(boundary)%active(component)) &
209206
print'(4x,a,T'//IO_intAsStr(skip_T1)//',a,i0,a,'// &
210207
'T'//IO_intAsStr(skip_T2)//',a,1x,i1,1x,a,1x,f12.7)', &
211-
trim(bc_label_name), "(", mesh_boundariesIS(boundary), ")", &
208+
trim(bc_label_name), '(', mesh_boundariesIS(boundary), ')', &
212209
'Component', component, &
213210
'Value', loadCases(l)%mechBC(boundary)%dot_u(component)
214211
end do

src/mesh/FEM_utilities.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ subroutine FEM_utilities_init(num_mesh)
8181
character(len=:), allocatable :: &
8282
PETSc_options
8383
integer :: &
84-
p_s, & ! order of shape functions
85-
p_i ! integration order (quadrature rule)
84+
p_s, & !< order of shape functions
85+
p_i !< integration order (quadrature rule)
8686
PetscErrorCode :: err_PETSc
8787

8888

src/mesh/discretization_mesh.f90

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
33
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
44
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
5-
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
5+
!> @author Javier Velo, KU Leuven
66
!--------------------------------------------------------------------------------------------------
77
module discretization_mesh
88
#include <petsc/finclude/petscdmplex.h>
@@ -71,14 +71,13 @@ module discretization_mesh
7171
PETSC_BC_TYPE_CELL = 1, &
7272
PETSC_BC_TYPE_FACE = 2, &
7373
PETSC_BC_TYPE_EDGE = 3, &
74-
PETSC_BC_TYPE_VERTEX = 4, &
75-
N_PETSC_BC_TYPES = 4
74+
PETSC_BC_TYPE_VERTEX = 4
7675

77-
integer, dimension(N_PETSC_BC_TYPES), parameter, public :: &
76+
integer, dimension(*), parameter, public :: &
7877
PETSC_BC_TYPES = [PETSC_BC_TYPE_CELL, PETSC_BC_TYPE_FACE, &
7978
PETSC_BC_TYPE_EDGE, PETSC_BC_TYPE_VERTEX]
8079

81-
character(len=*), dimension(N_PETSC_BC_TYPES), parameter, public :: &
80+
character(len=*), dimension(size(PETSC_BC_TYPES)), parameter, public :: &
8281
PETSC_GENERIC_LABELS = ['Cell Sets ', 'Face Sets ', 'Edge Sets ', 'Vertex Sets'] ! PETSc generic labels
8382

8483
DM, public :: geomMesh
@@ -152,8 +151,7 @@ subroutine discretization_mesh_init()
152151

153152
character(pSTRLEN) :: &
154153
bc_label ! label (string, defined in mesh file)
155-
character(len=*), dimension(4), parameter :: &
156-
PETSC_GENERIC_LABELS = ['Cell Sets ', 'Face Sets ', 'Edge Sets ', 'Vertex Sets'] ! PETSc generic labels
154+
157155

158156
print'(/,1x,a)', '<<<+- discretization_mesh init -+>>>'
159157

@@ -188,7 +186,7 @@ subroutine discretization_mesh_init()
188186
if (.not. isSimplex) p_i = p_i + 1_pPETSCINT ! adjust for quad/hex (non-simplex)
189187
#endif
190188

191-
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>=24)
189+
#if (PETSC_VERSION_MINOR>=24)
192190
! check invalid mesh (mixed or unsupported elements)
193191
call DMGetLabelIdIS(globalMesh, 'celltype', celltype_IS, err_PETSc)
194192
call ISGetSize(celltype_IS, nPolytopes, err_PETSc)
@@ -432,7 +430,7 @@ function build_coordinates_IP(dimPlex,qPoints) result(x_p)
432430
real(pREAL), dimension(:,:,:), allocatable :: x_p
433431

434432

435-
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>=24)
433+
#if (PETSC_VERSION_MINOR>=24)
436434
PetscReal, pointer, dimension(:) :: pV0, pCellJ, pInvcellJ, pDetJ
437435
#else
438436
PetscReal, pointer, dimension(:) :: pV0, pCellJ, pInvcellJ

0 commit comments

Comments
 (0)