DAMASK with grid solvers  Revision: v2.0.3-2204-gdb1f2151
The Düsseldorf Advanced Material Simulation Kit with Grid Solvers
grid_thermal_spectral.f90
Go to the documentation of this file.
1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_thermal_spectral.f90"
2 # 1 "<built-in>"
3 # 1 "<command-line>"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_thermal_spectral.f90"
5 !--------------------------------------------------------------------------------------------------
10 !--------------------------------------------------------------------------------------------------
12 
13 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h" 1
14 !
15 ! Include file for Fortran use of the SNES package in 1
16 !
17 
18 
19 
20 
21 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h" 1
22 !
23 !
24 ! Include file for Fortran use of the KSP package in 1
25 !
26 
27 
28 
29 
30 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h" 1
31 !
32 !
33 ! Include file for Fortran use of the PC (preconditioner) package in 1
34 !
35 
36 
37 
38 
39 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 1
40 !
41 !
42 ! Include file for Fortran use of the Mat package in 1
43 !
44 
45 
46 
47 
48 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 1
49 !
50 !
51 ! Include file for Fortran use of the Vec package in 1
52 !
53 
54 
55 
56 
57 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscao.h" 1
58 !
59 !
60 ! Include file for Fortran use of the AO (application ordering) package in 1
61 !
62 
63 
64 
65 
66 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 1
67 !
68 !
69 ! Include file for Fortran use of the IS (index set) package in 1
70 !
71 
72 
73 
74 
75 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 1
76 !
77 !
78 ! Part of the base include file for Fortran use of 1.
79 ! Note: This file should contain only define statements and
80 ! not the declaration of variables.
81 
82 ! No spaces for #defines as some compilers (PGI) also adds
83 ! those additional spaces during preprocessing - bad for fixed format
84 !
85 
86 
87 
88 # 1 "/opt/petsc-3.10.3/Intel-18.4-IntelMPI-2018/include/petscconf.h" 1
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
200 
201 
202 
203 
204 
205 
206 
207 
208 
209 
210 
211 
212 
213 
214 
215 
216 
217 
218 
219 
220 
221 
222 
223 
224 
225 
226 
227 
228 
229 
230 
231 
232 
233 
234 
235 
236 
237 
238 
239 
240 
241 
242 
243 
244 
245 
246 
247 
248 
249 
250 
251 
252 
253 
254 
255 
256 
257 
258 
259 
260 
261 
262 
263 
264 
265 
266 
267 
268 
269 
270 
271 
272 
273 
274 
275 
276 
277 
278 
279 
280 
281 
282 
283 
284 
285 
286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
297 
298 
299 
300 
301 
302 
303 
304 
305 
306 
307 
308 
309 
310 
311 
312 
313 
314 
315 
316 
317 
318 
319 
320 
321 
322 
323 
324 
325 
326 
327 
328 
329 
330 
331 
332 
333 
334 
335 
336 
337 
338 
339 
340 
341 
342 
343 
344 
345 
346 
347 
348 
349 
350 
351 
352 
353 
354 
355 
356 
357 
358 
359 
360 
361 
362 
363 
364 
365 
366 
367 
368 
369 
370 
371 
372 
373 
374 
375 
376 
377 
378 
379 
380 
381 
382 
383 
384 
385 
386 
387 
388 
389 
390 
391 
392 
393 
394 
395 
396 
397 
398 
399 
400 
401 
402 
403 
404 
405 
406 
407 
408 
409 
410 
411 
412 
413 
414 
415 
416 
417 
418 
419 
420 
421 
422 
423 
424 
425 
426 
427 
428 
429 
430 
431 
432 
433 
434 
435 
436 
437 
438 
439 
440 
441 
442 
443 
444 
445 
446 
447 
448 
449 
450 
451 
452 
453 
454 
455 
456 
457 
458 
459 
460 
461 
462 
463 
464 
465 
466 
467 
468 
469 
470 
471 
472 
473 
474 
475 
476 
477 
478 
479 
480 
481 
482 
483 
484 
485 
486 
487 
488 
489 
490 
491 
492 
493 
494 
495 
496 
497 
498 
499 
500 
501 
502 
503 
504 
505 
506 
507 
508 
509 
510 
511 
512 
513 
514 
515 
516 
517 
518 
519 
520 
521 
522 
523 
524 
525 
526 
527 
528 
529 
530 
531 
532 
533 
534 
535 
536 
537 
538 
539 
540 
541 
542 
543 
544 
545 
546 
547 
548 
549 
550 
551 
552 
553 
554 
555 
556 
557 
558 
559 
560 
561 
562 
563 
564 
565 
566 
567 
568 
569 
570 
571 
572 
573 
574 
575 
576 
577 
578 
579 
580 
581 
582 
583 
584 
585 
586 
587 
588 
589 
590 
591 
592 
593 
594 
595 
596 
597 
598 
599 
600 
601 
602 
603 
604 
605 
606 
607 
608 
609 
610 
611 
612 
613 
614 
615 
616 
617 
618 
619 
620 
621 
622 
623 
624 
625 
626 
627 
628 
629 
630 
631 
632 
633 
634 
635 
636 
637 
638 
639 
640 
641 
642 
643 
644 
645 
646 
647 
648 
649 
650 
651 
652 
653 
654 
655 
656 
657 
658 
659 
660 
661 
662 
663 
664 
665 
666 
667 
668 
669 
670 
671 
672 
673 
674 
675 
676 
677 
678 
679 
680 
681 
682 
683 
684 
685 
686 
687 
688 
689 
690 
691 
692 
693 
694 
695 
696 
697 
698 
699 
700 
701 
702 
703 
704 
705 
706 
707 
708 
709 
710 
711 
712 
713 
714 
715 
716 
717 
718 
719 
720 
721 
722 
723 
724 
725 
726 
727 
728 
729 
730 
731 
732 
733 
734 
735 
736 
737 
738 
739 
740 
741 
742 
743 
744 
745 
746 
747 
748 
749 
750 
751 
752 
753 
754 
755 
756 
757 
758 
759 
760 
761 
762 
763 
764 
765 
766 
767 
768 
769 
770 
771 
772 
773 
774 
775 
776 
777 
778 
779 
780 
781 
782 
783 
784 
785 
786 
787 
788 
789 
790 
791 
792 
793 
794 
795 
796 
797 
798 
799 
800 
801 
802 
803 
804 
805 
806 
807 
808 
809 
810 
811 
812 
813 
814 
815 
816 
817 
818 
819 
820 
821 
822 
823 
824 
825 
826 
827 
828 
829 
830 
831 
832 
833 
834 
835 
836 
837 
838 
839 
840 
841 
842 
843 
844 
845 
846 
847 
848 
849 
850 
851 
852 
853 
854 
855 
856 
857 
858 
859 
860 
861 
862 
863 
864 
865 
866 
867 
868 
869 
870 
871 
872 
873 
874 
875 
876 
877 
878 
879 
880 
881 
882 
883 
884 
885 
886 
887 
888 
889 
890 
891 
892 
893 
894 
895 
896 
897 
898 
899 
900 
901 
902 
903 
904 
905 
906 
907 
908 
909 
910 
911 
912 
913 
914 
915 
916 
917 
918 
919 
920 
921 
922 
923 
924 
925 
926 
927 
928 
929 
930 
931 
932 
933 
934 
935 
936 
937 
938 
939 
940 
941 
942 
943 
944 
945 
946 
947 
948 
949 
950 
951 
952 
953 
954 
955 
956 
957 
958 
959 
960 
961 
962 
963 
964 
965 
966 
967 
968 
969 
970 
971 
972 
973 
974 
975 
976 
977 
978 
979 
980 
981 
982 
983 
984 
985 
986 
987 
988 
989 
990 
991 
992 
993 
994 
995 
996 
997 
998 
999 
1000 
1001 
1002 
1003 
1004 
1005 
1006 
1007 
1008 
1009 
1010 
1011 
1012 
1013 
1014 
1015 
1016 
1017 
1018 
1019 
1020 
1021 
1022 
1023 
1024 
1025 
1026 
1027 
1028 
1029 
1030 
1031 
1032 
1033 
1034 
1035 
1036 
1037 
1038 
1039 
1040 
1041 
1042 
1043 
1044 
1045 
1046 
1047 
1048 
1049 
1050 
1051 
1052 
1053 
1054 
1055 
1056 
1057 
1058 
1059 
1060 
1061 
1062 
1063 
1064 
1065 
1066 
1067 
1068 
1069 
1070 
1071 
1072 
1073 
1074 
1075 
1076 
1077 
1078 
1079 
1080 
1081 
1082 
1083 
1084 
1085 
1086 
1087 
1088 
1089 
1090 
1091 
1092 
1093 
1094 
1095 
1096 
1097 
1098 
1099 
1100 
1101 
1102 
1103 
1104 
1105 
1106 
1107 
1108 
1109 
1110 
1111 
1112 
1113 
1114 
1115 
1116 
1117 
1118 
1119 
1120 
1121 
1122 
1123 
1124 
1125 
1126 
1127 
1128 
1129 
1130 
1131 
1132 
1133 
1134 
1135 
1136 
1137 
1138 
1139 
1140 
1141 
1142 
1143 
1144 
1145 
1146 
1147 
1148 
1149 
1150 
1151 
1152 
1153 
1154 
1155 
1156 
1157 
1158 
1159 
1160 
1161 
1162 
1163 
1164 
1165 
1166 
1167 
1168 
1169 
1170 
1171 
1172 
1173 
1174 
1175 
1176 
1177 
1178 
1179 
1180 
1181 
1182 
1183 
1184 
1185 
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193 
1194 
1195 
1196 
1197 
1198 
1199 
1200 
1201 
1202 
1203 
1204 
1205 
1206 
1207 
1208 
1209 
1210 
1211 
1212 
1213 
1214 
1215 
1216 
1217 
1218 
1219 
1220 
1221 
1222 
1223 
1224 
1225 
1226 
1227 
1228 
1229 
1230 
1231 
1232 
1233 
1234 
1235 
1236 
1237 
1238 
1239 
1240 
1241 
1242 
1243 
1244 
1245 
1246 
1247 
1248 
1249 
1250 
1251 
1252 
1253 
1254 
1255 
1256 
1257 
1258 
1259 
1260 
1261 
1262 
1263 
1264 
1265 
1266 
1267 
1268 
1269 
1270 
1271 
1272 
1273 
1274 
1275 
1276 
1277 
1278 
1279 
1280 
1281 
1282 
1283 
1284 
1285 
1286 
1287 
1288 
1289 
1290 
1291 
1292 
1293 
1294 
1295 
1296 # 13 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1297 
1298 
1299 
1300 
1301 # 1 "/opt/petsc-3.10.3/include/petscversion.h" 1
1302 
1303 
1304 
1305 
1306 
1307 
1308 
1309 
1310 
1311 
1312 
1313 
1314 
1315 
1316 
1317 
1318 
1319 
1320 
1321 
1322 
1323 
1324 
1325 
1326 
1327 
1328 
1329 
1330 
1331 
1332 
1333 
1334 
1335 
1336 
1337 
1338 
1339 
1340 
1341 
1342 
1343 
1344 
1345 
1346 
1347 # 17 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1348 
1349 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h" 1
1350 !
1351 ! Include file for Fortran use of the PetscViewer package in 1
1352 !
1353 
1354 
1355 
1356 
1357 
1358 
1359 
1360 
1361 
1362 
1363 
1364 
1365 
1366 # 31 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h"
1367 
1368 # 18 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1369 
1370 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h" 1
1371 
1372 !
1373 ! Include file for Fortran error codes
1374 ! These are also in include/petscerror.h
1375 !
1376 
1377 
1378 
1379 # 24 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h"
1380 
1381 # 38 "/opt/petsc-3.10.3/include/petsc/finclude/petscerror.h"
1382 
1383 
1384 
1385 
1386 
1387 
1388 
1389 
1390 
1391 
1392 
1393 
1394 
1395 
1396 
1397 
1398 # 19 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1399 
1400 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petsclog.h" 1
1401 !
1402 ! No includes needed for logging
1403 # 20 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1404 
1405 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscbag.h" 1
1406 !
1407 !
1408 ! Include file for Fortran use of the Bag package in 1
1409 !
1410 
1411 
1412 
1413 
1414 
1415 !
1416 ! End of Fortran include file for the IS package in 1
1417 
1418 # 21 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h" 2
1419 
1420 !
1421 ! The real*8,complex*16 notatiton is used so that the
1422 ! 1 double/complex variables are not affected by
1423 ! compiler options like -r4,-r8, sometimes invoked
1424 ! by the user. NAG compiler does not like integer*4,real*8
1425 
1426 # 41 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1427 
1428 
1429 
1430 
1431 
1432 
1433 
1434 
1435 
1436 # 63 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1437 
1438 
1439 
1440 
1441 
1442 
1443 !
1444 
1445 
1446 
1447 
1448 
1449 !
1450 # 85 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1451 !
1452 
1453 
1454 
1455 
1456 
1457 
1458 !
1459 
1460 
1461 
1462 
1463 !
1464 
1465 !
1466 
1467 
1468 !
1469 # 128 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1470 
1471 # 150 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1472 !
1473 ! Macro for templating between real and complex
1474 !
1475 # 174 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1476 
1477 
1478 
1479 
1480 
1481 
1482 
1483 
1484 
1485 !
1486 ! Allows the matrix Fortran Kernels to work with single precision
1487 ! matrix data structures
1488 !
1489 
1490 !
1491 ! PetscLogDouble variables are used to contain double precision numbers
1492 ! that are not used in the numerical computations, but rather in logging,
1493 ! timing etc.
1494 !
1495 
1496 
1497 !
1498 ! Macros for error checking
1499 !
1500 
1501 
1502 
1503 
1504 
1505 
1506 
1507 
1508 # 215 "/opt/petsc-3.10.3/include/petsc/finclude/petscsys.h"
1509 
1510 
1511 
1512 
1513 
1514 
1515 
1516 
1517 
1518 
1519 
1520 
1521 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 2
1522 
1523 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscviewer.h" 1
1524 !
1525 ! Include file for Fortran use of the type(tPetscViewer) package in 1
1526 !
1527 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 2
1528 
1529 
1530 
1531 
1532 
1533 
1534 
1535 
1536 
1537 
1538 
1539 
1540 
1541 
1542 
1543 
1544 
1545 
1546 
1547 
1548 
1549 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscao.h" 2
1550 
1551 
1552 
1553 
1554 
1555 
1556 
1557 
1558 
1559 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 2
1560 
1561 
1562 
1563 
1564 
1565 
1566 
1567 
1568 
1569 
1570 
1571 
1572 
1573 # 30 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h"
1574 
1575 
1576 
1577 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 2
1578 
1579 
1580 
1581 
1582 
1583 # 49 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1584 
1585 
1586 
1587 
1588 
1589 
1590 
1591 
1592 
1593 
1594 
1595 
1596 
1597 # 71 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1598 !
1599 ! Matrix types
1600 !
1601 # 115 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1602 
1603 # 140 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1604 
1605 !
1606 ! MatMFFDType values
1607 !
1608 
1609 
1610 
1611 !
1612 ! MatSolverTypes
1613 !
1614 # 168 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h"
1615 
1616 !
1617 ! GPU Storage Formats for CUSPARSE
1618 !
1619 
1620 
1621 
1622 !
1623 ! sparsity reducing ordering for STRUMPACK
1624 !
1625 
1626 
1627 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h" 2
1628 
1629 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 1
1630 
1631 !
1632 ! Include file for Fortran use of the DM package in 1
1633 !
1634 
1635 
1636 
1637 
1638 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 1
1639 !
1640 !
1641 ! Include file for Fortran use of the type(tIS) (index set) package in 1
1642 !
1643 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 2
1644 
1645 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 1
1646 !
1647 !
1648 ! Include file for Fortran use of the type(tVec) package in 1
1649 !
1650 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 2
1651 
1652 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 1
1653 !
1654 !
1655 ! Include file for Fortran use of the type(tMat) package in 1
1656 !
1657 # 11 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 2
1658 
1659 
1660 
1661 
1662 
1663 
1664 
1665 
1666 
1667 
1668 
1669 # 32 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h"
1670 
1671 
1672 # 47 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h"
1673 
1674 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h" 2
1675 
1676 
1677 
1678 # 26 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h"
1679 !
1680 ! GAMG types
1681 !
1682 
1683 
1684 !
1685 ! Various preconditioners
1686 !
1687 # 74 "/opt/petsc-3.10.3/include/petsc/finclude/petscpc.h"
1688 
1689 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h" 2
1690 
1691 
1692 
1693 
1694 # 21 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h"
1695 !
1696 ! Various Krylov subspace methods
1697 !
1698 # 57 "/opt/petsc-3.10.3/include/petsc/finclude/petscksp.h"
1699 !
1700 ! Various Initial guesses for Krylov subspace methods
1701 !
1702 # 8 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h" 2
1703 
1704 
1705 
1706 
1707 
1708 # 30 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h"
1709 
1710 !
1711 ! character*(80)
1712 !
1713 # 47 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h"
1714 
1715 !
1716 ! character*(80)
1717 !
1718 
1719 
1720 
1721 
1722 
1723 
1724 
1725 !
1726 ! integer(kind=selected_int_kind(5))
1727 !
1728 
1729 
1730 
1731 
1732 
1733 
1734 !
1735 ! character*(80)
1736 !
1737 # 78 "/opt/petsc-3.10.3/include/petsc/finclude/petscsnes.h"
1738 
1739 
1740 
1741 # 9 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_thermal_spectral.f90" 2
1742 
1743 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 1
1744 
1745 !
1746 ! Include file for Fortran use of the 'da' (distributed array) package in 1
1747 !
1748 
1749 
1750 
1751 
1752 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscis.h" 1
1753 !
1754 !
1755 ! Include file for Fortran use of the type(tIS) (index set) package in 1
1756 !
1757 # 9 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1758 
1759 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscvec.h" 1
1760 !
1761 !
1762 ! Include file for Fortran use of the type(tVec) package in 1
1763 !
1764 # 10 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1765 
1766 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscmat.h" 1
1767 !
1768 !
1769 ! Include file for Fortran use of the type(tMat) package in 1
1770 !
1771 # 11 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1772 
1773 # 1 "/opt/petsc-3.10.3/include/petsc/finclude/petscdm.h" 1
1774 
1775 !
1776 ! Include file for Fortran use of the type(tDM) package in 1
1777 !
1778 # 12 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h" 2
1779 
1780 
1781 
1782 
1783 
1784 !
1785 ! DMDA_LOCAL_INFO_SIZE is one large than the size incase the DA is larger than an integer (on 64 bit systems).
1786 ! non-int fields are not accessiable from fortran.
1787 !
1788 # 39 "/opt/petsc-3.10.3/include/petsc/finclude/petscdmda.h"
1789 
1790 
1791 
1792 
1793 
1794 
1795 
1796 
1797 
1798 
1799 
1800 
1801 
1802 # 10 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/grid/grid_thermal_spectral.f90" 2
1803  use petscdmda
1804  use petscsnes
1805 
1806  use prec
1807  use spectral_utilities
1809  use thermal_conduction
1810  use numerics
1811  use material
1812 
1813  implicit none
1814  private
1815 
1816 !--------------------------------------------------------------------------------------------------
1817 ! derived types
1818  type(tsolutionparams), private :: params
1819 
1820 !--------------------------------------------------------------------------------------------------
1821 ! 1 data
1822  type(tsnes), private :: thermal_snes
1823  type(tvec), private :: solution_vec
1824  integer(kind=selected_int_kind(5)), private :: xstart, xend, ystart, yend, zstart, zend
1825  real(preal), private, dimension(:,:,:), allocatable :: &
1826  t_current, & !< field of current temperature
1827  t_lastinc, & !< field of previous temperature
1828  t_staginc
1829 
1830 !--------------------------------------------------------------------------------------------------
1831 ! reference diffusion tensor, mobility etc.
1832  integer, private :: totaliter = 0
1833  real(preal), dimension(3,3), private :: k_ref
1834  real(preal), private :: mu_ref
1835 
1836  public :: &
1840  private :: &
1841  formresidual
1842 
1843 contains
1844 
1845 !--------------------------------------------------------------------------------------------------
1847 ! ToDo: Restart not implemented
1848 !--------------------------------------------------------------------------------------------------
1849 subroutine grid_thermal_spectral_init
1851  integer(kind=selected_int_kind(5)), dimension(0:worldsize-1) :: localk
1852  integer :: i, j, k, cell
1853  type(tdm) :: thermal_grid
1854  real(kind=selected_real_kind(10)), dimension(:,:,:), pointer :: x_scal
1855  integer(kind=selected_int_kind(5)) :: ierr
1856 
1857  write(6,'(/,a)') ' <<<+- grid_thermal_spectral init -+>>>'
1858 
1859  write(6,'(/,a)') ' Shanthraj et al., Handbook of Mechanics of Materials, 2019'
1860  write(6,'(a)') ' https://doi.org/10.1007/978-981-10-6855-3_80'
1861 
1862 !--------------------------------------------------------------------------------------------------
1863 ! set default and user defined options for 1
1864  call petscoptionsinsertstring(petsc_null_options,'-thermal_snes_type ngmres',ierr)
1865  if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1866  call petscoptionsinsertstring(petsc_null_options,trim(petsc_options),ierr)
1867  if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1868 
1869 !--------------------------------------------------------------------------------------------------
1870 ! initialize solver specific parts of 1
1871  call snescreate(petsc_comm_world,thermal_snes,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1872  call snessetoptionsprefix(thermal_snes,'thermal_',ierr);if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1873  localk = 0
1874  localk(worldrank) = grid3
1875  call mpi_allreduce(mpi_in_place,localk,worldsize,mpi_integer,mpi_sum,petsc_comm_world,ierr)
1876  call dmdacreate3d(petsc_comm_world, &
1877  dm_boundary_none, dm_boundary_none, dm_boundary_none, & ! cut off stencil at boundary
1878  dmda_stencil_box, & ! Moore (26) neighborhood around central point
1879  grid(1),grid(2),grid(3), & ! global grid
1880  1, 1, worldsize, &
1881  1, 0, & ! #dof (thermal phase field), ghost boundary width (domain overlap)
1882  [grid(1)],[grid(2)],localk, & ! local grid
1883  thermal_grid,ierr) ! handle, error
1884  if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1885  call snessetdm(thermal_snes,thermal_grid,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif ! connect snes to da
1886  call dmsetfromoptions(thermal_grid,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1887  call dmsetup(thermal_grid,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1888  call dmcreateglobalvector(thermal_grid,solution_vec,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif ! global solution vector (grid x 1, i.e. every def grad tensor)
1889  call dmdasnessetfunctionlocal(thermal_grid,insert_values,formresidual,petsc_null_snes,ierr) ! residual vector of same shape as solution vector
1890  if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1891  call snessetfromoptions(thermal_snes,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif ! pull it all together with additional CLI arguments
1892 
1893 !--------------------------------------------------------------------------------------------------
1894 ! init fields
1895  call dmdagetcorners(thermal_grid,xstart,ystart,zstart,xend,yend,zend,ierr)
1896  if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1897  xend = xstart + xend - 1
1898  yend = ystart + yend - 1
1899  zend = zstart + zend - 1
1900  allocate(t_current(grid(1),grid(2),grid3), source=0.0_preal)
1901  allocate(t_lastinc(grid(1),grid(2),grid3), source=0.0_preal)
1902  allocate(t_staginc(grid(1),grid(2),grid3), source=0.0_preal)
1903  cell = 0
1904  do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
1905  cell = cell + 1
1907  p(thermalmapping(material_homogenizationat(cell))%p(1,cell))
1908  t_lastinc(i,j,k) = t_current(i,j,k)
1909  t_staginc(i,j,k) = t_current(i,j,k)
1910  enddo; enddo; enddo
1911  call dmdavecgetarrayf90(thermal_grid,solution_vec,x_scal,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1913  call dmdavecrestorearrayf90(thermal_grid,solution_vec,x_scal,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1914 
1915  call updatereference
1916 
1917 end subroutine grid_thermal_spectral_init
1918 
1919 
1920 !--------------------------------------------------------------------------------------------------
1922 !--------------------------------------------------------------------------------------------------
1923 function grid_thermal_spectral_solution(timeinc,timeinc_old) result(solution)
1925  real(preal), intent(in) :: &
1926  timeinc, & !< increment in time for current solution
1927  timeinc_old
1928  integer :: i, j, k, cell
1929  type(tsolutionstate) :: solution
1930  integer(kind=selected_int_kind(5)) :: devnull
1931  real(kind=selected_real_kind(10)) :: t_min, t_max, stagnorm, solnnorm
1932 
1933  integer(kind=selected_int_kind(5)) :: ierr
1934  integer(kind=selected_int_kind(5)) :: reason
1935 
1936  solution%converged =.false.
1937 
1938 !--------------------------------------------------------------------------------------------------
1939 ! set module wide availabe data
1940  params%timeinc = timeinc
1941  params%timeincOld = timeinc_old
1942 
1943  call snessolve(thermal_snes,petsc_null_vec,solution_vec,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1944  call snesgetconvergedreason(thermal_snes,reason,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1945 
1946  if (reason < 1) then
1947  solution%converged = .false.
1948  solution%iterationsNeeded = itmax
1949  else
1950  solution%converged = .true.
1951  solution%iterationsNeeded = totaliter
1952  endif
1953  stagnorm = maxval(abs(t_current - t_staginc))
1954  solnnorm = maxval(abs(t_current))
1955  call mpi_allreduce(mpi_in_place,stagnorm,1,mpi_double,mpi_max,petsc_comm_world,ierr)
1956  call mpi_allreduce(mpi_in_place,solnnorm,1,mpi_double,mpi_max,petsc_comm_world,ierr)
1958  solution%stagConverged = stagnorm < max(err_thermal_tolabs, err_thermal_tolrel*solnnorm)
1959 
1960 !--------------------------------------------------------------------------------------------------
1961 ! updating thermal state
1962  cell = 0
1963  do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
1964  cell = cell + 1
1966  (t_current(i,j,k)-t_lastinc(i,j,k))/params%timeinc, &
1967  1,cell)
1968  enddo; enddo; enddo
1969 
1970  call vecmin(solution_vec,devnull,t_min,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1971  call vecmax(solution_vec,devnull,t_max,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
1972  if (solution%converged) &
1973  write(6,'(/,a)') ' ... thermal conduction converged ..................................'
1974  write(6,'(/,a,f8.4,2x,f8.4,2x,f8.4,/)',advance='no') ' Minimum|Maximum|Delta Temperature / K = ',&
1975  t_min, t_max, stagnorm
1976  write(6,'(/,a)') ' ==========================================================================='
1977  flush(6)
1978 
1979 end function grid_thermal_spectral_solution
1980 
1981 
1982 !--------------------------------------------------------------------------------------------------
1984 !--------------------------------------------------------------------------------------------------
1985 subroutine grid_thermal_spectral_forward(cutBack)
1987  logical, intent(in) :: cutback
1988  integer :: i, j, k, cell
1989  type(tdm) :: dm_local
1990  real(kind=selected_real_kind(10)), dimension(:,:,:), pointer :: x_scal
1991  integer(kind=selected_int_kind(5)) :: ierr
1992 
1993  if (cutback) then
1996 
1997 !--------------------------------------------------------------------------------------------------
1998 ! reverting thermal field state
1999  cell = 0
2000  call snesgetdm(thermal_snes,dm_local,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
2001  call dmdavecgetarrayf90(dm_local,solution_vec,x_scal,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
2003  call dmdavecrestorearrayf90(dm_local,solution_vec,x_scal,ierr); if (ierr .ne. 0) then;call petscerrorf(ierr);return;endif
2004  do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
2005  cell = cell + 1
2007  (t_current(i,j,k) - &
2008  t_lastinc(i,j,k))/params%timeinc, &
2009  1,cell)
2010  enddo; enddo; enddo
2011  else
2013  call updatereference
2014  endif
2015 
2016 end subroutine grid_thermal_spectral_forward
2017 
2018 
2019 !--------------------------------------------------------------------------------------------------
2021 !--------------------------------------------------------------------------------------------------
2022 subroutine formresidual(in,x_scal,f_scal,dummy,ierr)
2024  integer(kind=selected_int_kind(5)), dimension(25) :: &
2025  in
2026  real(kind=selected_real_kind(10)), dimension( & in(13)+1:in(13)+in(16),in(14)+1:in(14)+in(17),in(15)+1:in(15)+in(18)), intent(in) :: &
2027  x_scal
2028  real(kind=selected_real_kind(10)), dimension( & in(7)+1:in(7)+in(10),in(8)+1:in(8)+in(11),in(9)+1:in(9)+in(12)), intent(out) :: &
2029  f_scal
2030  integer(kind=selected_int_kind(10)) :: dummy
2031  integer(kind=selected_int_kind(5)) :: ierr
2032  integer :: i, j, k, cell
2033  real(preal) :: tdot, dtdot_dt
2034 
2035  t_current = x_scal
2036 !--------------------------------------------------------------------------------------------------
2037 ! evaluate polarization field
2038  scalarfield_real = 0.0_preal
2039  scalarfield_real(1:grid(1),1:grid(2),1:grid3) = t_current
2043  cell = 0
2044  do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
2045  cell = cell + 1
2046  vectorfield_real(1:3,i,j,k) = matmul(thermal_conduction_getconductivity(1,cell) - k_ref, &
2047  vectorfield_real(1:3,i,j,k))
2048  enddo; enddo; enddo
2052  cell = 0
2053  do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
2054  cell = cell + 1
2055  call thermal_conduction_getsourceanditstangent(tdot, dtdot_dt, t_current(i,j,k), 1, cell)
2056  scalarfield_real(i,j,k) = params%timeinc*(scalarfield_real(i,j,k) + tdot) &
2058  thermal_conduction_getspecificheat(1,cell)*(t_lastinc(i,j,k) - &
2059  t_current(i,j,k))&
2060  + mu_ref*t_current(i,j,k)
2061  enddo; enddo; enddo
2062 
2063 !--------------------------------------------------------------------------------------------------
2064 ! convolution of temperature field with green operator
2068 
2069 !--------------------------------------------------------------------------------------------------
2070 ! constructing residual
2071  f_scal = t_current - scalarfield_real(1:grid(1),1:grid(2),1:grid3)
2072 
2073 end subroutine formresidual
2074 
2075 
2076 !--------------------------------------------------------------------------------------------------
2078 !--------------------------------------------------------------------------------------------------
2079 subroutine updatereference
2080 
2081  integer :: i,j,k,cell,ierr
2083  cell = 0
2084  k_ref = 0.0_preal
2085  mu_ref = 0.0_preal
2086  do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
2087  cell = cell + 1
2090  enddo; enddo; enddo
2091  k_ref = k_ref*wgt
2092  call mpi_allreduce(mpi_in_place,k_ref,9,mpi_double,mpi_sum,petsc_comm_world,ierr)
2093  mu_ref = mu_ref*wgt
2094  call mpi_allreduce(mpi_in_place,mu_ref,1,mpi_double,mpi_sum,petsc_comm_world,ierr)
2095 
2096 end subroutine updatereference
2097 
2098 
2099 end module grid_thermal_spectral
2100 
material::thermalmapping
type(thomogmapping), dimension(:), allocatable, public thermalmapping
mapping for thermal state/fields
Definition: material.f90:170
grid_thermal_spectral::t_current
real(preal), dimension(:,:,:), allocatable, private t_current
field of current temperature
Definition: grid_thermal_spectral.f90:1825
spectral_utilities::utilities_fftscalarbackward
subroutine, public utilities_fftscalarbackward
backward FFT of data in scalarField_fourier to scalarField_real
Definition: spectral_utilities.f90:1918
spectral_utilities::scalarfield_real
real(c_double), dimension(:,:,:), pointer, public scalarfield_real
scalar field real representation for fftw
Definition: spectral_utilities.f90:1501
grid_thermal_spectral::yend
integer(kind=selected_int_kind(5)), private yend
Definition: grid_thermal_spectral.f90:1824
numerics::err_thermal_tolrel
real(preal), public, protected err_thermal_tolrel
relative tolerance for thermal equilibrium
Definition: numerics.f90:1488
material::temperature
type(group_float), dimension(:), allocatable, public temperature
temperature field
Definition: material.f90:174
spectral_utilities::tsolutionparams
Definition: spectral_utilities.f90:1557
spectral_utilities
Utilities used by the different spectral solver variants.
Definition: spectral_utilities.f90:10
numerics::worldsize
integer, public, protected worldsize
MPI worldsize (/=1 for MPI simulations only)
Definition: numerics.f90:1470
thermal_conduction::thermal_conduction_getmassdensity
real(preal) function, public thermal_conduction_getmassdensity(ip, el)
returns homogenized mass density
Definition: thermal_conduction.f90:194
material
Parses material config file, either solverJobName.materialConfig or material.config.
Definition: material.f90:11
grid_thermal_spectral::ystart
integer(kind=selected_int_kind(5)), private ystart
Definition: grid_thermal_spectral.f90:1824
discretization_grid::grid3
integer, public, protected grid3
(local) grid in 3rd direction
Definition: discretization_grid.f90:1478
grid_thermal_spectral::xstart
integer(kind=selected_int_kind(5)), private xstart
Definition: grid_thermal_spectral.f90:1824
discretization_grid
Parse geometry file to set up discretization and geometry for nonlocal model.
Definition: discretization_grid.f90:11
prec
setting precision for real and int type
Definition: prec.f90:13
grid_thermal_spectral::grid_thermal_spectral_forward
subroutine, public grid_thermal_spectral_forward(cutBack)
forwarding routine
Definition: grid_thermal_spectral.f90:1986
spectral_utilities::utilities_fftvectorbackward
subroutine, public utilities_fftvectorbackward
backward FFT of data in field_fourier to field_real
Definition: spectral_utilities.f90:1943
spectral_utilities::vectorfield_real
real(c_double), dimension(:,:,:,:), pointer, public vectorfield_real
vector field real representation for fftw
Definition: spectral_utilities.f90:1499
thermal_conduction::thermal_conduction_getsourceanditstangent
subroutine, public thermal_conduction_getsourceanditstangent(Tdot, dTdot_dT, T, ip, el)
returns heat generation rate
Definition: thermal_conduction.f90:83
spectral_utilities::utilities_fouriervectordivergence
subroutine, public utilities_fouriervectordivergence()
calculate vector divergence in fourier field
Definition: spectral_utilities.f90:2221
thermal_conduction::thermal_conduction_puttemperatureanditsrate
subroutine, public thermal_conduction_puttemperatureanditsrate(T, Tdot, ip, el)
updates thermal state with solution from heat conduction PDE
Definition: thermal_conduction.f90:221
prec::preal
integer, parameter preal
number with 15 significant digits, up to 1e+-307 (typically 64 bit)
Definition: prec.f90:20
spectral_utilities::utilities_fftscalarforward
subroutine, public utilities_fftscalarforward
forward FFT of data in scalarField_real to scalarField_fourier
Definition: spectral_utilities.f90:1906
grid_thermal_spectral
1 solver for thermal conduction
Definition: grid_thermal_spectral.f90:11
grid_thermal_spectral::updatereference
subroutine updatereference
update reference viscosity and conductivity
Definition: grid_thermal_spectral.f90:2082
spectral_utilities::utilities_fftvectorforward
subroutine, public utilities_fftvectorforward
forward FFT of data in field_real to field_fourier with highest freqs. removed
Definition: spectral_utilities.f90:1931
numerics::err_thermal_tolabs
real(preal), public, protected err_thermal_tolabs
absolute tolerance for thermal equilibrium
Definition: numerics.f90:1488
grid_thermal_spectral::zstart
integer(kind=selected_int_kind(5)), private zstart
Definition: grid_thermal_spectral.f90:1824
spectral_utilities::utilities_fourierscalargradient
subroutine, public utilities_fourierscalargradient()
calculate scalar gradient in fourier field
Definition: spectral_utilities.f90:2207
grid_thermal_spectral::solution_vec
type(tvec), private solution_vec
Definition: grid_thermal_spectral.f90:1823
thermal_conduction::thermal_conduction_getspecificheat
real(preal) function, public thermal_conduction_getspecificheat(ip, el)
returns homogenized specific heat capacity
Definition: thermal_conduction.f90:168
thermal_conduction
material subroutine for temperature evolution from heat conduction
Definition: thermal_conduction.f90:9
grid_thermal_spectral::t_lastinc
real(preal), dimension(:,:,:), allocatable, private t_lastinc
field of previous temperature
Definition: grid_thermal_spectral.f90:1825
numerics::itmax
integer, public, protected itmax
maximum number of iterations
Definition: numerics.f90:1495
grid_thermal_spectral::grid_thermal_spectral_solution
type(tsolutionstate) function, public grid_thermal_spectral_solution(timeinc, timeinc_old)
solution for the spectral thermal scheme with internal iterations
Definition: grid_thermal_spectral.f90:1924
material::material_homogenizationat
integer, dimension(:), allocatable, public, protected material_homogenizationat
homogenization ID of each element (copy of discretization_homogenizationAt)
Definition: material.f90:128
grid_thermal_spectral::t_staginc
real(preal), dimension(:,:,:), allocatable, private t_staginc
field of staggered temperature
Definition: grid_thermal_spectral.f90:1825
numerics::worldrank
integer, public, protected worldrank
MPI worldrank (/=0 for MPI simulations only)
Definition: numerics.f90:1470
spectral_utilities::wgt
real(preal), public, protected wgt
weighting factor 1/Nelems
Definition: spectral_utilities.f90:1490
discretization_grid::grid
integer, dimension(3), public, protected grid
(global) grid
Definition: discretization_grid.f90:1476
grid_thermal_spectral::xend
integer(kind=selected_int_kind(5)), private xend
Definition: grid_thermal_spectral.f90:1824
grid_thermal_spectral::formresidual
subroutine, private formresidual(in, x_scal, f_scal, dummy, ierr)
forms the spectral thermal residual vector
Definition: grid_thermal_spectral.f90:2023
grid_thermal_spectral::mu_ref
real(preal), private mu_ref
Definition: grid_thermal_spectral.f90:1834
thermal_conduction::thermal_conduction_getconductivity
real(preal) function, dimension(3, 3), public thermal_conduction_getconductivity(ip, el)
returns homogenized thermal conductivity in reference configuration
Definition: thermal_conduction.f90:142
spectral_utilities::utilities_fouriergreenconvolution
subroutine, public utilities_fouriergreenconvolution(D_ref, mobility_ref, deltaT)
doing convolution DamageGreenOp_hat * field_real
Definition: spectral_utilities.f90:2009
grid_thermal_spectral::params
type(tsolutionparams), private params
Definition: grid_thermal_spectral.f90:1818
grid_thermal_spectral::k_ref
real(preal), dimension(3, 3), private k_ref
Definition: grid_thermal_spectral.f90:1833
grid_thermal_spectral::thermal_snes
type(tsnes), private thermal_snes
Definition: grid_thermal_spectral.f90:1822
grid_thermal_spectral::totaliter
integer, private totaliter
total iteration in current increment
Definition: grid_thermal_spectral.f90:1832
numerics
Managing of parameters related to numerics.
Definition: numerics.f90:10
spectral_utilities::tsolutionstate
return type of solution from spectral solver variants
Definition: spectral_utilities.f90:1528
grid_thermal_spectral::grid_thermal_spectral_init
subroutine, public grid_thermal_spectral_init
allocates all neccessary fields and fills them with data
Definition: grid_thermal_spectral.f90:1850
grid_thermal_spectral::zend
integer(kind=selected_int_kind(5)), private zend
Definition: grid_thermal_spectral.f90:1824