File: petscsystypes.h.html

package info (click to toggle)
petsc 3.23.1%2Bdfsg1-1exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 515,576 kB
  • sloc: ansic: 751,607; cpp: 51,542; python: 38,598; f90: 17,352; javascript: 3,493; makefile: 3,157; sh: 1,502; xml: 619; objc: 445; java: 13; csh: 1
file content (1120 lines) | stat: -rw-r--r-- 118,981 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
<center><a href="https://gitlab.com/petsc/petsc/-/blob/966382dc56242773704ef5f5cee7aa2db3ebc577/include/petscsystypes.h">Actual source code: petscsystypes.h</a></center><br>

<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.6">
<meta name="date" content="2025-04-30T18:14:50+00:00">
</head>

<body bgcolor="#FFFFFF">
<pre width=80>
<a name="line1">  1: </a><font color="#B22222">/* Portions of this code are under:</font>
<a name="line2">  2: </a><font color="#B22222">   Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.</font>
<a name="line3">  3: </a><font color="#B22222">*/</font>

<a name="line5">  5: </a><font color="#A020F0">#pragma once</font>

<a name="line7">  7: </a><font color="#A020F0">#include &lt;petscconf.h&gt;</font>
<a name="line8">  8: </a><font color="#A020F0">#include &lt;petscconf_poison.h&gt;</font>
<a name="line9">  9: </a><font color="#A020F0">#include &lt;petscfix.h&gt;</font>
<a name="line10"> 10: </a>#include <A href="../include/petscmacros.h.html">&lt;petscmacros.h&gt;</A>
<a name="line11"> 11: </a><font color="#A020F0">#include &lt;stddef.h&gt;</font>

<a name="line13"> 13: </a><font color="#B22222">/* SUBMANSEC = Sys */</font>

<a name="line15"> 15: </a><font color="#A020F0">#include &lt;limits.h&gt; // INT_MIN, INT_MAX, CHAR_BIT</font>

<a name="line17"> 17: </a><font color="#A020F0">#if defined(__clang__) || (PETSC_CPP_VERSION &gt;= 17)</font>
<a name="line18"> 18: </a>  <font color="#B22222">// clang allows both [[nodiscard]] and __attribute__((warn_unused_result)) on type</font>
<a name="line19"> 19: </a>  <font color="#B22222">// definitions. GCC, however, does not, so check that we are using C++17 [[nodiscard]]</font>
<a name="line20"> 20: </a>  <font color="#B22222">// instead of __attribute__((warn_unused_result))</font>
<a name="line21"> 21: </a><strong><font color="#228B22">  #define PETSC_ERROR_CODE_NODISCARD <a href="../manualpages/Sys/PETSC_NODISCARD.html">PETSC_NODISCARD</a></font></strong>
<a name="line22"> 22: </a><font color="#A020F0">#else</font>
<a name="line23"> 23: </a><strong><font color="#228B22">  #define PETSC_ERROR_CODE_NODISCARD</font></strong>
<a name="line24"> 24: </a><font color="#A020F0">#endif</font>

<a name="line26"> 26: </a><font color="#A020F0">#ifdef PETSC_CLANG_STATIC_ANALYZER</font>
<a name="line27"> 27: </a><strong><font color="#228B22">  #undef PETSC_USE_STRICT_PETSCERRORCODE</font></strong>
<a name="line28"> 28: </a><font color="#A020F0">#endif</font>

<a name="line30"> 30: </a><font color="#A020F0">#ifdef PETSC_USE_STRICT_PETSCERRORCODE</font>
<a name="line31"> 31: </a><strong><font color="#228B22">  #define PETSC_ERROR_CODE_TYPEDEF   typedef</font></strong>
<a name="line32"> 32: </a><strong><font color="#228B22">  #define PETSC_ERROR_CODE_ENUM_NAME <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a></font></strong>
<a name="line33"> 33: </a><font color="#A020F0">#else</font>
<a name="line34"> 34: </a><strong><font color="#228B22">  #define PETSC_ERROR_CODE_TYPEDEF</font></strong>
<a name="line35"> 35: </a><strong><font color="#228B22">  #define PETSC_ERROR_CODE_ENUM_NAME</font></strong>
<a name="line36"> 36: </a><font color="#A020F0">#endif</font>

<a name="line38"> 38: </a><font color="#B22222">/*E</font>
<a name="line39"> 39: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> - Datatype used to return PETSc error codes.</font>

<a name="line41"> 41: </a><font color="#B22222">  Level: beginner</font>

<a name="line43"> 43: </a><font color="#B22222">  Notes:</font>
<a name="line44"> 44: </a><font color="#B22222">  Virtually all PETSc functions return an error code. It is the callers responsibility to check</font>
<a name="line45"> 45: </a><font color="#B22222">  the value of the returned error code after each PETSc call to determine if any errors</font>
<a name="line46"> 46: </a><font color="#B22222">  occurred. A set of convenience macros (e.g. `<a href="../manualpages/Sys/PetscCall.html">PetscCall</a>()`, `<a href="../manualpages/Sys/PetscCallVoid.html">PetscCallVoid</a>()`) are provided</font>
<a name="line47"> 47: </a><font color="#B22222">  for this purpose. Failing to properly check for errors is not supported, as errors may leave</font>
<a name="line48"> 48: </a><font color="#B22222">  PETSc in an undetermined state.</font>

<a name="line50"> 50: </a><font color="#B22222">  One can retrieve the error string corresponding to a particular error code using</font>
<a name="line51"> 51: </a><font color="#B22222">  `<a href="../manualpages/Sys/PetscErrorMessage.html">PetscErrorMessage</a>()`.</font>

<a name="line53"> 53: </a><font color="#B22222">  The user can also configure PETSc with the `--with-strict-petscerrorcode` option to enable</font>
<a name="line54"> 54: </a><font color="#B22222">  compiler warnings when the returned error codes are not captured and checked. Users are</font>
<a name="line55"> 55: </a><font color="#B22222">  *heavily* encouraged to opt-in to this option, as it will become enabled by default in a</font>
<a name="line56"> 56: </a><font color="#B22222">  future release.</font>

<a name="line58"> 58: </a><font color="#B22222">  Developer Notes:</font>
<a name="line59"> 59: </a><font color="#B22222">  These are the generic error codes. These error codes are used in many different places in the</font>
<a name="line60"> 60: </a><font color="#B22222">  PETSc source code. The C-string versions are at defined in `PetscErrorStrings[]` in</font>
<a name="line61"> 61: </a><font color="#B22222">  `src/sys/error/err.c`, while the Fortran versions are defined in</font>
<a name="line62"> 62: </a><font color="#B22222">  `src/sys/ftn-mod/petscerror.h`. Any changes here must also be made in both locations.</font>

<a name="line64"> 64: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscErrorMessage.html">PetscErrorMessage</a>()`, `<a href="../manualpages/Sys/PetscCall.html">PetscCall</a>()`, `<a href="../manualpages/Sys/SETERRQ.html">SETERRQ</a>()`</font>
<a name="line65"> 65: </a><font color="#B22222">E*/</font>
<a name="line66"> 66: </a>PETSC_ERROR_CODE_TYPEDEF <font color="#4169E1">enum</font> PETSC_ERROR_CODE_NODISCARD {
<a name="line67"> 67: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>                   = 0,
<a name="line68"> 68: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_BOOLEAN_MACRO_FAILURE</a> = 1, <font color="#B22222">/* do not use */</font>

<a name="line70"> 70: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MIN_VALUE</a> = 54, <font color="#B22222">/* should always be one less than the smallest value */</font>

<a name="line72"> 72: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MEM</a>            = 55, <font color="#B22222">/* unable to allocate requested memory */</font>
<a name="line73"> 73: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SUP</a>            = 56, <font color="#B22222">/* no support for requested operation */</font>
<a name="line74"> 74: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SUP_SYS</a>        = 57, <font color="#B22222">/* no support for requested operation on this computer system */</font>
<a name="line75"> 75: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ORDER</a>          = 58, <font color="#B22222">/* operation done in wrong order */</font>
<a name="line76"> 76: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SIG</a>            = 59, <font color="#B22222">/* signal received */</font>
<a name="line77"> 77: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_FP</a>             = 72, <font color="#B22222">/* floating point exception */</font>
<a name="line78"> 78: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_COR</a>            = 74, <font color="#B22222">/* corrupted PETSc object */</font>
<a name="line79"> 79: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_LIB</a>            = 76, <font color="#B22222">/* error in library called by PETSc */</font>
<a name="line80"> 80: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_PLIB</a>           = 77, <font color="#B22222">/* PETSc library generated inconsistent data */</font>
<a name="line81"> 81: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MEMC</a>           = 78, <font color="#B22222">/* memory corruption */</font>
<a name="line82"> 82: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_CONV_FAILED</a>    = 82, <font color="#B22222">/* iterative method (<a href="../manualpages/KSP/KSP.html">KSP</a> or <a href="../manualpages/SNES/SNES.html">SNES</a>) failed */</font>
<a name="line83"> 83: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_USER</a>           = 83, <font color="#B22222">/* user has not provided needed function */</font>
<a name="line84"> 84: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_SYS</a>            = 88, <font color="#B22222">/* error in system call */</font>
<a name="line85"> 85: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_POINTER</a>        = 70, <font color="#B22222">/* pointer does not point to valid address */</font>
<a name="line86"> 86: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MPI_LIB_INCOMP</a> = 87, <font color="#B22222">/* MPI library at runtime is not compatible with MPI user compiled with */</font>

<a name="line88"> 88: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_SIZ</a>          = 60, <font color="#B22222">/* nonconforming object sizes used in operation */</font>
<a name="line89"> 89: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_IDN</a>          = 61, <font color="#B22222">/* two arguments not allowed to be the same */</font>
<a name="line90"> 90: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_WRONG</a>        = 62, <font color="#B22222">/* wrong argument (but object probably ok) */</font>
<a name="line91"> 91: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_CORRUPT</a>      = 64, <font color="#B22222">/* null or corrupted PETSc object as argument */</font>
<a name="line92"> 92: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>   = 63, <font color="#B22222">/* input argument, out of range */</font>
<a name="line93"> 93: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_BADPTR</a>       = 68, <font color="#B22222">/* invalid pointer argument */</font>
<a name="line94"> 94: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_NOTSAMETYPE</a>  = 69, <font color="#B22222">/* two args must be same object type */</font>
<a name="line95"> 95: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_NOTSAMECOMM</a>  = 80, <font color="#B22222">/* two args must be same communicators */</font>
<a name="line96"> 96: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_WRONGSTATE</a>   = 73, <font color="#B22222">/* object in argument is in wrong state, e.g. unassembled mat */</font>
<a name="line97"> 97: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_TYPENOTSET</a>   = 89, <font color="#B22222">/* the type of the object has not yet been set */</font>
<a name="line98"> 98: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_INCOMP</a>       = 75, <font color="#B22222">/* two arguments are incompatible */</font>
<a name="line99"> 99: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_NULL</a>         = 85, <font color="#B22222">/* argument is null that should not be */</font>
<a name="line100">100: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_UNKNOWN_TYPE</a> = 86, <font color="#B22222">/* type name doesn't match any registered type */</font>

<a name="line102">102: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_FILE_OPEN</a>       = 65, <font color="#B22222">/* unable to open file */</font>
<a name="line103">103: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_FILE_READ</a>       = 66, <font color="#B22222">/* unable to read from file */</font>
<a name="line104">104: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_FILE_WRITE</a>      = 67, <font color="#B22222">/* unable to write to file */</font>
<a name="line105">105: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_FILE_UNEXPECTED</a> = 79, <font color="#B22222">/* unexpected data in file */</font>

<a name="line107">107: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MAT_LU_ZRPVT</a> = 71, <font color="#B22222">/* detected a zero pivot during LU factorization */</font>
<a name="line108">108: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MAT_CH_ZRPVT</a> = 81, <font color="#B22222">/* detected a zero pivot during Cholesky factorization */</font>

<a name="line110">110: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_INT_OVERFLOW</a>   = 84,
<a name="line111">111: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_FLOP_COUNT</a>     = 90,
<a name="line112">112: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_NOT_CONVERGED</a>  = 91,  <font color="#B22222">/* solver did not converge */</font>
<a name="line113">113: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MISSING_FACTOR</a> = 92,  <font color="#B22222">/* <a href="../manualpages/Mat/MatGetFactor.html">MatGetFactor</a>() failed */</font>
<a name="line114">114: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_OPT_OVERWRITE</a>  = 93,  <font color="#B22222">/* attempted to over write options which should not be changed */</font>
<a name="line115">115: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_WRONG_MPI_SIZE</a> = 94,  <font color="#B22222">/* example/application run with number of MPI ranks it does not support */</font>
<a name="line116">116: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_USER_INPUT</a>     = 95,  <font color="#B22222">/* missing or incorrect user input */</font>
<a name="line117">117: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_GPU_RESOURCE</a>   = 96,  <font color="#B22222">/* unable to load a GPU resource, for example cuBLAS */</font>
<a name="line118">118: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_GPU</a>            = 97,  <font color="#B22222">/* An error from a GPU call, this may be due to lack of resources on the GPU or a true error in the call */</font>
<a name="line119">119: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MPI</a>            = 98,  <font color="#B22222">/* general MPI error */</font>
<a name="line120">120: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_RETURN</a>         = 99,  <font color="#B22222">/* <a href="../manualpages/Sys/PetscError.html">PetscError</a>() incorrectly returned an error code of 0 */</font>
<a name="line121">121: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MEM_LEAK</a>       = 100, <font color="#B22222">/* memory alloc/free imbalance */</font>
<a name="line122">122: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_PYTHON</a>         = 101, <font color="#B22222">/* Exception in Python */</font>
<a name="line123">123: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MAX_VALUE</a>      = 102, <font color="#B22222">/* this is always the one more than the largest error code */</font>

<a name="line125">125: </a>  <font color="#B22222">/*</font>
<a name="line126">126: </a><font color="#B22222">    do not use, exist purely to make the enum bounds equal that of a regular int (so conversion</font>
<a name="line127">127: </a><font color="#B22222">    to int in main() is not undefined behavior)</font>
<a name="line128">128: </a><font color="#B22222">  */</font>
<a name="line129">129: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MIN_SIGNED_BOUND_DO_NOT_USE</a> = INT_MIN,
<a name="line130">130: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_MAX_SIGNED_BOUND_DO_NOT_USE</a> = INT_MAX
<a name="line131">131: </a>} PETSC_ERROR_CODE_ENUM_NAME;

