1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_mech_FEM.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_mech_FEM.f90"
13 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h" 1
21 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h" 1
30 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h" 1
39 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 1
48 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 1
57 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscao.h" 1
66 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 1
75 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 1
88 # 1 "/opt/petsc-3.10.3/Intel-18.4-IntelMPI-2018/include/petscconf.h" 1
1296 # 13 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1301 # 1 "/opt/petsc-3.10.3/include/petscversion.h" 1
1347 # 17 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1349 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h" 1
1366 # 31 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h"
1368 # 18 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1370 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h" 1
1379 # 24 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h"
1381 # 38 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h"
1398 # 19 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1400 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petsclog.h" 1
1403 # 20 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1405 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscbag.h" 1
1418 # 21 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1426 # 41 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1436 # 63 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1450 # 85 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1469 # 128 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1471 # 150 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1475 # 174 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1508 # 215 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1521 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 2
1523 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h" 1
1527 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 2
1549 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscao.h" 2
1559 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 2
1573 # 30 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h"
1577 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 2
1583 # 49 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1597 # 71 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1601 # 115 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1603 # 140 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1614 # 168 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1627 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h" 2
1629 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 1
1638 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 1
1643 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 2
1645 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 1
1650 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 2
1652 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 1
1657 # 11 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 2
1669 # 32 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h"
1672 # 47 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h"
1674 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h" 2
1678 # 26 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h"
1687 # 74 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h"
1689 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h" 2
1694 # 21 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h"
1698 # 57 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h"
1702 # 8 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h" 2
1708 # 30 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h"
1713 # 47 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h"
1737 # 78 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h"
1741 # 9 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_mech_FEM.f90" 2
1743 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 1
1752 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 1
1757 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1759 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 1
1764 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1766 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 1
1771 # 11 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1773 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 1
1778 # 12 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1788 # 39 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h"
1802 # 10 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_mech_FEM.f90" 2
1842 real(
preal),
private,
dimension(3,3) :: &
1851 real(
preal),
private,
dimension(3,3,3,3) :: &
1859 integer,
private :: &
1876 real(
preal) :: hgcoeff = 0.0e-2_preal
1877 integer(kind=selected_int_kind(5)),
dimension(0:worldsize-1) :: localk
1878 real(
preal),
dimension(3,3) :: &
1879 temp33_real = 0.0_preal
1880 real(
preal),
dimension(4,8) :: &
1881 hgcomp = reshape([ 1.0_preal, 1.0_preal, 1.0_preal,-1.0_preal, &
1882 1.0_preal,-1.0_preal,-1.0_preal, 1.0_preal, &
1883 -1.0_preal, 1.0_preal,-1.0_preal, 1.0_preal, &
1884 -1.0_preal,-1.0_preal, 1.0_preal,-1.0_preal, &
1885 -1.0_preal,-1.0_preal, 1.0_preal, 1.0_preal, &
1886 -1.0_preal, 1.0_preal,-1.0_preal,-1.0_preal, &
1887 1.0_preal,-1.0_preal,-1.0_preal,-1.0_preal, &
1888 1.0_preal, 1.0_preal, 1.0_preal, 1.0_preal], [4,8])
1889 integer(kind=selected_int_kind(5)) :: ierr
1890 integer(HID_T) :: filehandle, grouphandle
1891 character(len=pStringLen) :: filename
1892 real(
preal),
dimension(3,3,3,3) :: devnull
1893 real(kind=selected_real_kind(10)),
pointer,
dimension(:,:,:,:) :: &
1896 write(6,
'(/,a)')
' <<<+- grid_mech_FEM init -+>>>';
flush(6)
1900 call petscoptionsinsertstring(petsc_null_options,
'-mech_snes_type newtonls -mech_ksp_type fgmres &
1901 &-mech_ksp_max_it 25 -mech_pc_type ml -mech_mg_levels_ksp_type chebyshev',ierr)
1902 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1903 call petscoptionsinsertstring(petsc_null_options,trim(petsc_options),ierr)
1904 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1914 call snescreate(petsc_comm_world,
mech_snes,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1915 call snessetoptionsprefix(
mech_snes,
'mech_',ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1918 call mpi_allreduce(mpi_in_place,localk,
worldsize,mpi_integer,mpi_sum,petsc_comm_world,ierr)
1919 call dmdacreate3d(petsc_comm_world, &
1920 dm_boundary_periodic, dm_boundary_periodic, dm_boundary_periodic, &
1927 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1929 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1930 call snessetdm(
mech_snes,
mech_grid,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1931 call dmsetfromoptions(
mech_grid,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1932 call dmsetup(
mech_grid,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1935 call dmcreateglobalvector(
mech_grid,
solution_rate ,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1937 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1939 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1940 call snessetconvergencetest(
mech_snes,
converged,petsc_null_snes,petsc_null_function,ierr)
1941 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1942 call snessetmaxlinearsolvefailures(
mech_snes, huge(1), ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1943 call snessetfromoptions(
mech_snes,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1947 call vecset(
solution_current,0.0_preal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1948 call vecset(
solution_lastinc,0.0_preal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1949 call vecset(
solution_rate ,0.0_preal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1950 call dmdavecgetarrayf90(
mech_grid,
solution_current,u_current,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1951 call dmdavecgetarrayf90(
mech_grid,
solution_lastinc,u_lastinc,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1954 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
1970 hgmat = matmul(transpose(hgcomp),hgcomp) &
1976 write(6,
'(/,a,i0,a)')
' reading restart data of increment ',
interface_restartinc,
' from file'
1987 call hdf5_read(grouphandle,u_current,
'u')
1988 call hdf5_read(grouphandle,u_lastinc,
'u_lastInc')
2000 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2002 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2005 write(6,
'(/,a,i0,a)')
' reading more restart data of increment ',
interface_restartinc,
' from file'
2024 character(len=*),
intent(in) :: &
2026 real(
preal),
intent(in) :: &
2027 timeinc, & !< time increment of current solution
2031 type(rotation),
intent(in) :: &
2037 integer(kind=selected_int_kind(5)) :: ierr
2038 integer(kind=selected_int_kind(5)) :: reason
2047 params%stress_mask = stress_bc%maskFloat
2048 params%stress_BC = stress_bc%values
2049 params%rotation_BC = rotation_bc
2051 params%timeincOld = timeinc_old
2055 call snessolve(
mech_snes,petsc_null_vec,
solution_current,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2059 call snesgetconvergedreason(
mech_snes,reason,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2061 solution%converged = reason > 0
2075 deformation_BC,stress_BC,rotation_BC)
2077 logical,
intent(in) :: &
2080 real(
preal),
intent(in) :: &
2087 type(rotation),
intent(in) :: &
2089 integer(kind=selected_int_kind(5)) :: ierr
2090 real(kind=selected_real_kind(10)),
pointer,
dimension(:,:,:,:) :: &
2093 call dmdavecgetarrayf90(
mech_grid,
solution_current,u_current,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2094 call dmdavecgetarrayf90(
mech_grid,
solution_lastinc,u_lastinc,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2106 if (deformation_bc%myType==
'l')
then
2109 elseif(deformation_bc%myType==
'fdot')
then
2111 f_aimdot + deformation_bc%maskFloat * deformation_bc%values
2112 elseif (deformation_bc%myType==
'f')
then
2119 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2120 call vecscale(
solution_rate,1.0_preal/timeinc_old,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2122 call vecset(
solution_rate,0.0_preal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2136 call dmdavecrestorearrayf90(
mech_grid,
solution_current,u_current,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2137 call dmdavecrestorearrayf90(
mech_grid,
solution_lastinc,u_lastinc,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2157 integer(kind=selected_int_kind(5)) :: ierr
2158 integer(HID_T) :: filehandle, grouphandle
2159 real(kind=selected_real_kind(10)),
dimension(:,:,:,:),
pointer :: u_current,u_lastinc
2160 character(len=pStringLen) :: filename
2162 call dmdavecgetarrayf90(
mech_grid,
solution_current,u_current,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2163 call dmdavecgetarrayf90(
mech_grid,
solution_lastinc,u_lastinc,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2165 write(6,
'(a)')
' writing solver data required for restart to file';
flush(6)
2177 call hdf5_write(grouphandle,u_lastinc,
'u_lastInc')
2185 call dmdavecrestorearrayf90(
mech_grid,
solution_current,u_current,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2186 call dmdavecrestorearrayf90(
mech_grid,
solution_lastinc,u_lastinc,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2194 subroutine converged(snes_local,PETScIter,devNull1,devNull2,fnorm,reason,dummy,ierr)
2196 type(tsnes) :: snes_local
2197 integer(kind=selected_int_kind(5)),
intent(in) :: PETScIter
2198 real(kind=selected_real_kind(10)),
intent(in) :: &
2202 integer(kind=selected_int_kind(5)) :: reason
2203 integer(kind=selected_int_kind(10)) :: dummy
2204 integer(kind=selected_int_kind(5)) :: ierr
2211 divtol = max(maxval(abs(
p_av))*err_div_tolrel ,err_div_tolabs)
2212 bctol = max(maxval(abs(
p_av))*err_stress_tolrel,err_stress_tolabs)
2215 all([ err_div/divtol, &
2216 err_bc /bctol ] < 1.0_preal)) &
2227 write(6,
'(1/,a)')
' ... reporting .............................................................'
2228 write(6,
'(1/,a,f12.2,a,es8.2,a,es9.2,a)')
' error divergence = ', &
2229 err_div/divtol,
' (',err_div,
' / m, tol = ',divtol,
')'
2230 write(6,
'(a,f12.2,a,es8.2,a,es9.2,a)')
' error stress BC = ', &
2232 write(6,
'(/,a)')
' ==========================================================================='
2244 type(tdm) :: da_local
2245 type(tvec) :: x_local, f_local
2246 real(kind=selected_real_kind(10)),
pointer,
dimension(:,:,:,:) :: x_scal, f_scal
2247 real(kind=selected_real_kind(10)),
dimension(8,3) :: x_elem, f_elem
2248 integer(kind=selected_int_kind(5)) :: i, ii, j, jj, k, kk, ctr, ele
2249 real(pReal),
dimension(3,3) :: &
2251 integer(kind=selected_int_kind(5)) :: &
2254 integer(kind=selected_int_kind(10)) :: dummy
2255 integer(kind=selected_int_kind(5)) :: ierr
2256 real(pReal),
dimension(3,3,3,3) :: devNull
2259 call snesgetnumberfunctionevals(
mech_snes,nfuncs,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2260 call snesgetiterationnumber(
mech_snes,petsciter,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2262 if (nfuncs == 0 .and. petsciter == 0)
totaliter = -1
2266 newiteration:
if (
totaliter <= petsciter)
then
2268 write(6,
'(1x,a,3(a,i0))') trim(
incinfo),
' @ Iteration ',
itmin,
'≤',
totaliter+1,
'≤',
itmax
2270 write(6,
'(/,a,/,3(3(f12.7,1x)/))',advance=
'no') &
2271 ' deformation gradient aim (lab) =', transpose(
params%rotation_BC%rotate(
f_aim,active=.true.))
2272 write(6,
'(/,a,/,3(3(f12.7,1x)/))',advance=
'no') &
2273 ' deformation gradient aim =', transpose(
f_aim)
2279 call dmdavecgetarrayf90(da_local,x_local,x_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2282 do kk = 0, 1;
do jj = 0, 1;
do ii = 0, 1
2284 x_elem(ctr,1:3) = x_scal(0:2,i+ii,j+jj,k+kk)
2287 f(1:3,1:3,ii,jj,kk) =
params%rotation_BC%rotate(
f_aim,active=.true.) + transpose(matmul(
bmat,x_elem))
2289 call dmdavecrestorearrayf90(da_local,x_local,x_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2296 call mpi_allreduce(mpi_in_place,
terminallyill,1,mpi_logical,mpi_lor,petsc_comm_world,ierr)
2307 call vecset(f_local,0.0_preal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2308 call dmdavecgetarrayf90(da_local,f_local,f_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2309 call dmdavecgetarrayf90(da_local,x_local,x_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2313 do kk = 0, 1;
do jj = 0, 1;
do ii = 0, 1
2315 x_elem(ctr,1:3) = x_scal(0:2,i+ii,j+jj,k+kk)
2319 f_elem = matmul(transpose(
bmat),transpose(
p_current(1:3,1:3,ii,jj,kk)))*
detj + &
2324 do kk = 0, 1;
do jj = 0, 1;
do ii = 0, 1
2326 f_scal(0:2,i+ii,j+jj,k+kk) = f_scal(0:2,i+ii,j+jj,k+kk) + f_elem(ctr,1:3)
2329 call dmdavecrestorearrayf90(da_local,x_local,x_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2330 call dmdavecrestorearrayf90(da_local,f_local,f_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2334 call dmdavecgetarrayf90(da_local,f_local,f_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2347 call dmdavecrestorearrayf90(da_local,f_local,f_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2355 subroutine formjacobian(da_local,x_local,Jac_pre,Jac,dummy,ierr)
2357 type(tdm) :: da_local
2358 type(tvec) :: x_local, coordinates
2359 type(tmat) :: Jac_pre, Jac
2360 integer(kind=selected_int_kind(5)),
dimension(4,24) :: row, col
2361 real(kind=selected_real_kind(10)),
pointer,
dimension(:,:,:,:) :: x_scal
2362 real(kind=selected_real_kind(10)),
dimension(24,24) :: k_ele
2363 real(kind=selected_real_kind(10)),
dimension(9,24) :: bmatfull
2364 integer(kind=selected_int_kind(5)) :: i, ii, j, jj, k, kk, ctr, ele
2365 integer(kind=selected_int_kind(5)),
dimension(3),
parameter :: rows = [0, 1, 2]
2366 real(kind=selected_real_kind(10)) :: diag
2367 integer(kind=selected_int_kind(10)) :: dummy
2368 type(tmatnullspace) :: matnull
2369 integer(kind=selected_int_kind(5)) :: ierr
2372 bmatfull(1:3,1 :8 ) =
bmat
2373 bmatfull(4:6,9 :16) =
bmat
2374 bmatfull(7:9,17:24) =
bmat
2375 call matsetoption(jac,mat_keep_nonzero_pattern,petsc_true,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2376 call matsetoption(jac,mat_new_nonzero_allocation_err,petsc_false,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2377 call matzeroentries(jac,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2381 do kk = 0, 1;
do jj = 0, 1;
do ii = 0, 1
2387 col(3,ctr+8 ) = i+ii
2388 col(2,ctr+8 ) = j+jj
2389 col(1,ctr+8 ) = k+kk
2391 col(3,ctr+16) = i+ii
2392 col(2,ctr+16) = j+jj
2393 col(1,ctr+16) = k+kk
2409 matmul(transpose(bmatfull), &
2411 shape=[3,3,3,3], order=[2,1,4,3]),shape=[9,9]),bmatfull))*
detj
2412 call matsetvaluesstencil(jac,24,row,24,col,k_ele,add_values,ierr)
2413 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2415 call matassemblybegin(jac,mat_final_assembly,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2416 call matassemblyend(jac,mat_final_assembly,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2417 call matassemblybegin(jac_pre,mat_final_assembly,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2418 call matassemblyend(jac_pre,mat_final_assembly,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2425 call matzerorowscolumns(jac,
size(rows),rows,diag,petsc_null_vec,petsc_null_vec,ierr)
2426 if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2427 call dmgetglobalvector(da_local,coordinates,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2428 call dmdavecgetarrayf90(da_local,coordinates,x_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2434 call dmdavecrestorearrayf90(da_local,coordinates,x_scal,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2435 call matnullspacecreaterigidbody(coordinates,matnull,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2436 call dmrestoreglobalvector(da_local,coordinates,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2437 call matsetnullspace(jac,matnull,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2438 call matsetnearnullspace(jac,matnull,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif
2439 call matnullspacedestroy(matnull,ierr);
if (ierr .ne. 0) then;
call petscerrorf(ierr);return;
endif