<a name="line133">133: </a><font color="#A020F0">#ifndef PETSC_USE_STRICT_PETSCERRORCODE</font>
<a name="line134">134: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>;</font>

<a name="line136">136: </a>  <font color="#B22222">/*</font>
<a name="line137">137: </a><font color="#B22222">  Needed so that C++ lambdas can deduce the return type as <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> from</font>
<a name="line138">138: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>). Otherwise we get</font>

<a name="line140">140: </a><font color="#B22222">  error: return type '(unnamed enum at include/petscsystypes.h:50:1)' must match previous</font>
<a name="line141">141: </a><font color="#B22222">  return type 'int' when lambda expression has unspecified explicit return type</font>
<a name="line142">142: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscFunctionReturn.html">PetscFunctionReturn</a>(<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a>);</font>
<a name="line143">143: </a><font color="#B22222">  ^</font>
<a name="line144">144: </a><font color="#B22222">*/</font>
<a name="line145">145: </a><strong><font color="#228B22">  #define <a href="../manualpages/Sys/PetscErrorCode.html">PETSC_SUCCESS</a> ((<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)0)</font></strong>
<a name="line146">146: </a><font color="#A020F0">#endif</font>

<a name="line148">148: </a><strong><font color="#228B22">#undef PETSC_ERROR_CODE_NODISCARD</font></strong>
<a name="line149">149: </a><strong><font color="#228B22">#undef PETSC_ERROR_CODE_TYPEDEF</font></strong>
<a name="line150">150: </a><strong><font color="#228B22">#undef PETSC_ERROR_CODE_ENUM_NAME</font></strong>

<a name="line152">152: </a><font color="#B22222">/*MC</font>
<a name="line153">153: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a> - A unique id used to identify each PETSc class.</font>

<a name="line155">155: </a><font color="#B22222">    Level: developer</font>

<a name="line157">157: </a><font color="#B22222">    Note:</font>
<a name="line158">158: </a><font color="#B22222">    Use `<a href="../manualpages/Log/PetscClassIdRegister.html">PetscClassIdRegister</a>()` to obtain a new value for a new class being created. Usually</font>
<a name="line159">159: </a><font color="#B22222">    XXXInitializePackage() calls it for each class it defines.</font>

<a name="line161">161: </a><font color="#B22222">    Developer Note:</font>
<a name="line162">162: </a><font color="#B22222">    Internal integer stored in the `_p_PetscObject` data structure. These are all computed by an offset from the lowest one, `PETSC_SMALLEST_CLASSID`.</font>

<a name="line164">164: </a><font color="#B22222">.seealso: `<a href="../manualpages/Log/PetscClassIdRegister.html">PetscClassIdRegister</a>()`, `<a href="../manualpages/Log/PetscLogEventRegister.html">PetscLogEventRegister</a>()`, `<a href="../manualpages/Sys/PetscHeaderCreate.html">PetscHeaderCreate</a>()`</font>
<a name="line165">165: </a><font color="#B22222">M*/</font>
<a name="line166">166: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscClassId.html">PetscClassId</a>;</font>

<a name="line168">168: </a><font color="#B22222">/*MC</font>
<a name="line169">169: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a> - datatype used to represent 'int' parameters to MPI functions.</font>

<a name="line171">171: </a><font color="#B22222">    Level: intermediate</font>

<a name="line173">173: </a><font color="#B22222">    Notes:</font>
<a name="line174">174: </a><font color="#B22222">    This is always a 32-bit integer, sometimes it is the same as `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, but if PETSc was built with `--with-64-bit-indices` but</font>
<a name="line175">175: </a><font color="#B22222">    standard C/Fortran integers are 32-bit then this is NOT the same as `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`; it remains 32-bit.</font>

<a name="line177">177: </a><font color="#B22222">    `<a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>`(a,&amp;b) checks if the given `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` a will fit in a `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, if not it</font>
<a name="line178">178: </a><font color="#B22222">    generates a `<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>` error.</font>

<a name="line180">180: </a><font color="#B22222">.seealso: [](stylePetscCount), `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscMPIIntCast.html">PetscMPIIntCast</a>()`</font>
<a name="line181">181: </a><font color="#B22222">M*/</font>
<a name="line182">182: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>;</font>

<a name="line184">184: </a><font color="#B22222">/* Limit MPI to 32-bits */</font>
<a name="line185">185: </a><font color="#4169E1">enum</font> {
<a name="line186">186: </a>  PETSC_MPI_INT_MIN = INT_MIN,
<a name="line187">187: </a>  PETSC_MPI_INT_MAX = INT_MAX
<a name="line188">188: </a>};

<a name="line190">190: </a><font color="#B22222">/*MC</font>
<a name="line191">191: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscSizeT.html">PetscSizeT</a> - datatype used to represent sizes in memory (like `size_t`)</font>

<a name="line193">193: </a><font color="#B22222">    Level: intermediate</font>

<a name="line195">195: </a><font color="#B22222">    Notes:</font>
<a name="line196">196: </a><font color="#B22222">    This is equivalent to `size_t`, but defined for consistency with Fortran, which lacks a native equivalent of `size_t`.</font>

<a name="line198">198: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `PetscInt64`, `<a href="../manualpages/Sys/PetscCount.html">PetscCount</a>`</font>
<a name="line199">199: </a><font color="#B22222">M*/</font>
<a name="line200">200: </a><font color="#4169E1">typedef size_t <a href="../manualpages/Sys/PetscSizeT.html">PetscSizeT</a>;</font>

<a name="line202">202: </a><font color="#B22222">/*MC</font>
<a name="line203">203: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscCount.html">PetscCount</a> - signed datatype used to represent counts</font>

<a name="line205">205: </a><font color="#B22222">    Level: intermediate</font>

<a name="line207">207: </a><font color="#B22222">    Notes:</font>
<a name="line208">208: </a><font color="#B22222">    This is equivalent to `ptrdiff_t`, but defined for consistency with Fortran, which lacks a native equivalent of `ptrdiff_t`.</font>

<a name="line210">210: </a><font color="#B22222">    Use `PetscCount_FMT` to format with `<a href="../manualpages/Sys/PetscPrintf.html">PetscPrintf</a>()`, `printf()`, and related functions.</font>

<a name="line212">212: </a><font color="#B22222">.seealso: [](stylePetscCount), `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `PetscInt64`, `<a href="../manualpages/Sys/PetscSizeT.html">PetscSizeT</a>`</font>
<a name="line213">213: </a><font color="#B22222">M*/</font>
<a name="line214">214: </a><font color="#4169E1">typedef ptrdiff_t <a href="../manualpages/Sys/PetscCount.html">PetscCount</a>;</font>
<a name="line215">215: </a><strong><font color="#228B22">#define PetscCount_FMT </font><font color="#666666">"td"</font><font color="#228B22"></font></strong>

<a name="line217">217: </a><font color="#B22222">/*MC</font>
<a name="line218">218: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscEnum.html">PetscEnum</a> - datatype used to pass enum types within PETSc functions.</font>

<a name="line220">220: </a><font color="#B22222">    Level: intermediate</font>

<a name="line222">222: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscOptionsGetEnum.html">PetscOptionsGetEnum</a>()`, `<a href="../manualpages/Sys/PetscOptionsEnum.html">PetscOptionsEnum</a>()`, `<a href="../manualpages/Bag/PetscBagRegisterEnum.html">PetscBagRegisterEnum</a>()`</font>
<a name="line223">223: </a><font color="#B22222">M*/</font>
<a name="line224">224: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line225">225: </a>  ENUM_DUMMY
<a name="line226">226: </a>} <a href="../manualpages/Sys/PetscEnum.html">PetscEnum</a>;

<a name="line228">228: </a><font color="#4169E1">typedef short PetscShort;</font>
<a name="line229">229: </a><font color="#4169E1">typedef float PetscFloat;</font>

<a name="line231">231: </a><font color="#B22222">/*MC</font>
<a name="line232">232: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> - PETSc type that represents an integer, used primarily to</font>
<a name="line233">233: </a><font color="#B22222">             represent size of arrays and indexing into arrays. Its size can be configured with the option `--with-64-bit-indices` to be either 32-bit (default) or 64-bit.</font>

<a name="line235">235: </a><font color="#B22222">  Level: beginner</font>

<a name="line237">237: </a><font color="#B22222">  Notes:</font>
<a name="line238">238: </a><font color="#B22222">  For MPI calls that require datatypes, use `<a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a>` as the datatype for `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`. It will automatically work correctly regardless of the size of `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`.</font>

<a name="line240">240: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`, `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`, `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>`, `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>`, `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>`, `<a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a>`, `<a href="../manualpages/Sys/PetscIntCast.html">PetscIntCast</a>()`</font>
<a name="line241">241: </a><font color="#B22222">M*/</font>

<a name="line243">243: </a><font color="#A020F0">#if defined(PETSC_HAVE_STDINT_H)</font>
<a name="line244">244: </a><font color="#A020F0">  #include &lt;stdint.h&gt;</font>
<a name="line245">245: </a><font color="#A020F0">#endif</font>
<a name="line246">246: </a><font color="#A020F0">#if defined(PETSC_HAVE_INTTYPES_H)</font>
<a name="line249">249: </a><font color="#A020F0">  #endif</font>
<a name="line250">250: </a><font color="#A020F0">  #include &lt;inttypes.h&gt;</font>
<a name="line251">251: </a><font color="#A020F0">  #if !defined(PRId64)</font>
<a name="line252">252: </a><strong><font color="#228B22">    #define PRId64 </font><font color="#666666">"ld"</font><font color="#228B22"></font></strong>
<a name="line253">253: </a><font color="#A020F0">  #endif</font>
<a name="line254">254: </a><font color="#A020F0">#endif</font>

<a name="line256">256: </a><font color="#A020F0">#if defined(PETSC_HAVE_STDINT_H) &amp;&amp; defined(PETSC_HAVE_INTTYPES_H) &amp;&amp; (defined(PETSC_HAVE_MPIUNI) || defined(PETSC_HAVE_MPI_INT64_T)) </font><font color="#B22222">/* MPI_INT64_T is not guaranteed to be a macro */</font><font color="#A020F0"></font>
<a name="line257">257: </a><font color="#4169E1">typedef int64_t PetscInt64;</font>

<a name="line259">259: </a><strong><font color="#228B22">  #define PETSC_INT64_MIN INT64_MIN</font></strong>
<a name="line260">260: </a><strong><font color="#228B22">  #define PETSC_INT64_MAX INT64_MAX</font></strong>

<a name="line262">262: </a><font color="#A020F0">#elif (PETSC_SIZEOF_LONG_LONG == 8)</font>
<a name="line263">263: </a><font color="#4169E1">typedef long long PetscInt64;</font>

<a name="line265">265: </a><strong><font color="#228B22">  #define PETSC_INT64_MIN LLONG_MIN</font></strong>
<a name="line266">266: </a><strong><font color="#228B22">  #define PETSC_INT64_MAX LLONG_MAX</font></strong>

<a name="line268">268: </a><font color="#A020F0">#elif defined(PETSC_HAVE___INT64)</font>
<a name="line269">269: </a><font color="#4169E1">typedef __int64 PetscInt64;</font>

<a name="line271">271: </a><strong><font color="#228B22">  #define PETSC_INT64_MIN INT64_MIN</font></strong>
<a name="line272">272: </a><strong><font color="#228B22">  #define PETSC_INT64_MAX INT64_MAX</font></strong>

<a name="line274">274: </a><font color="#A020F0">#else</font>
<a name="line275">275: </a><font color="#A020F0">  #error </font><font color="#666666">"cannot determine PetscInt64 type"</font><font color="#A020F0"></font>
<a name="line276">276: </a><font color="#A020F0">#endif</font>

<a name="line278">278: </a><font color="#A020F0">#if PETSC_SIZEOF_SIZE_T == 4</font>
<a name="line279">279: </a><strong><font color="#228B22">  #define PETSC_COUNT_MIN INT_MIN</font></strong>
<a name="line280">280: </a><strong><font color="#228B22">  #define PETSC_COUNT_MAX INT_MAX</font></strong>
<a name="line281">281: </a><font color="#A020F0">#else</font>
<a name="line282">282: </a><strong><font color="#228B22">  #define PETSC_COUNT_MIN PETSC_INT64_MIN</font></strong>
<a name="line283">283: </a><strong><font color="#228B22">  #define PETSC_COUNT_MAX PETSC_INT64_MAX</font></strong>
<a name="line284">284: </a><font color="#A020F0">#endif</font>

<a name="line286">286: </a><font color="#4169E1">typedef int32_t PetscInt32;</font>
<a name="line287">287: </a><strong><font color="#228B22">#define PETSC_INT32_MIN INT32_MIN</font></strong>
<a name="line288">288: </a><strong><font color="#228B22">#define PETSC_INT32_MAX INT32_MAX</font></strong>

<a name="line290">290: </a><font color="#A020F0">#if defined(PETSC_USE_64BIT_INDICES)</font>
<a name="line291">291: </a><font color="#4169E1">typedef PetscInt64 <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>;</font>

<a name="line293">293: </a><strong><font color="#228B22">  #define PETSC_INT_MIN PETSC_INT64_MIN</font></strong>
<a name="line294">294: </a><strong><font color="#228B22">  #define PETSC_INT_MAX PETSC_INT64_MAX</font></strong>
<a name="line295">295: </a><strong><font color="#228B22">  #define PetscInt_FMT  PetscInt64_FMT</font></strong>
<a name="line296">296: </a><font color="#A020F0">#else</font>
<a name="line297">297: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>;</font>

<a name="line299">299: </a><font color="#4169E1">enum</font> {
<a name="line300">300: </a>  PETSC_INT_MIN = INT_MIN,
<a name="line301">301: </a>  PETSC_INT_MAX = INT_MAX
<a name="line302">302: </a>};
<a name="line303">303: </a><strong><font color="#228B22">  #define PetscInt_FMT </font><font color="#666666">"d"</font><font color="#228B22"></font></strong>
<a name="line304">304: </a><font color="#A020F0">#endif</font>

<a name="line306">306: </a><strong><font color="#228B22">#define PETSC_UINT16_MAX 65535</font></strong>

<a name="line308">308: </a><font color="#B22222">/* deprecated */</font>
<a name="line309">309: </a><strong><font color="#228B22">#define PETSC_MIN_INT    PETSC_INT_MIN</font></strong>
<a name="line310">310: </a><strong><font color="#228B22">#define PETSC_MAX_INT    PETSC_INT_MAX</font></strong>
<a name="line311">311: </a><strong><font color="#228B22">#define PETSC_MAX_UINT16 PETSC_UINT16_MAX</font></strong>

<a name="line313">313: </a><font color="#A020F0">#if defined(PETSC_HAVE_STDINT_H) &amp;&amp; defined(PETSC_HAVE_INTTYPES_H) &amp;&amp; (defined(PETSC_HAVE_MPIUNI) || defined(PETSC_HAVE_MPI_INT64_T)) </font><font color="#B22222">/* MPI_INT64_T is not guaranteed to be a macro */</font><font color="#A020F0"></font>
<a name="line314">314: </a><strong><font color="#228B22">  #define MPIU_INT64     MPI_INT64_T</font></strong>
<a name="line315">315: </a><strong><font color="#228B22">  #define PetscInt64_FMT PRId64</font></strong>
<a name="line316">316: </a><font color="#A020F0">#elif (PETSC_SIZEOF_LONG_LONG == 8)</font>
<a name="line317">317: </a><strong><font color="#228B22">  #define MPIU_INT64     MPI_LONG_LONG_INT</font></strong>
<a name="line318">318: </a><strong><font color="#228B22">  #define PetscInt64_FMT </font><font color="#666666">"lld"</font><font color="#228B22"></font></strong>
<a name="line319">319: </a><font color="#A020F0">#elif defined(PETSC_HAVE___INT64)</font>
<a name="line320">320: </a><strong><font color="#228B22">  #define MPIU_INT64     MPI_INT64_T</font></strong>
<a name="line321">321: </a><strong><font color="#228B22">  #define PetscInt64_FMT </font><font color="#666666">"ld"</font><font color="#228B22"></font></strong>
<a name="line322">322: </a><font color="#A020F0">#else</font>
<a name="line323">323: </a><font color="#A020F0">  #error </font><font color="#666666">"cannot determine PetscInt64 type"</font><font color="#A020F0"></font>
<a name="line324">324: </a><font color="#A020F0">#endif</font>

<a name="line326">326: </a><strong><font color="#228B22">#define MPIU_INT32     MPI_INT32_T</font></strong>
<a name="line327">327: </a><strong><font color="#228B22">#define PetscInt32_FMT PRId32</font></strong>

<a name="line329">329: </a><font color="#B22222">/*MC</font>
<a name="line330">330: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a> - datatype used to represent 'int' parameters to BLAS/LAPACK functions.</font>

<a name="line332">332: </a><font color="#B22222">   Level: intermediate</font>

<a name="line334">334: </a><font color="#B22222">   Notes:</font>
<a name="line335">335: </a><font color="#B22222">   Usually this is the same as `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, but if PETSc was built with `--with-64-bit-indices` but</font>
<a name="line336">336: </a><font color="#B22222">   standard C/Fortran integers are 32-bit then this may not be the same as `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`,</font>
<a name="line337">337: </a><font color="#B22222">   except on some BLAS/LAPACK implementations that support 64-bit integers see the notes below.</font>

<a name="line339">339: </a><font color="#B22222">   `<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>` `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>`(a,&amp;b) checks if the given `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` a will fit in a `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, if not it</font>
<a name="line340">340: </a><font color="#B22222">    generates a `<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>` error</font>

<a name="line342">342: </a><font color="#B22222">   Installation Notes\:</font>
<a name="line343">343: </a><font color="#B22222">   ./configure automatically determines the size of the integers used by BLAS/LAPACK except when `--with-batch` is used</font>
<a name="line344">344: </a><font color="#B22222">   in that situation one must know (by some other means) if the integers used by BLAS/LAPACK are 64-bit and if so pass the flag `--known-64-bit-blas-indices`</font>

<a name="line346">346: </a><font color="#B22222">   MATLAB ships with BLAS and LAPACK that use 64-bit integers, for example if you run ./configure with, the option</font>
<a name="line347">347: </a><font color="#B22222">    `--with-blaslapack-lib`=[/Applications/MATLAB_R2010b.app/bin/maci64/libmwblas.dylib,/Applications/MATLAB_R2010b.app/bin/maci64/libmwlapack.dylib]</font>

<a name="line349">349: </a><font color="#B22222">   MKL ships with both 32 and 64-bit integer versions of the BLAS and LAPACK. If you pass the flag `-with-64-bit-blas-indices` PETSc will link</font>
<a name="line350">350: </a><font color="#B22222">   against the 64-bit version, otherwise it uses the 32-bit version</font>

<a name="line352">352: </a><font color="#B22222">   OpenBLAS can be built to use 64-bit integers. The ./configure options `--download-openblas` `-with-64-bit-blas-indices` will build a 64-bit integer version</font>

<a name="line354">354: </a><font color="#B22222">   External packages such as hypre, ML, SuperLU etc do not provide any support for passing 64-bit integers to BLAS/LAPACK so cannot</font>
<a name="line355">355: </a><font color="#B22222">   be used with PETSc when PETSc links against 64-bit integer BLAS/LAPACK. ./configure will generate an error if you attempt to link PETSc against any of</font>
<a name="line356">356: </a><font color="#B22222">   these external libraries while using 64-bit integer BLAS/LAPACK.</font>

<a name="line358">358: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`</font>
<a name="line359">359: </a><font color="#B22222">M*/</font>
<a name="line360">360: </a><font color="#A020F0">#if defined(PETSC_HAVE_64BIT_BLAS_INDICES)</font>
<a name="line361">361: </a><font color="#4169E1">typedef PetscInt64 <a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>;</font>

<a name="line363">363: </a><strong><font color="#228B22">  #define PETSC_BLAS_INT_MIN PETSC_INT64_MIN</font></strong>
<a name="line364">364: </a><strong><font color="#228B22">  #define PETSC_BLAS_INT_MAX PETSC_INT64_MAX</font></strong>
<a name="line365">365: </a><strong><font color="#228B22">  #define PetscBLASInt_FMT   PetscInt64_FMT</font></strong>
<a name="line366">366: </a><font color="#A020F0">#else</font>
<a name="line367">367: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>;</font>

<a name="line369">369: </a><font color="#4169E1">enum</font> {
<a name="line370">370: </a>  PETSC_BLAS_INT_MIN = INT_MIN,
<a name="line371">371: </a>  PETSC_BLAS_INT_MAX = INT_MAX
<a name="line372">372: </a>};

<a name="line374">374: </a><strong><font color="#228B22">  #define PetscBLASInt_FMT </font><font color="#666666">"d"</font><font color="#228B22"></font></strong>
<a name="line375">375: </a><font color="#A020F0">#endif</font>

<a name="line377">377: </a><font color="#B22222">/*MC</font>
<a name="line378">378: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a> - datatype used to represent 'int' parameters to cuBLAS/cuSOLVER functions.</font>

<a name="line380">380: </a><font color="#B22222">   Level: intermediate</font>

<a name="line382">382: </a><font color="#B22222">   Notes:</font>
<a name="line383">383: </a><font color="#B22222">   As of this writing `<a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>` is always the system `int`.</font>

<a name="line385">385: </a><font color="#B22222">  `<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>` `<a href="../manualpages/Sys/PetscCuBLASIntCast.html">PetscCuBLASIntCast</a>`(a,&amp;b) checks if the given `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` a will fit in a `<a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>`, if not it</font>
<a name="line386">386: </a><font color="#B22222">   generates a `<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>` error</font>

<a name="line388">388: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscCuBLASIntCast.html">PetscCuBLASIntCast</a>()`</font>
<a name="line389">389: </a><font color="#B22222">M*/</font>
<a name="line390">390: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscCuBLASInt.html">PetscCuBLASInt</a>;</font>

<a name="line392">392: </a><font color="#4169E1">enum</font> {
<a name="line393">393: </a>  PETSC_CUBLAS_INT_MIN = INT_MIN,
<a name="line394">394: </a>  PETSC_CUBLAS_INT_MAX = INT_MAX
<a name="line395">395: </a>};

<a name="line397">397: </a><font color="#B22222">/*MC</font>
<a name="line398">398: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a> - datatype used to represent 'int' parameters to hipBLAS/hipSOLVER functions.</font>

<a name="line400">400: </a><font color="#B22222">   Level: intermediate</font>

<a name="line402">402: </a><font color="#B22222">   Notes:</font>
<a name="line403">403: </a><font color="#B22222">   `<a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>` is always the system `int`.</font>

<a name="line405">405: </a><font color="#B22222">   `<a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>` `<a href="../manualpages/Sys/PetscHipBLASIntCast.html">PetscHipBLASIntCast</a>`(a,&amp;b) checks if the given `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>` a will fit in a `<a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>`, if not it</font>
<a name="line406">406: </a><font color="#B22222">   generates a `<a href="../manualpages/Sys/PetscErrorCode.html">PETSC_ERR_ARG_OUTOFRANGE</a>` error</font>

<a name="line408">408: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBLASInt.html">PetscBLASInt</a>`, `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscHipBLASIntCast.html">PetscHipBLASIntCast</a>()`</font>
<a name="line409">409: </a><font color="#B22222">M*/</font>
<a name="line410">410: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscHipBLASInt.html">PetscHipBLASInt</a>;</font>

<a name="line412">412: </a><font color="#4169E1">enum</font> {
<a name="line413">413: </a>  PETSC_HIPBLAS_INT_MIN = INT_MIN,
<a name="line414">414: </a>  PETSC_HIPBLAS_INT_MAX = INT_MAX
<a name="line415">415: </a>};

<a name="line417">417: </a><font color="#B22222">/*MC</font>
<a name="line418">418: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscExodusIIInt.html">PetscExodusIIInt</a> - datatype used to represent 'int' parameters to ExodusII functions.</font>

<a name="line420">420: </a><font color="#B22222">   Level: intermediate</font>

<a name="line422">422: </a><font color="#B22222">   Notes:</font>
<a name="line423">423: </a><font color="#B22222">   This is the same as `int`</font>

<a name="line425">425: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscExodusIIFloat.html">PetscExodusIIFloat</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`</font>
<a name="line426">426: </a><font color="#B22222">M*/</font>
<a name="line427">427: </a><font color="#4169E1">typedef int <a href="../manualpages/Sys/PetscExodusIIInt.html">PetscExodusIIInt</a>;</font>
<a name="line428">428: </a><strong><font color="#228B22">#define PetscExodusIIInt_FMT </font><font color="#666666">"d"</font><font color="#228B22"></font></strong>

<a name="line430">430: </a><font color="#B22222">/*MC</font>
<a name="line431">431: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscExodusIIFloat.html">PetscExodusIIFloat</a> - datatype used to represent 'float' parameters to ExodusII functions.</font>

<a name="line433">433: </a><font color="#B22222">   Level: intermediate</font>

<a name="line435">435: </a><font color="#B22222">   Notes:</font>
<a name="line436">436: </a><font color="#B22222">   This is the same as `float`</font>

<a name="line438">438: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscMPIInt.html">PetscMPIInt</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/PetscExodusIIInt.html">PetscExodusIIInt</a>`, `<a href="../manualpages/Sys/PetscBLASIntCast.html">PetscBLASIntCast</a>()`</font>
<a name="line439">439: </a><font color="#B22222">M*/</font>
<a name="line440">440: </a><font color="#4169E1">typedef float <a href="../manualpages/Sys/PetscExodusIIFloat.html">PetscExodusIIFloat</a>;</font>

<a name="line442">442: </a><font color="#B22222">/*E</font>
<a name="line443">443: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>  - Logical variable. Actually an enum in C and a logical in Fortran.</font>

<a name="line445">445: </a><font color="#B22222">   Level: beginner</font>

<a name="line447">447: </a><font color="#B22222">   Developer Note:</font>
<a name="line448">448: </a><font color="#B22222">   Why have `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`, why not use bool in C? The problem is that K and R C, C99 and C++ all have different mechanisms for</font>
<a name="line449">449: </a><font color="#B22222">   Boolean values. It is not easy to have a simple macro that will work properly in all circumstances with all three mechanisms.</font>

<a name="line451">451: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>`, `<a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>`, `<a href="../manualpages/Sys/PetscNot.html">PetscNot</a>()`, `<a href="../manualpages/Sys/PetscBool3.html">PetscBool3</a>`</font>
<a name="line452">452: </a><font color="#B22222">E*/</font>
<a name="line453">453: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line454">454: </a>  <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>,
<a name="line455">455: </a>  <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>
<a name="line456">456: </a>} <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>;
<a name="line457">457: </a>PETSC_EXTERN const char *const PetscBools[];

<a name="line459">459: </a><font color="#B22222">/*E</font>
<a name="line460">460: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBool3.html">PetscBool3</a>  - Ternary logical variable. Actually an enum in C and a 4 byte integer in Fortran.</font>

<a name="line462">462: </a><font color="#B22222">   Level: beginner</font>

<a name="line464">464: </a><font color="#B22222">   Note:</font>
<a name="line465">465: </a><font color="#B22222">   Should not be used with the if (flg) or if (!flg) syntax.</font>

<a name="line467">467: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>`, `<a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>`, `<a href="../manualpages/Sys/PetscNot.html">PetscNot</a>()`, `<a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_TRUE</a>`, `<a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_FALSE</a>`, `<a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_UNKNOWN</a>`</font>
<a name="line468">468: </a><font color="#B22222">E*/</font>
<a name="line469">469: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line470">470: </a>  <a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_FALSE</a>   = 0,
<a name="line471">471: </a>  <a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_TRUE</a>    = 1,
<a name="line472">472: </a>  <a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_UNKNOWN</a> = -1 <font color="#B22222">/* the value is unknown at the time of query, but might be determined later */</font>
<a name="line473">473: </a>} <a href="../manualpages/Sys/PetscBool3.html">PetscBool3</a>;

<a name="line475">475: </a><strong><font color="#228B22">#define PetscBool3ToBool(a) ((a) == <a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_TRUE</a> ? <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a> : <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>)</font></strong>
<a name="line476">476: </a><strong><font color="#228B22">#define PetscBoolToBool3(a) ((a) == <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a> ? <a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_TRUE</a> : <a href="../manualpages/Sys/PetscBool3.html">PETSC_BOOL3_FALSE</a>)</font></strong>

<a name="line478">478: </a><font color="#B22222">/*MC</font>
<a name="line479">479: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> - PETSc type that represents a real number version of `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`</font>

<a name="line481">481: </a><font color="#B22222">   Level: beginner</font>

<a name="line483">483: </a><font color="#B22222">   Notes:</font>
<a name="line484">484: </a><font color="#B22222">   For MPI calls that require datatypes, use `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>` as the datatype for `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>` and `MPIU_SUM`, `MPIU_MAX`, etc. for operations.</font>
<a name="line485">485: </a><font color="#B22222">   They will automatically work correctly regardless of the size of `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`.</font>

<a name="line487">487: </a><font color="#B22222">   See `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>` for details on how to ./configure the size of `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`.</font>

<a name="line489">489: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`, `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>`, `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>`, `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>`, `<a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a>`</font>
<a name="line490">490: </a><font color="#B22222">M*/</font>

<a name="line492">492: </a><font color="#A020F0">#if defined(PETSC_USE_REAL_SINGLE)</font>
<a name="line493">493: </a><font color="#4169E1">typedef float <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>;</font>
<a name="line494">494: </a><font color="#A020F0">#elif defined(PETSC_USE_REAL_DOUBLE)</font>
<a name="line495">495: </a><font color="#4169E1">typedef double <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>;</font>
<a name="line496">496: </a><font color="#A020F0">#elif defined(PETSC_USE_REAL___FLOAT128)</font>
<a name="line497">497: </a><font color="#A020F0">  #if defined(__cplusplus)</font>
<a name="line498">498: </a>extern <font color="#666666">"C"</font> {
<a name="line499">499: </a><font color="#A020F0">  #endif</font>
<a name="line500">500: </a><font color="#A020F0">  #include &lt;quadmath.h&gt;</font>
<a name="line501">501: </a><font color="#A020F0">  #if defined(__cplusplus)</font>
<a name="line502">502: </a>}
<a name="line503">503: </a><font color="#A020F0">  #endif</font>
<a name="line504">504: </a><font color="#4169E1">typedef __float128 <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>;</font>
<a name="line505">505: </a><font color="#A020F0">#elif defined(PETSC_USE_REAL___FP16)</font>
<a name="line506">506: </a><font color="#4169E1">typedef __fp16 <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>;</font>
<a name="line507">507: </a><font color="#A020F0">#endif </font><font color="#B22222">/* PETSC_USE_REAL_* */</font><font color="#A020F0"></font>

<a name="line509">509: </a><font color="#B22222">/*MC</font>
<a name="line510">510: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a> - PETSc type that represents a complex number with precision matching that of `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`.</font>

<a name="line512">512: </a><font color="#B22222">   Synopsis:</font>
<a name="line513">513: </a>#include <A href="../include/petscsys.h.html">&lt;petscsys.h&gt;</A>
<a name="line514">514: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a> number = 1. + 2.*<a href="../manualpages/Sys/PETSC_i.html">PETSC_i</a>;</font>

<a name="line516">516: </a><font color="#B22222">   Level: beginner</font>

<a name="line518">518: </a><font color="#B22222">   Notes:</font>
<a name="line519">519: </a><font color="#B22222">   For MPI calls that require datatypes, use `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>` as the datatype for `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>` and `MPIU_SUM` etc for operations.</font>
<a name="line520">520: </a><font color="#B22222">   They will automatically work correctly regardless of the size of `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>`.</font>

<a name="line522">522: </a><font color="#B22222">   See `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>` for details on how to ./configure the size of `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`</font>

<a name="line524">524: </a><font color="#B22222">   Complex numbers are automatically available if PETSc was able to find a working complex implementation</font>

<a name="line526">526: </a><font color="#B22222">    PETSc has a 'fix' for complex numbers to support expressions such as `std::complex&lt;<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>&gt;` + `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, which are not supported by the standard</font>
<a name="line527">527: </a><font color="#B22222">    C++ library, but are convenient for PETSc users. If the C++ compiler is able to compile code in `petsccxxcomplexfix.h` (This is checked by</font>
<a name="line528">528: </a><font color="#B22222">    configure), we include `petsccxxcomplexfix.h` to provide this convenience.</font>

<a name="line530">530: </a><font color="#B22222">    If the fix causes conflicts, or one really does not want this fix for a particular C++ file, one can define `PETSC_SKIP_CXX_COMPLEX_FIX`</font>
<a name="line531">531: </a><font color="#B22222">    at the beginning of the C++ file to skip the fix.</font>

<a name="line533">533: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`, `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`, `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>`, `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>`, `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>`, `<a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a>`, `<a href="../manualpages/Sys/PETSC_i.html">PETSC_i</a>`</font>
<a name="line534">534: </a><font color="#B22222">M*/</font>
<a name="line535">535: </a><font color="#A020F0">#if !defined(PETSC_SKIP_COMPLEX)</font>
<a name="line536">536: </a><font color="#A020F0">  #if defined(PETSC_CLANGUAGE_CXX)</font>
<a name="line537">537: </a><font color="#A020F0">    #if !defined(PETSC_USE_REAL___FP16) &amp;&amp; !defined(PETSC_USE_REAL___FLOAT128)</font>
<a name="line538">538: </a><font color="#A020F0">      #if defined(__cplusplus) &amp;&amp; defined(PETSC_HAVE_CXX_COMPLEX) </font><font color="#B22222">/* enable complex for library code */</font><font color="#A020F0"></font>
<a name="line539">539: </a><strong><font color="#228B22">        #define PETSC_HAVE_COMPLEX 1</font></strong>
<a name="line540">540: </a><font color="#A020F0">      #elif !defined(__cplusplus) &amp;&amp; defined(PETSC_HAVE_C99_COMPLEX) &amp;&amp; defined(PETSC_HAVE_CXX_COMPLEX) </font><font color="#B22222">/* User code only - conditional on library code complex support */</font><font color="#A020F0"></font>
<a name="line541">541: </a><strong><font color="#228B22">        #define PETSC_HAVE_COMPLEX 1</font></strong>
<a name="line542">542: </a><font color="#A020F0">      #endif</font>
<a name="line543">543: </a><font color="#A020F0">    #elif defined(PETSC_USE_REAL___FLOAT128) &amp;&amp; defined(PETSC_HAVE_C99_COMPLEX)</font>
<a name="line544">544: </a><strong><font color="#228B22">      #define PETSC_HAVE_COMPLEX 1</font></strong>
<a name="line545">545: </a><font color="#A020F0">    #endif</font>
<a name="line546">546: </a><font color="#A020F0">  #else </font><font color="#B22222">/* !PETSC_CLANGUAGE_CXX */</font><font color="#A020F0"></font>
<a name="line547">547: </a><font color="#A020F0">    #if !defined(PETSC_USE_REAL___FP16)</font>
<a name="line549">549: </a><strong><font color="#228B22">        #define PETSC_HAVE_COMPLEX 1</font></strong>
<a name="line550">550: </a><font color="#A020F0">      #elif defined(__cplusplus) &amp;&amp; defined(PETSC_HAVE_C99_COMPLEX) &amp;&amp; defined(PETSC_HAVE_CXX_COMPLEX) </font><font color="#B22222">/* User code only - conditional on library code complex support */</font><font color="#A020F0"></font>
<a name="line551">551: </a><strong><font color="#228B22">        #define PETSC_HAVE_COMPLEX 1</font></strong>
<a name="line552">552: </a><font color="#A020F0">      #endif</font>
<a name="line553">553: </a><font color="#A020F0">    #endif</font>
<a name="line554">554: </a><font color="#A020F0">  #endif </font><font color="#B22222">/* PETSC_CLANGUAGE_CXX */</font><font color="#A020F0"></font>
<a name="line555">555: </a><font color="#A020F0">#endif   </font><font color="#B22222">/* !PETSC_SKIP_COMPLEX */</font><font color="#A020F0"></font>

<a name="line557">557: </a><font color="#A020F0">#if defined(PETSC_HAVE_COMPLEX)</font>
<a name="line558">558: </a><font color="#A020F0">  #if defined(__cplusplus) </font><font color="#B22222">/* C++ complex support */</font><font color="#A020F0"></font>
<a name="line559">559: </a>    <font color="#B22222">/* Locate a C++ complex template library */</font>
<a name="line560">560: </a><font color="#A020F0">    #if defined(PETSC_DESIRE_KOKKOS_COMPLEX) </font><font color="#B22222">/* Defined in petscvec_kokkos.hpp for *.kokkos.cxx files */</font><font color="#A020F0"></font>
<a name="line561">561: </a><strong><font color="#228B22">      #define petsccomplexlib Kokkos</font></strong>
<a name="line562">562: </a><font color="#A020F0">      #include &lt;Kokkos_Complex.hpp&gt;</font>
<a name="line563">563: </a><font color="#A020F0">    #elif (defined(__CUDACC__) &amp;&amp; defined(PETSC_HAVE_CUDA)) || (defined(__HIPCC__) &amp;&amp; defined(PETSC_HAVE_HIP))</font>
<a name="line564">564: </a><strong><font color="#228B22">      #define petsccomplexlib thrust</font></strong>
<a name="line565">565: </a><font color="#A020F0">      #include &lt;thrust/complex.h&gt;</font>
<a name="line566">566: </a><font color="#A020F0">    #elif defined(PETSC_USE_REAL___FLOAT128)</font>
<a name="line567">567: </a><font color="#A020F0">      #include &lt;complex.h&gt;</font>
<a name="line568">568: </a><font color="#A020F0">    #else</font>
<a name="line569">569: </a><strong><font color="#228B22">      #define petsccomplexlib std</font></strong>
<a name="line570">570: </a><font color="#A020F0">      #include &lt;complex&gt;</font>
<a name="line571">571: </a><font color="#A020F0">    #endif</font>

<a name="line573">573: </a>    <font color="#B22222">/* Define <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a> based on the precision */</font>
<a name="line574">574: </a><font color="#A020F0">    #if defined(PETSC_USE_REAL_SINGLE)</font>
<a name="line575">575: </a><font color="#4169E1">typedef</font> petsccomplexlib::complex&lt;float&gt; <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>;
<a name="line576">576: </a><font color="#A020F0">    #elif defined(PETSC_USE_REAL_DOUBLE)</font>
<a name="line577">577: </a><font color="#4169E1">typedef</font> petsccomplexlib::complex&lt;double&gt; <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>;
<a name="line578">578: </a><font color="#A020F0">    #elif defined(PETSC_USE_REAL___FLOAT128)</font>
<a name="line579">579: </a><font color="#4169E1">typedef __complex128 <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>;</font>
<a name="line580">580: </a><font color="#A020F0">    #endif</font>

<a name="line582">582: </a>    <font color="#B22222">/* Include a PETSc C++ complex 'fix'. Check <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a> manual page for details */</font>
<a name="line583">583: </a><font color="#A020F0">    #if defined(PETSC_HAVE_CXX_COMPLEX_FIX) &amp;&amp; !defined(PETSC_SKIP_CXX_COMPLEX_FIX)</font>
<a name="line584">584: </a>#include <A href="../include/petsccxxcomplexfix.h.html">&lt;petsccxxcomplexfix.h&gt;</A>
<a name="line585">585: </a><font color="#A020F0">    #endif</font>
<a name="line586">586: </a><font color="#A020F0">  #else </font><font color="#B22222">/* c99 complex support */</font><font color="#A020F0"></font>
<a name="line587">587: </a><font color="#A020F0">    #include &lt;complex.h&gt;</font>
<a name="line588">588: </a><font color="#A020F0">    #if defined(PETSC_USE_REAL_SINGLE) || defined(PETSC_USE_REAL___FP16)</font>
<a name="line589">589: </a><font color="#4169E1">typedef float _Complex <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>;</font>
<a name="line590">590: </a><font color="#A020F0">    #elif defined(PETSC_USE_REAL_DOUBLE)</font>
<a name="line591">591: </a><font color="#4169E1">typedef double _Complex <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>;</font>
<a name="line592">592: </a><font color="#A020F0">    #elif defined(PETSC_USE_REAL___FLOAT128)</font>
<a name="line593">593: </a><font color="#4169E1">typedef __complex128 <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>;</font>
<a name="line594">594: </a><font color="#A020F0">    #endif </font><font color="#B22222">/* PETSC_USE_REAL_* */</font><font color="#A020F0"></font>
<a name="line595">595: </a><font color="#A020F0">  #endif   </font><font color="#B22222">/* !__cplusplus */</font><font color="#A020F0"></font>
<a name="line596">596: </a><font color="#A020F0">#endif     </font><font color="#B22222">/* PETSC_HAVE_COMPLEX */</font><font color="#A020F0"></font>

<a name="line598">598: </a><font color="#B22222">/*MC</font>
<a name="line599">599: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a> - PETSc type that represents either a double precision real number, a double precision</font>
<a name="line600">600: </a><font color="#B22222">                 complex number, a single precision real number, a __float128 real or complex or a __fp16 real - if the code is configured</font>
<a name="line601">601: </a><font color="#B22222">                 with `--with-scalar-type`=real,complex `--with-precision`=single,double,__float128,__fp16</font>

<a name="line603">603: </a><font color="#B22222">   Level: beginner</font>

<a name="line605">605: </a><font color="#B22222">   Note:</font>
<a name="line606">606: </a><font color="#B22222">   For MPI calls that require datatypes, use `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>` as the datatype for `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>` and `MPIU_SUM`, etc for operations. They will automatically work correctly regardless of the size of `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`.</font>

<a name="line608">608: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`, `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>`, `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, `<a href="../manualpages/Sys/MPIU_REAL.html">MPIU_REAL</a>`, `<a href="../manualpages/Sys/MPIU_SCALAR.html">MPIU_SCALAR</a>`, `<a href="../manualpages/Sys/MPIU_COMPLEX.html">MPIU_COMPLEX</a>`, `<a href="../manualpages/Sys/MPIU_INT.html">MPIU_INT</a>`, `<a href="../manualpages/Sys/PetscRealPart.html">PetscRealPart</a>()`, `<a href="../manualpages/Sys/PetscImaginaryPart.html">PetscImaginaryPart</a>()`</font>
<a name="line609">609: </a><font color="#B22222">M*/</font>

<a name="line611">611: </a><font color="#A020F0">#if defined(PETSC_USE_COMPLEX) &amp;&amp; defined(PETSC_HAVE_COMPLEX)</font>
<a name="line612">612: </a><font color="#4169E1">typedef <a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a> <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>;</font>
<a name="line613">613: </a><font color="#A020F0">#else  </font><font color="#B22222">/* PETSC_USE_COMPLEX */</font><font color="#A020F0"></font>
<a name="line614">614: </a><font color="#4169E1">typedef <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>;</font>
<a name="line615">615: </a><font color="#A020F0">#endif </font><font color="#B22222">/* PETSC_USE_COMPLEX */</font><font color="#A020F0"></font>

<a name="line617">617: </a><font color="#B22222">/*E</font>
<a name="line618">618: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscCopyMode.html">PetscCopyMode</a>  - Determines how an array or `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` passed to certain functions is copied or retained by the aggregate `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`</font>

<a name="line620">620: </a><font color="#B22222">   Values for array input:</font>
<a name="line621">621: </a><font color="#B22222">+   `<a href="../manualpages/Sys/PetscCopyMode.html">PETSC_COPY_VALUES</a>` - the array values are copied into new space, the user is free to reuse or delete the passed in array</font>
<a name="line622">622: </a><font color="#B22222">.   `<a href="../manualpages/Sys/PetscCopyMode.html">PETSC_OWN_POINTER</a>` - the array values are NOT copied, the object takes ownership of the array and will free it later, the user cannot change or</font>
<a name="line623">623: </a><font color="#B22222">                          delete the array. The array MUST have been obtained with `<a href="../manualpages/Sys/PetscMalloc.html">PetscMalloc</a>()`. Hence this mode cannot be used in Fortran.</font>
<a name="line624">624: </a><font color="#B22222">-   `<a href="../manualpages/Sys/PetscCopyMode.html">PETSC_USE_POINTER</a>` - the array values are NOT copied, the object uses the array but does NOT take ownership of the array. The user cannot use</font>
<a name="line625">625: </a><font color="#B22222">                          the array but the user must delete the array after the object is destroyed.</font>

<a name="line627">627: </a><font color="#B22222">   Values for <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>:</font>
<a name="line628">628: </a><font color="#B22222">+   `<a href="../manualpages/Sys/PetscCopyMode.html">PETSC_COPY_VALUES</a>` - the input `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` is cloned into the aggregate `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`; the user is free to reuse/modify the input `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` without side effects.</font>
<a name="line629">629: </a><font color="#B22222">.   `<a href="../manualpages/Sys/PetscCopyMode.html">PETSC_OWN_POINTER</a>` - the input `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` is referenced by pointer (with reference count), thus should not be modified by the user.</font>
<a name="line630">630: </a><font color="#B22222">                          increases its reference count).</font>
<a name="line631">631: </a><font color="#B22222">-   `<a href="../manualpages/Sys/PetscCopyMode.html">PETSC_USE_POINTER</a>` - invalid for `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` inputs.</font>

<a name="line633">633: </a><font color="#B22222">   Level: beginner</font>

<a name="line635">635: </a><font color="#B22222">.seealso: `PetscInsertMode`</font>
<a name="line636">636: </a><font color="#B22222">E*/</font>
<a name="line637">637: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line638">638: </a>  <a href="../manualpages/Sys/PetscCopyMode.html">PETSC_COPY_VALUES</a>,
<a name="line639">639: </a>  <a href="../manualpages/Sys/PetscCopyMode.html">PETSC_OWN_POINTER</a>,
<a name="line640">640: </a>  <a href="../manualpages/Sys/PetscCopyMode.html">PETSC_USE_POINTER</a>
<a name="line641">641: </a>} <a href="../manualpages/Sys/PetscCopyMode.html">PetscCopyMode</a>;
<a name="line642">642: </a>PETSC_EXTERN const char *const PetscCopyModes[];

<a name="line644">644: </a><font color="#B22222">/*MC</font>
<a name="line645">645: </a><font color="#B22222">    <a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a> - False value of `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`</font>

<a name="line647">647: </a><font color="#B22222">    Level: beginner</font>

<a name="line649">649: </a><font color="#B22222">    Note:</font>
<a name="line650">650: </a><font color="#B22222">    Zero integer</font>

<a name="line652">652: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`, `<a href="../manualpages/Sys/PetscBool3.html">PetscBool3</a>`, `<a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a>`</font>
<a name="line653">653: </a><font color="#B22222">M*/</font>

<a name="line655">655: </a><font color="#B22222">/*MC</font>
<a name="line656">656: </a><font color="#B22222">    <a href="../manualpages/Sys/PETSC_TRUE.html">PETSC_TRUE</a> - True value of `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`</font>

<a name="line658">658: </a><font color="#B22222">    Level: beginner</font>

<a name="line660">660: </a><font color="#B22222">    Note:</font>
<a name="line661">661: </a><font color="#B22222">    Nonzero integer</font>

<a name="line663">663: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`, `<a href="../manualpages/Sys/PetscBool3.html">PetscBool3</a>`, `<a href="../manualpages/Sys/PETSC_FALSE.html">PETSC_FALSE</a>`</font>
<a name="line664">664: </a><font color="#B22222">M*/</font>

<a name="line666">666: </a><font color="#B22222">/*MC</font>
<a name="line667">667: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a> - Used for logging times</font>

<a name="line669">669: </a><font color="#B22222">  Level: developer</font>

<a name="line671">671: </a><font color="#B22222">  Note:</font>
<a name="line672">672: </a><font color="#B22222">  Contains double precision numbers that are not used in the numerical computations, but rather in logging, timing etc.</font>

<a name="line674">674: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBool.html">PetscBool</a>`, `<a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>`</font>
<a name="line675">675: </a><font color="#B22222">M*/</font>
<a name="line676">676: </a><font color="#4169E1">typedef double <a href="../manualpages/Sys/PetscLogDouble.html">PetscLogDouble</a>;</font>

<a name="line678">678: </a><font color="#B22222">/*E</font>
<a name="line679">679: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a> - Used for handling different basic data types.</font>

<a name="line681">681: </a><font color="#B22222">   Level: beginner</font>

<a name="line683">683: </a><font color="#B22222">   Notes:</font>
<a name="line684">684: </a><font color="#B22222">   Use of this should be avoided if one can directly use `MPI_Datatype` instead.</font>

<a name="line686">686: </a><font color="#B22222">   `<a href="../manualpages/Sys/PetscDataType.html">PETSC_INT</a>` is the datatype for a `<a href="../manualpages/Sys/PetscInt.html">PetscInt</a>`, regardless of whether it is 4 or 8 bytes.</font>
<a name="line687">687: </a><font color="#B22222">   `PETSC_REAL`, `<a href="../manualpages/Sys/PetscDataType.html">PETSC_COMPLEX</a>` and `PETSC_SCALAR` are the datatypes for `<a href="../manualpages/Sys/PetscReal.html">PetscReal</a>`, `<a href="../manualpages/Sys/PetscComplex.html">PetscComplex</a>` and `<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>`, regardless of their sizes.</font>

<a name="line689">689: </a><font color="#B22222">   Developer Notes:</font>
<a name="line690">690: </a><font color="#B22222">   It would be nice if we could always just use MPI Datatypes, why can we not?</font>

<a name="line692">692: </a><font color="#B22222">   If you change any values in `PetscDatatype` make sure you update their usage in</font>
<a name="line693">693: </a><font color="#B22222">   share/petsc/matlab/PetscBagRead.m and share/petsc/matlab/@<a href="../manualpages/Viewer/PetscOpenSocket.html">PetscOpenSocket</a>/read/write.m</font>

<a name="line695">695: </a><font color="#B22222">   TODO:</font>
<a name="line696">696: </a><font color="#B22222">   Remove use of improper `<a href="../manualpages/Sys/PetscDataType.html">PETSC_ENUM</a>`</font>

<a name="line698">698: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBinaryRead.html">PetscBinaryRead</a>()`, `<a href="../manualpages/Sys/PetscBinaryWrite.html">PetscBinaryWrite</a>()`, `<a href="../manualpages/Sys/PetscDataTypeToMPIDataType.html">PetscDataTypeToMPIDataType</a>()`,</font>
<a name="line699">699: </a><font color="#B22222">          `<a href="../manualpages/Sys/PetscDataTypeGetSize.html">PetscDataTypeGetSize</a>()`</font>
<a name="line700">700: </a><font color="#B22222">E*/</font>
<a name="line701">701: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line702">702: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_DATATYPE_UNKNOWN</a> = 0,
<a name="line703">703: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_DOUBLE</a>           = 1,
<a name="line704">704: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_COMPLEX</a>          = 2,
<a name="line705">705: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_LONG</a>             = 3,
<a name="line706">706: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_SHORT</a>            = 4,
<a name="line707">707: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_FLOAT</a>            = 5,
<a name="line708">708: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_CHAR</a>             = 6,
<a name="line709">709: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_BIT_LOGICAL</a>      = 7,
<a name="line710">710: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_ENUM</a>             = 8,
<a name="line711">711: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_BOOL</a>             = 9,
<a name="line712">712: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC___FLOAT128</a>       = 10,
<a name="line713">713: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_OBJECT</a>           = 11,
<a name="line714">714: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_FUNCTION</a>         = 12,
<a name="line715">715: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_STRING</a>           = 13,
<a name="line716">716: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC___FP16</a>           = 14,
<a name="line717">717: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_STRUCT</a>           = 15,
<a name="line718">718: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_INT</a>              = 16,
<a name="line719">719: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_INT64</a>            = 17,
<a name="line720">720: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_COUNT</a>            = 18,
<a name="line721">721: </a>  <a href="../manualpages/Sys/PetscDataType.html">PETSC_INT32</a>            = 19,
<a name="line722">722: </a>} <a href="../manualpages/Sys/PetscDataType.html">PetscDataType</a>;
<a name="line723">723: </a>PETSC_EXTERN const char *const PetscDataTypes[];

<a name="line725">725: </a><font color="#A020F0">#if defined(PETSC_USE_REAL_SINGLE)</font>
<a name="line726">726: </a><strong><font color="#228B22">  #define PETSC_REAL <a href="../manualpages/Sys/PetscDataType.html">PETSC_FLOAT</a></font></strong>
<a name="line727">727: </a><font color="#A020F0">#elif defined(PETSC_USE_REAL_DOUBLE)</font>
<a name="line728">728: </a><strong><font color="#228B22">  #define PETSC_REAL <a href="../manualpages/Sys/PetscDataType.html">PETSC_DOUBLE</a></font></strong>
<a name="line729">729: </a><font color="#A020F0">#elif defined(PETSC_USE_REAL___FLOAT128)</font>
<a name="line730">730: </a><strong><font color="#228B22">  #define PETSC_REAL <a href="../manualpages/Sys/PetscDataType.html">PETSC___FLOAT128</a></font></strong>
<a name="line731">731: </a><font color="#A020F0">#elif defined(PETSC_USE_REAL___FP16)</font>
<a name="line732">732: </a><strong><font color="#228B22">  #define PETSC_REAL <a href="../manualpages/Sys/PetscDataType.html">PETSC___FP16</a></font></strong>
<a name="line733">733: </a><font color="#A020F0">#else</font>
<a name="line734">734: </a><strong><font color="#228B22">  #define PETSC_REAL <a href="../manualpages/Sys/PetscDataType.html">PETSC_DOUBLE</a></font></strong>
<a name="line735">735: </a><font color="#A020F0">#endif</font>

<a name="line737">737: </a><font color="#A020F0">#if defined(PETSC_USE_COMPLEX)</font>
<a name="line738">738: </a><strong><font color="#228B22">  #define PETSC_SCALAR <a href="../manualpages/Sys/PetscDataType.html">PETSC_COMPLEX</a></font></strong>
<a name="line739">739: </a><font color="#A020F0">#else</font>
<a name="line740">740: </a><strong><font color="#228B22">  #define PETSC_SCALAR PETSC_REAL</font></strong>
<a name="line741">741: </a><font color="#A020F0">#endif</font>

<a name="line743">743: </a><strong><font color="#228B22">#define PETSC_FORTRANADDR <a href="../manualpages/Sys/PetscDataType.html">PETSC_LONG</a></font></strong>

<a name="line745">745: </a><font color="#B22222">/*S</font>
<a name="line746">746: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscToken.html">PetscToken</a> - 'Token' used for managing tokenizing strings</font>

<a name="line748">748: </a><font color="#B22222">  Level: intermediate</font>

<a name="line750">750: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscTokenCreate.html">PetscTokenCreate</a>()`, `<a href="../manualpages/Sys/PetscTokenFind.html">PetscTokenFind</a>()`, `<a href="../manualpages/Sys/PetscTokenDestroy.html">PetscTokenDestroy</a>()`</font>
<a name="line751">751: </a><font color="#B22222">S*/</font>
<a name="line752">752: </a><font color="#4169E1">typedef struct _n_PetscToken *<a href="../manualpages/Sys/PetscToken.html">PetscToken</a>;</font>

<a name="line754">754: </a><font color="#B22222">/*S</font>
<a name="line755">755: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscObject.html">PetscObject</a> - any PETSc object, for example: `<a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>`, `<a href="../manualpages/Mat/Mat.html">Mat</a>`, `<a href="../manualpages/Vec/Vec.html">Vec</a>`, `<a href="../manualpages/KSP/KSP.html">KSP</a>`, `<a href="../manualpages/DM/DM.html">DM</a>`</font>

<a name="line757">757: </a><font color="#B22222">   Level: beginner</font>

<a name="line759">759: </a><font color="#B22222">   Notes:</font>
<a name="line760">760: </a><font color="#B22222">   This is the base class from which all PETSc objects are derived.</font>

<a name="line762">762: </a><font color="#B22222">   In certain situations one can cast an object, for example a `<a href="../manualpages/Vec/Vec.html">Vec</a>`, to a `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` with (`<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`)vec</font>

<a name="line764">764: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObjectDestroy.html">PetscObjectDestroy</a>()`, `<a href="../manualpages/Sys/PetscObjectView.html">PetscObjectView</a>()`, `<a href="../manualpages/Sys/PetscObjectGetName.html">PetscObjectGetName</a>()`, `<a href="../manualpages/Sys/PetscObjectSetName.html">PetscObjectSetName</a>()`, `<a href="../manualpages/Sys/PetscObjectReference.html">PetscObjectReference</a>()`, `<a href="../manualpages/Sys/PetscObjectDereference.html">PetscObjectDereference</a>()`</font>
<a name="line765">765: </a><font color="#B22222">S*/</font>
<a name="line766">766: </a><font color="#4169E1">typedef struct _p_PetscObject *<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>;</font>

<a name="line768">768: </a><font color="#B22222">/*MC</font>
<a name="line769">769: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscObjectId.html">PetscObjectId</a> - unique integer Id for a `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`</font>

<a name="line771">771: </a><font color="#B22222">    Level: developer</font>

<a name="line773">773: </a><font color="#B22222">    Note:</font>
<a name="line774">774: </a><font color="#B22222">    Unlike pointer values, object ids are never reused so one may save a `<a href="../manualpages/Sys/PetscObjectId.html">PetscObjectId</a>` and compare it to one obtained later from a `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` to determine</font>
<a name="line775">775: </a><font color="#B22222">    if the objects are the same. Never compare two object pointer values.</font>

<a name="line777">777: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObjectState.html">PetscObjectState</a>`, `<a href="../manualpages/Sys/PetscObjectGetId.html">PetscObjectGetId</a>()`</font>
<a name="line778">778: </a><font color="#B22222">M*/</font>
<a name="line779">779: </a><font color="#4169E1">typedef PetscInt64 <a href="../manualpages/Sys/PetscObjectId.html">PetscObjectId</a>;</font>

<a name="line781">781: </a><font color="#B22222">/*MC</font>
<a name="line782">782: </a><font color="#B22222">    <a href="../manualpages/Sys/PetscObjectState.html">PetscObjectState</a> - integer state for a `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`</font>

<a name="line784">784: </a><font color="#B22222">    Level: developer</font>

<a name="line786">786: </a><font color="#B22222">    Note:</font>
<a name="line787">787: </a><font color="#B22222">    Object state is always-increasing and (for objects that track state) can be used to determine if an object has</font>
<a name="line788">788: </a><font color="#B22222">    changed since the last time you interacted with it.  It is 64-bit so that it will not overflow for a very long time.</font>

<a name="line790">790: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObjectId.html">PetscObjectId</a>`, `<a href="../manualpages/Sys/PetscObjectStateGet.html">PetscObjectStateGet</a>()`, `<a href="../manualpages/Sys/PetscObjectStateIncrease.html">PetscObjectStateIncrease</a>()`, `<a href="../manualpages/Sys/PetscObjectStateSet.html">PetscObjectStateSet</a>()`</font>
<a name="line791">791: </a><font color="#B22222">M*/</font>
<a name="line792">792: </a><font color="#4169E1">typedef PetscInt64 <a href="../manualpages/Sys/PetscObjectState.html">PetscObjectState</a>;</font>

<a name="line794">794: </a><font color="#B22222">/*S</font>
<a name="line795">795: </a><font color="#B22222">     <a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a> - Linked list of functions, possibly stored in dynamic libraries, accessed</font>
<a name="line796">796: </a><font color="#B22222">      by string name</font>

<a name="line798">798: </a><font color="#B22222">   Level: advanced</font>

<a name="line800">800: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscFunctionListAdd.html">PetscFunctionListAdd</a>()`, `<a href="../manualpages/Sys/PetscFunctionListDestroy.html">PetscFunctionListDestroy</a>()`</font>
<a name="line801">801: </a><font color="#B22222">S*/</font>
<a name="line802">802: </a><font color="#4169E1">typedef struct _n_PetscFunctionList *<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>;</font>

<a name="line804">804: </a><font color="#B22222">/*E</font>
<a name="line805">805: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscFileMode.html">PetscFileMode</a> - Access mode for a file.</font>

<a name="line807">807: </a><font color="#B22222">  Values:</font>
<a name="line808">808: </a><font color="#B22222">+  `<a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_UNDEFINED</a>`     - initial invalid value</font>
<a name="line809">809: </a><font color="#B22222">.  `<a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_READ</a>`          - open a file at its beginning for reading</font>
<a name="line810">810: </a><font color="#B22222">.  `<a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_WRITE</a>`         - open a file at its beginning for writing (will create if the file does not exist)</font>
<a name="line811">811: </a><font color="#B22222">.  `<a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_APPEND</a>`        - open a file at end for writing</font>
<a name="line812">812: </a><font color="#B22222">.  `<a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_UPDATE</a>`        - open a file for updating, meaning for reading and writing</font>
<a name="line813">813: </a><font color="#B22222">-  `<a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_APPEND_UPDATE</a>` - open a file for updating, meaning for reading and writing, at the end</font>

<a name="line815">815: </a><font color="#B22222">  Level: beginner</font>

<a name="line817">817: </a><font color="#B22222">.seealso: `<a href="../manualpages/Viewer/PetscViewerFileSetMode.html">PetscViewerFileSetMode</a>()`</font>
<a name="line818">818: </a><font color="#B22222">E*/</font>
<a name="line819">819: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line820">820: </a>  <a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_UNDEFINED</a>     = -1,
<a name="line821">821: </a>  <a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_READ</a>          = 0,
<a name="line822">822: </a>  <a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_WRITE</a>         = 1,
<a name="line823">823: </a>  <a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_APPEND</a>        = 2,
<a name="line824">824: </a>  <a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_UPDATE</a>        = 3,
<a name="line825">825: </a>  <a href="../manualpages/Sys/PetscFileMode.html">FILE_MODE_APPEND_UPDATE</a> = 4
<a name="line826">826: </a>} <a href="../manualpages/Sys/PetscFileMode.html">PetscFileMode</a>;
<a name="line827">827: </a>PETSC_EXTERN const char *const PetscFileModes[];

<a name="line829">829: </a><font color="#4169E1">typedef void *PetscDLHandle;</font>
<a name="line830">830: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line831">831: </a>  PETSC_DL_DECIDE = 0,
<a name="line832">832: </a>  PETSC_DL_NOW    = 1,
<a name="line833">833: </a>  PETSC_DL_LOCAL  = 2
<a name="line834">834: </a>} PetscDLMode;

<a name="line836">836: </a><font color="#B22222">/*S</font>
<a name="line837">837: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a> - Linked list of PETSc objects, each accessible by string name</font>

<a name="line839">839: </a><font color="#B22222">   Level: developer</font>

<a name="line841">841: </a><font color="#B22222">   Note:</font>
<a name="line842">842: </a><font color="#B22222">   Used by `<a href="../manualpages/Sys/PetscObjectCompose.html">PetscObjectCompose</a>()` and `<a href="../manualpages/Sys/PetscObjectQuery.html">PetscObjectQuery</a>()`</font>

<a name="line844">844: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObjectListAdd.html">PetscObjectListAdd</a>()`, `<a href="../manualpages/Sys/PetscObjectListDestroy.html">PetscObjectListDestroy</a>()`, `<a href="../manualpages/Sys/PetscObjectListFind.html">PetscObjectListFind</a>()`, `<a href="../manualpages/Sys/PetscObjectCompose.html">PetscObjectCompose</a>()`, `<a href="../manualpages/Sys/PetscObjectQuery.html">PetscObjectQuery</a>()`, `<a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a>`</font>
<a name="line845">845: </a><font color="#B22222">S*/</font>
<a name="line846">846: </a><font color="#4169E1">typedef struct _n_PetscObjectList *<a href="../manualpages/Sys/PetscObjectList.html">PetscObjectList</a>;</font>

<a name="line848">848: </a><font color="#B22222">/*S</font>
<a name="line849">849: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a> - Linked list of dynamic libraries to search for functions</font>

<a name="line851">851: </a><font color="#B22222">   Level: developer</font>

<a name="line853">853: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscDLLibraryOpen.html">PetscDLLibraryOpen</a>()`</font>
<a name="line854">854: </a><font color="#B22222">S*/</font>
<a name="line855">855: </a><font color="#4169E1">typedef struct _n_PetscDLLibrary *<a href="../manualpages/Sys/PetscDLLibrary.html">PetscDLLibrary</a>;</font>

<a name="line857">857: </a><font color="#B22222">/*S</font>
<a name="line858">858: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a> - Simple PETSc object that contains a pointer to any required data</font>

<a name="line860">860: </a><font color="#B22222">   Level: advanced</font>

<a name="line862">862: </a><font color="#B22222">   Note:</font>
<a name="line863">863: </a><font color="#B22222">   This is useful to attach arbitrary data to a `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>` with `<a href="../manualpages/Sys/PetscObjectCompose.html">PetscObjectCompose</a>()` and `<a href="../manualpages/Sys/PetscObjectQuery.html">PetscObjectQuery</a>()`</font>

<a name="line865">865: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscObject.html">PetscObject</a>`, `<a href="../manualpages/Sys/PetscContainerCreate.html">PetscContainerCreate</a>()`, `<a href="../manualpages/Sys/PetscObjectCompose.html">PetscObjectCompose</a>()`, `<a href="../manualpages/Sys/PetscObjectQuery.html">PetscObjectQuery</a>()`</font>
<a name="line866">866: </a><font color="#B22222">S*/</font>
<a name="line867">867: </a><font color="#4169E1">typedef struct _p_PetscContainer *<a href="../manualpages/Sys/PetscContainer.html">PetscContainer</a>;</font>

<a name="line869">869: </a><font color="#B22222">/*S</font>
<a name="line870">870: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a> - Abstract PETSc object that manages generating random numbers</font>

<a name="line872">872: </a><font color="#B22222">   Level: intermediate</font>

<a name="line874">874: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscRandomCreate.html">PetscRandomCreate</a>()`, `<a href="../manualpages/Sys/PetscRandomGetValue.html">PetscRandomGetValue</a>()`, `<a href="../manualpages/Sys/PetscRandomType.html">PetscRandomType</a>`</font>
<a name="line875">875: </a><font color="#B22222">S*/</font>
<a name="line876">876: </a><font color="#4169E1">typedef struct _p_PetscRandom *<a href="../manualpages/Sys/PetscRandom.html">PetscRandom</a>;</font>

<a name="line878">878: </a><font color="#B22222">/*</font>
<a name="line879">879: </a><font color="#B22222">   In binary files variables are stored using the following lengths,</font>
<a name="line880">880: </a><font color="#B22222">  regardless of how they are stored in memory on any one particular</font>
<a name="line881">881: </a><font color="#B22222">  machine. Use these rather than sizeof() in computing sizes for</font>
<a name="line882">882: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscBinarySeek.html">PetscBinarySeek</a>().</font>
<a name="line883">883: </a><font color="#B22222">*/</font>
<a name="line884">884: </a><strong><font color="#228B22">#define PETSC_BINARY_INT_SIZE    (32 / 8)</font></strong>
<a name="line885">885: </a><strong><font color="#228B22">#define PETSC_BINARY_FLOAT_SIZE  (32 / 8)</font></strong>
<a name="line886">886: </a><strong><font color="#228B22">#define PETSC_BINARY_CHAR_SIZE   (8 / 8)</font></strong>
<a name="line887">887: </a><strong><font color="#228B22">#define PETSC_BINARY_SHORT_SIZE  (16 / 8)</font></strong>
<a name="line888">888: </a><strong><font color="#228B22">#define PETSC_BINARY_DOUBLE_SIZE (64 / 8)</font></strong>
<a name="line889">889: </a><strong><font color="#228B22">#define PETSC_BINARY_SCALAR_SIZE sizeof(<a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>)</font></strong>

<a name="line891">891: </a><font color="#B22222">/*E</font>
<a name="line892">892: </a><font color="#B22222">  <a href="../manualpages/Sys/PetscBinarySeekType.html">PetscBinarySeekType</a> - argument to `<a href="../manualpages/Sys/PetscBinarySeek.html">PetscBinarySeek</a>()`</font>

<a name="line894">894: </a><font color="#B22222">  Values:</font>
<a name="line895">895: </a><font color="#B22222">+  `<a href="../manualpages/Sys/PetscBinarySeekType.html">PETSC_BINARY_SEEK_SET</a>` - offset is an absolute location in the file</font>
<a name="line896">896: </a><font color="#B22222">.  `<a href="../manualpages/Sys/PetscBinarySeekType.html">PETSC_BINARY_SEEK_CUR</a>` - offset is an offset from the current location of the file pointer</font>
<a name="line897">897: </a><font color="#B22222">-  `<a href="../manualpages/Sys/PetscBinarySeekType.html">PETSC_BINARY_SEEK_END</a>` - offset is an offset from the end of the file</font>

<a name="line899">899: </a><font color="#B22222">  Level: advanced</font>

<a name="line901">901: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscBinarySeek.html">PetscBinarySeek</a>()`, `<a href="../manualpages/Sys/PetscBinarySynchronizedSeek.html">PetscBinarySynchronizedSeek</a>()`</font>
<a name="line902">902: </a><font color="#B22222">E*/</font>
<a name="line903">903: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line904">904: </a>  <a href="../manualpages/Sys/PetscBinarySeekType.html">PETSC_BINARY_SEEK_SET</a> = 0,
<a name="line905">905: </a>  <a href="../manualpages/Sys/PetscBinarySeekType.html">PETSC_BINARY_SEEK_CUR</a> = 1,
<a name="line906">906: </a>  <a href="../manualpages/Sys/PetscBinarySeekType.html">PETSC_BINARY_SEEK_END</a> = 2
<a name="line907">907: </a>} <a href="../manualpages/Sys/PetscBinarySeekType.html">PetscBinarySeekType</a>;

<a name="line909">909: </a><font color="#B22222">/*E</font>
<a name="line910">910: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PetscBuildTwoSidedType</a> - algorithm for setting up two-sided communication for use with `<a href="../manualpages/PetscSF/PetscSF.html">PetscSF</a>`</font>

<a name="line912">912: </a><font color="#B22222">   Values:</font>
<a name="line913">913: </a><font color="#B22222">+  `<a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PETSC_BUILDTWOSIDED_ALLREDUCE</a>`  - classical algorithm using an `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html#MPI_Allreduce">MPI_Allreduce</a>()` with</font>
<a name="line914">914: </a><font color="#B22222">                                      a buffer of length equal to the communicator size. Not memory-scalable due to</font>
<a name="line915">915: </a><font color="#B22222">                                      the large reduction size. Requires only an MPI-1 implementation.</font>
<a name="line916">916: </a><font color="#B22222">.  `<a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PETSC_BUILDTWOSIDED_IBARRIER</a>`   - nonblocking algorithm based on `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Issend.html#MPI_Issend">MPI_Issend</a>()` and `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Ibarrier.html#MPI_Ibarrier">MPI_Ibarrier</a>()`.</font>
<a name="line917">917: </a><font color="#B22222">                                      Proved communication-optimal in Hoefler, Siebert, and Lumsdaine (2010). Requires an MPI-3 implementation.</font>
<a name="line918">918: </a><font color="#B22222">-  `<a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PETSC_BUILDTWOSIDED_REDSCATTER</a>` - similar to above, but use more optimized function</font>
<a name="line919">919: </a><font color="#B22222">                                      that only communicates the part of the reduction that is necessary.  Requires an MPI-2 implementation.</font>

<a name="line921">921: </a><font color="#B22222">   Level: developer</font>

<a name="line923">923: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscCommBuildTwoSided.html">PetscCommBuildTwoSided</a>()`, `<a href="../manualpages/Sys/PetscCommBuildTwoSidedSetType.html">PetscCommBuildTwoSidedSetType</a>()`, `<a href="../manualpages/Sys/PetscCommBuildTwoSidedGetType.html">PetscCommBuildTwoSidedGetType</a>()`</font>
<a name="line924">924: </a><font color="#B22222">E*/</font>
<a name="line925">925: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line926">926: </a>  <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PETSC_BUILDTWOSIDED_NOTSET</a>     = -1,
<a name="line927">927: </a>  <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PETSC_BUILDTWOSIDED_ALLREDUCE</a>  = 0,
<a name="line928">928: </a>  <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PETSC_BUILDTWOSIDED_IBARRIER</a>   = 1,
<a name="line929">929: </a>  <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PETSC_BUILDTWOSIDED_REDSCATTER</a> = 2
<a name="line930">930: </a>  <font color="#B22222">/* Updates here must be accompanied by updates in finclude/petscsys.h and the string array in mpits.c */</font>
<a name="line931">931: </a>} <a href="../manualpages/Sys/PetscBuildTwoSidedType.html">PetscBuildTwoSidedType</a>;
<a name="line932">932: </a>PETSC_EXTERN const char *const PetscBuildTwoSidedTypes[];

<a name="line934">934: </a><font color="#B22222">/*E</font>
<a name="line935">935: </a><font color="#B22222">  <a href="../manualpages/Sys/InsertMode.html">InsertMode</a> - How the entries are combined with the current values in the vectors or matrices</font>

<a name="line937">937: </a><font color="#B22222">  Values:</font>
<a name="line938">938: </a><font color="#B22222">+  `<a href="../manualpages/Sys/InsertMode.html">NOT_SET_VALUES</a>`    - do not actually use the values</font>
<a name="line939">939: </a><font color="#B22222">.  `<a href="../manualpages/Sys/INSERT_VALUES.html">INSERT_VALUES</a>`     - replace the current values with the provided values, unless the index is marked as constrained by the `<a href="../manualpages/PetscSection/PetscSection.html">PetscSection</a>`</font>
<a name="line940">940: </a><font color="#B22222">.  `<a href="../manualpages/Sys/ADD_VALUES.html">ADD_VALUES</a>`        - add the values to the current values, unless the index is marked as constrained by the `<a href="../manualpages/PetscSection/PetscSection.html">PetscSection</a>`</font>
<a name="line941">941: </a><font color="#B22222">.  `<a href="../manualpages/Sys/MAX_VALUES.html">MAX_VALUES</a>`        - use the maximum of each current value and provided value</font>
<a name="line942">942: </a><font color="#B22222">.  `<a href="../manualpages/Sys/MIN_VALUES.html">MIN_VALUES</a>`        - use the minimum of each current value and provided value</font>
<a name="line943">943: </a><font color="#B22222">.  `<a href="../manualpages/Sys/InsertMode.html">INSERT_ALL_VALUES</a>` - insert, even if indices that are not marked as constrained by the `<a href="../manualpages/PetscSection/PetscSection.html">PetscSection</a>`</font>
<a name="line944">944: </a><font color="#B22222">.  `<a href="../manualpages/Sys/InsertMode.html">ADD_ALL_VALUES</a>`    - add, even if indices that are not marked as constrained by the `<a href="../manualpages/PetscSection/PetscSection.html">PetscSection</a>`</font>
<a name="line945">945: </a><font color="#B22222">.  `<a href="../manualpages/Sys/InsertMode.html">INSERT_BC_VALUES</a>`  - insert, but ignore indices that are not marked as constrained by the `<a href="../manualpages/PetscSection/PetscSection.html">PetscSection</a>`</font>
<a name="line946">946: </a><font color="#B22222">-  `<a href="../manualpages/Sys/InsertMode.html">ADD_BC_VALUES</a>`     - add, but ignore indices that are not marked as constrained by the `<a href="../manualpages/PetscSection/PetscSection.html">PetscSection</a>`</font>

<a name="line948">948: </a><font color="#B22222">  Level: beginner</font>

<a name="line950">950: </a><font color="#B22222">  Note:</font>
<a name="line951">951: </a><font color="#B22222">  The `<a href="../manualpages/PetscSection/PetscSection.html">PetscSection</a>` that determines the effects of the `<a href="../manualpages/Sys/InsertMode.html">InsertMode</a>` values can be obtained by the `<a href="../manualpages/Vec/Vec.html">Vec</a>` object with `<a href="../manualpages/DM/VecGetDM.html">VecGetDM</a>()`</font>
<a name="line952">952: </a><font color="#B22222">  and `<a href="../manualpages/DM/DMGetLocalSection.html">DMGetLocalSection</a>()`.</font>

<a name="line954">954: </a><font color="#B22222">  Not all options are supported for all operations or PETSc object types.</font>

<a name="line956">956: </a><font color="#B22222">.seealso: `<a href="../manualpages/Vec/VecSetValues.html">VecSetValues</a>()`, `<a href="../manualpages/Mat/MatSetValues.html">MatSetValues</a>()`, `<a href="../manualpages/Vec/VecSetValue.html">VecSetValue</a>()`, `<a href="../manualpages/Vec/VecSetValuesBlocked.html">VecSetValuesBlocked</a>()`,</font>
<a name="line957">957: </a><font color="#B22222">          `<a href="../manualpages/Vec/VecSetValuesLocal.html">VecSetValuesLocal</a>()`, `<a href="../manualpages/Vec/VecSetValuesBlockedLocal.html">VecSetValuesBlockedLocal</a>()`, `<a href="../manualpages/Mat/MatSetValuesBlocked.html">MatSetValuesBlocked</a>()`,</font>
<a name="line958">958: </a><font color="#B22222">          `<a href="../manualpages/Mat/MatSetValuesBlockedLocal.html">MatSetValuesBlockedLocal</a>()`, `<a href="../manualpages/Mat/MatSetValuesLocal.html">MatSetValuesLocal</a>()`, `<a href="../manualpages/Vec/VecScatterBegin.html">VecScatterBegin</a>()`, `<a href="../manualpages/Vec/VecScatterEnd.html">VecScatterEnd</a>()`</font>
<a name="line959">959: </a><font color="#B22222">E*/</font>
<a name="line960">960: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line961">961: </a>  <a href="../manualpages/Sys/InsertMode.html">NOT_SET_VALUES</a>,
<a name="line962">962: </a>  <a href="../manualpages/Sys/INSERT_VALUES.html">INSERT_VALUES</a>,
<a name="line963">963: </a>  <a href="../manualpages/Sys/ADD_VALUES.html">ADD_VALUES</a>,
<a name="line964">964: </a>  <a href="../manualpages/Sys/MAX_VALUES.html">MAX_VALUES</a>,
<a name="line965">965: </a>  <a href="../manualpages/Sys/MIN_VALUES.html">MIN_VALUES</a>,
<a name="line966">966: </a>  <a href="../manualpages/Sys/InsertMode.html">INSERT_ALL_VALUES</a>,
<a name="line967">967: </a>  <a href="../manualpages/Sys/InsertMode.html">ADD_ALL_VALUES</a>,
<a name="line968">968: </a>  <a href="../manualpages/Sys/InsertMode.html">INSERT_BC_VALUES</a>,
<a name="line969">969: </a>  <a href="../manualpages/Sys/InsertMode.html">ADD_BC_VALUES</a>
<a name="line970">970: </a>} <a href="../manualpages/Sys/InsertMode.html">InsertMode</a>;

<a name="line972">972: </a><font color="#B22222">/*MC</font>
<a name="line973">973: </a><font color="#B22222">    <a href="../manualpages/Sys/INSERT_VALUES.html">INSERT_VALUES</a> - Put a value into a vector or matrix, overwrites any previous value</font>

<a name="line975">975: </a><font color="#B22222">    Level: beginner</font>

<a name="line977">977: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/InsertMode.html">InsertMode</a>`, `<a href="../manualpages/Vec/VecSetValues.html">VecSetValues</a>()`, `<a href="../manualpages/Mat/MatSetValues.html">MatSetValues</a>()`, `<a href="../manualpages/Vec/VecSetValue.html">VecSetValue</a>()`, `<a href="../manualpages/Vec/VecSetValuesBlocked.html">VecSetValuesBlocked</a>()`,</font>
<a name="line978">978: </a><font color="#B22222">          `<a href="../manualpages/Vec/VecSetValuesLocal.html">VecSetValuesLocal</a>()`, `<a href="../manualpages/Vec/VecSetValuesBlockedLocal.html">VecSetValuesBlockedLocal</a>()`, `<a href="../manualpages/Mat/MatSetValuesBlocked.html">MatSetValuesBlocked</a>()`, `<a href="../manualpages/Sys/ADD_VALUES.html">ADD_VALUES</a>`,</font>
<a name="line979">979: </a><font color="#B22222">          `<a href="../manualpages/Mat/MatSetValuesBlockedLocal.html">MatSetValuesBlockedLocal</a>()`, `<a href="../manualpages/Mat/MatSetValuesLocal.html">MatSetValuesLocal</a>()`, `<a href="../manualpages/Vec/VecScatterBegin.html">VecScatterBegin</a>()`, `<a href="../manualpages/Vec/VecScatterEnd.html">VecScatterEnd</a>()`, `<a href="../manualpages/Sys/MAX_VALUES.html">MAX_VALUES</a>`</font>
<a name="line980">980: </a><font color="#B22222">M*/</font>

<a name="line982">982: </a><font color="#B22222">/*MC</font>
<a name="line983">983: </a><font color="#B22222">    <a href="../manualpages/Sys/ADD_VALUES.html">ADD_VALUES</a> - Adds a value into a vector or matrix, if there previously was no value, just puts the</font>
<a name="line984">984: </a><font color="#B22222">                 value into that location</font>

<a name="line986">986: </a><font color="#B22222">    Level: beginner</font>

<a name="line988">988: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/InsertMode.html">InsertMode</a>`, `<a href="../manualpages/Vec/VecSetValues.html">VecSetValues</a>()`, `<a href="../manualpages/Mat/MatSetValues.html">MatSetValues</a>()`, `<a href="../manualpages/Vec/VecSetValue.html">VecSetValue</a>()`, `<a href="../manualpages/Vec/VecSetValuesBlocked.html">VecSetValuesBlocked</a>()`,</font>
<a name="line989">989: </a><font color="#B22222">          `<a href="../manualpages/Vec/VecSetValuesLocal.html">VecSetValuesLocal</a>()`, `<a href="../manualpages/Vec/VecSetValuesBlockedLocal.html">VecSetValuesBlockedLocal</a>()`, `<a href="../manualpages/Mat/MatSetValuesBlocked.html">MatSetValuesBlocked</a>()`, `<a href="../manualpages/Sys/INSERT_VALUES.html">INSERT_VALUES</a>`,</font>
<a name="line990">990: </a><font color="#B22222">          `<a href="../manualpages/Mat/MatSetValuesBlockedLocal.html">MatSetValuesBlockedLocal</a>()`, `<a href="../manualpages/Mat/MatSetValuesLocal.html">MatSetValuesLocal</a>()`, `<a href="../manualpages/Vec/VecScatterBegin.html">VecScatterBegin</a>()`, `<a href="../manualpages/Vec/VecScatterEnd.html">VecScatterEnd</a>()`, `<a href="../manualpages/Sys/MAX_VALUES.html">MAX_VALUES</a>`</font>
<a name="line991">991: </a><font color="#B22222">M*/</font>

<a name="line993">993: </a><font color="#B22222">/*MC</font>
<a name="line994">994: </a><font color="#B22222">    <a href="../manualpages/Sys/MAX_VALUES.html">MAX_VALUES</a> - Puts the maximum of the scattered/gathered value and the current value into each location</font>

<a name="line996">996: </a><font color="#B22222">    Level: beginner</font>

<a name="line998">998: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/InsertMode.html">InsertMode</a>`, `<a href="../manualpages/Vec/VecScatterBegin.html">VecScatterBegin</a>()`, `<a href="../manualpages/Vec/VecScatterEnd.html">VecScatterEnd</a>()`, `<a href="../manualpages/Sys/ADD_VALUES.html">ADD_VALUES</a>`, `<a href="../manualpages/Sys/INSERT_VALUES.html">INSERT_VALUES</a>`</font>
<a name="line999">999: </a><font color="#B22222">M*/</font>

<a name="line1001">1001: </a><font color="#B22222">/*MC</font>
<a name="line1002">1002: </a><font color="#B22222">    <a href="../manualpages/Sys/MIN_VALUES.html">MIN_VALUES</a> - Puts the minimal of the scattered/gathered value and the current value into each location</font>

<a name="line1004">1004: </a><font color="#B22222">    Level: beginner</font>

<a name="line1006">1006: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/InsertMode.html">InsertMode</a>`, `<a href="../manualpages/Vec/VecScatterBegin.html">VecScatterBegin</a>()`, `<a href="../manualpages/Vec/VecScatterEnd.html">VecScatterEnd</a>()`, `<a href="../manualpages/Sys/ADD_VALUES.html">ADD_VALUES</a>`, `<a href="../manualpages/Sys/INSERT_VALUES.html">INSERT_VALUES</a>`</font>
<a name="line1007">1007: </a><font color="#B22222">M*/</font>

<a name="line1009">1009: </a><font color="#B22222">/*S</font>
<a name="line1010">1010: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a> - A decomposition of an MPI communicator into subcommunicators</font>

<a name="line1012">1012: </a><font color="#B22222">   Values:</font>
<a name="line1013">1013: </a><font color="#B22222">+   `PETSC_SUBCOMM_GENERAL`    - similar to `<a href="http://www.mpich.org/static/docs/latest/www3/MPI_Comm_split.html#MPI_Comm_split">MPI_Comm_split</a>()` each process sets the new communicator (color) they will belong to and the order within that communicator</font>
<a name="line1014">1014: </a><font color="#B22222">.   `PETSC_SUBCOMM_CONTIGUOUS` - each new communicator contains a set of process with contiguous ranks in the original MPI communicator</font>
<a name="line1015">1015: </a><font color="#B22222">-   `PETSC_SUBCOMM_INTERLACED` - each new communictor contains a set of processes equally far apart in rank from the others in that new communicator</font>

<a name="line1017">1017: </a><font color="#B22222">   Sample Usage:</font>
<a name="line1018">1018: </a><font color="#B22222">.vb</font>
<a name="line1019">1019: </a><font color="#B22222">       <a href="../manualpages/Sys/PetscSubcommCreate.html">PetscSubcommCreate</a>()</font>
<a name="line1020">1020: </a><font color="#B22222">       <a href="../manualpages/Sys/PetscSubcommSetNumber.html">PetscSubcommSetNumber</a>()</font>
<a name="line1021">1021: </a><font color="#B22222">       <a href="../manualpages/Sys/PetscSubcommSetType.html">PetscSubcommSetType</a>(PETSC_SUBCOMM_INTERLACED);</font>
<a name="line1022">1022: </a><font color="#B22222">       ccomm = PetscSubcommChild()</font>
<a name="line1023">1023: </a><font color="#B22222">       <a href="../manualpages/Sys/PetscSubcommDestroy.html">PetscSubcommDestroy</a>()</font>
<a name="line1024">1024: </a><font color="#B22222">.ve</font>

<a name="line1026">1026: </a><font color="#B22222">   Example:</font>
<a name="line1027">1027: </a><font color="#B22222">   Consider a communicator with six processes split into 3 subcommunicators.</font>
<a name="line1028">1028: </a><font color="#B22222">.vb</font>
<a name="line1029">1029: </a><font color="#B22222">   PETSC_SUBCOMM_CONTIGUOUS - the first communicator contains rank 0,1  the second rank 2,3 and the third rank 4,5 in the original ordering of the original communicator</font>
<a name="line1030">1030: </a><font color="#B22222">   PETSC_SUBCOMM_INTERLACED - the first communicator contains rank 0,3, the second 1,4 and the third 2,5</font>
<a name="line1031">1031: </a><font color="#B22222">.ve</font>

<a name="line1033">1033: </a><font color="#B22222">   Level: advanced</font>

<a name="line1035">1035: </a><font color="#B22222">   Note:</font>
<a name="line1036">1036: </a><font color="#B22222">   After a call to `<a href="../manualpages/Sys/PetscSubcommSetType.html">PetscSubcommSetType</a>()`, `<a href="../manualpages/Sys/PetscSubcommSetTypeGeneral.html">PetscSubcommSetTypeGeneral</a>()`, or `<a href="../manualpages/Sys/PetscSubcommSetFromOptions.html">PetscSubcommSetFromOptions</a>()` one may call</font>
<a name="line1037">1037: </a><font color="#B22222">.vb</font>
<a name="line1038">1038: </a><font color="#B22222">     PetscSubcommChild() returns the associated subcommunicator on this process</font>
<a name="line1039">1039: </a><font color="#B22222">     PetscSubcommContiguousParent() returns a parent communitor but with all child of the same subcommunicator having contiguous rank</font>
<a name="line1040">1040: </a><font color="#B22222">.ve</font>

<a name="line1042">1042: </a><font color="#B22222">   Developer Note:</font>
<a name="line1043">1043: </a><font color="#B22222">   This is used in objects such as `<a href="../manualpages/PC/PCREDUNDANT.html">PCREDUNDANT</a>` to manage the subcommunicators on which the redundant computations</font>
<a name="line1044">1044: </a><font color="#B22222">   are performed.</font>

<a name="line1046">1046: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscSubcommCreate.html">PetscSubcommCreate</a>()`, `<a href="../manualpages/Sys/PetscSubcommSetNumber.html">PetscSubcommSetNumber</a>()`, `<a href="../manualpages/Sys/PetscSubcommSetType.html">PetscSubcommSetType</a>()`, `<a href="../manualpages/Sys/PetscSubcommView.html">PetscSubcommView</a>()`, `<a href="../manualpages/Sys/PetscSubcommSetFromOptions.html">PetscSubcommSetFromOptions</a>()`</font>
<a name="line1047">1047: </a><font color="#B22222">S*/</font>
<a name="line1048">1048: </a><font color="#4169E1">typedef struct _n_PetscSubcomm *<a href="../manualpages/Sys/PetscSubcomm.html">PetscSubcomm</a>;</font>
<a name="line1049">1049: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line1050">1050: </a>  PETSC_SUBCOMM_GENERAL    = 0,
<a name="line1051">1051: </a>  PETSC_SUBCOMM_CONTIGUOUS = 1,
<a name="line1052">1052: </a>  PETSC_SUBCOMM_INTERLACED = 2
<a name="line1053">1053: </a>} PetscSubcommType;
<a name="line1054">1054: </a>PETSC_EXTERN const char *const PetscSubcommTypes[];

<a name="line1056">1056: </a><font color="#B22222">/*S</font>
<a name="line1057">1057: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a> - A simple class for managing heaps</font>

<a name="line1059">1059: </a><font color="#B22222">   Level: intermediate</font>

<a name="line1061">1061: </a><font color="#B22222">.seealso: `PetscHeapCreate()`, `PetscHeapAdd()`, `PetscHeapPop()`, `PetscHeapPeek()`, `PetscHeapStash()`, `PetscHeapUnstash()`, `PetscHeapView()`, `PetscHeapDestroy()`</font>
<a name="line1062">1062: </a><font color="#B22222">S*/</font>
<a name="line1063">1063: </a><font color="#4169E1">typedef struct _n_PetscHeap *<a href="../manualpages/Sys/PetscHeap.html">PetscHeap</a>;</font>

<a name="line1065">1065: </a><font color="#4169E1">typedef struct _n_PetscShmComm *PetscShmComm;</font>
<a name="line1066">1066: </a><font color="#4169E1">typedef struct _n_PetscOmpCtrl *PetscOmpCtrl;</font>

<a name="line1068">1068: </a><font color="#B22222">/*S</font>
<a name="line1069">1069: </a><font color="#B22222">   <a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a> - a segmented extendable buffer</font>

<a name="line1071">1071: </a><font color="#B22222">   Level: developer</font>

<a name="line1073">1073: </a><font color="#B22222">.seealso: `<a href="../manualpages/Sys/PetscSegBufferCreate.html">PetscSegBufferCreate</a>()`, `<a href="../manualpages/Sys/PetscSegBufferGet.html">PetscSegBufferGet</a>()`, `PetscSegBufferExtract()`, `<a href="../manualpages/Sys/PetscSegBufferDestroy.html">PetscSegBufferDestroy</a>()`</font>
<a name="line1074">1074: </a><font color="#B22222">S*/</font>
<a name="line1075">1075: </a><font color="#4169E1">typedef struct _n_PetscSegBuffer *<a href="../manualpages/Sys/PetscSegBuffer.html">PetscSegBuffer</a>;</font>

<a name="line1077">1077: </a><font color="#4169E1">typedef struct _n_PetscOptionsHelpPrinted *PetscOptionsHelpPrinted;</font>

<a name="line1079">1079: </a><font color="#B22222">/*S</font>
<a name="line1080">1080: </a><font color="#B22222">     <a href="../manualpages/Sys/PetscBT.html">PetscBT</a> - PETSc bitarrays, efficient storage of arrays of boolean values</font>

<a name="line1082">1082: </a><font color="#B22222">     Level: advanced</font>

<a name="line1084">1084: </a><font color="#B22222">     Notes:</font>
<a name="line1085">1085: </a><font color="#B22222">     The following routines do not have their own manual pages</font>

<a name="line1087">1087: </a><font color="#B22222">.vb</font>
<a name="line1088">1088: </a><font color="#B22222">     PetscBTCreate(m,&amp;bt)         - creates a bit array with enough room to hold m values</font>
<a name="line1089">1089: </a><font color="#B22222">     PetscBTDestroy(&amp;bt)          - destroys the bit array</font>
<a name="line1090">1090: </a><font color="#B22222">     PetscBTMemzero(m,bt)         - zeros the entire bit array (sets all values to false)</font>
<a name="line1091">1091: </a><font color="#B22222">     PetscBTSet(bt,index)         - sets a particular entry as true</font>
<a name="line1092">1092: </a><font color="#B22222">     PetscBTClear(bt,index)       - sets a particular entry as false</font>
<a name="line1093">1093: </a><font color="#B22222">     PetscBTLookup(bt,index)      - returns the value</font>
<a name="line1094">1094: </a><font color="#B22222">     PetscBTLookupSet(bt,index)   - returns the value and then sets it true</font>
<a name="line1095">1095: </a><font color="#B22222">     PetscBTLookupClear(bt,index) - returns the value and then sets it false</font>
<a name="line1096">1096: </a><font color="#B22222">     PetscBTLength(m)             - returns number of bytes in array with m bits</font>
<a name="line1097">1097: </a><font color="#B22222">     PetscBTView(m,bt,viewer)     - prints all the entries in a bit array</font>
<a name="line1098">1098: </a><font color="#B22222">.ve</font>

<a name="line1100">1100: </a><font color="#B22222">    PETSc does not check error flags on `PetscBTLookup()`, `PetscBTLookupSet()`, `PetscBTLength()` because error checking</font>
<a name="line1101">1101: </a><font color="#B22222">    would cost hundreds more cycles then the operation.</font>

<a name="line1103">1103: </a><font color="#B22222">S*/</font>
<a name="line1104">1104: </a><font color="#4169E1">typedef char *<a href="../manualpages/Sys/PetscBT.html">PetscBT</a>;</font>

<a name="line1106">1106: </a><font color="#B22222">/* The number of bits in a byte */</font>
<a name="line1107">1107: </a><strong><font color="#228B22">#define PETSC_BITS_PER_BYTE CHAR_BIT</font></strong>
</pre>
</body>

</html>