File: petscimpl.h.html

package info (click to toggle)
petsc 3.1.dfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 131,360 kB
  • ctags: 491,710
  • sloc: ansic: 288,064; cpp: 66,909; python: 28,799; fortran: 19,153; makefile: 13,945; sh: 3,502; f90: 1,655; xml: 620; csh: 230; java: 13
file content (674 lines) | stat: -rw-r--r-- 82,271 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
<center><a href="petscimpl.h">Actual source code: petscimpl.h</a></center><br>

<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.5">
<meta name="date" content="2010-04-08T19:54:40+00:00">
</head>

<body bgcolor="#FFFFFF">
<pre width="80">
<a name="line2">  2: </a><font color="#B22222">/*</font>
<a name="line3">  3: </a><font color="#B22222">    Defines the basic header of all PETSc objects.</font>
<a name="line4">  4: </a><font color="#B22222">*/</font>

<a name="line6">  6: </a><font color="#A020F0">#if !defined(_PETSCHEAD_H)</font>
<a name="line7">  7: </a><strong><font color="#228B22">#define _PETSCHEAD_H</font></strong>
<a name="line8"> 8: </a> #include <A href="../../include/petscsys.h.html">petscsys.h</A>

<a name="line11"> 11: </a><font color="#B22222">/*</font>
<a name="line12"> 12: </a><font color="#B22222">   All major PETSc data structures have a common core; this is defined </font>
<a name="line13"> 13: </a><font color="#B22222">   below by PETSCHEADER. </font>

<a name="line15"> 15: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscHeaderCreate.html#PetscHeaderCreate">PetscHeaderCreate</A>() should be used whenever creating a PETSc structure.</font>
<a name="line16"> 16: </a><font color="#B22222">*/</font>

<a name="line18"> 18: </a><font color="#B22222">/*</font>
<a name="line19"> 19: </a><font color="#B22222">   PetscOps: structure of core operations that all PETSc objects support.</font>
<a name="line20"> 20: </a><font color="#B22222">   </font>
<a name="line21"> 21: </a><font color="#B22222">      getcomm()         - Gets the object's communicator.</font>
<a name="line22"> 22: </a><font color="#B22222">      view()            - Is the routine for viewing the entire PETSc object; for</font>
<a name="line23"> 23: </a><font color="#B22222">                          example, <A href="../../docs/manualpages/Mat/MatView.html#MatView">MatView</A>() is the general matrix viewing routine.</font>
<a name="line24"> 24: </a><font color="#B22222">      destroy()         - Is the routine for destroying the entire PETSc object; </font>
<a name="line25"> 25: </a><font color="#B22222">                          for example,<A href="../../docs/manualpages/Mat/MatDestroy.html#MatDestroy">MatDestroy</A>() is the general matrix </font>
<a name="line26"> 26: </a><font color="#B22222">                          destruction routine.</font>
<a name="line27"> 27: </a><font color="#B22222">      compose()         - Associates a PETSc object with another PETSc object.</font>
<a name="line28"> 28: </a><font color="#B22222">      query()           - Returns a different PETSc object that has been associated</font>
<a name="line29"> 29: </a><font color="#B22222">                          with the first object.</font>
<a name="line30"> 30: </a><font color="#B22222">      composefunction() - Attaches an additional registered function.</font>
<a name="line31"> 31: </a><font color="#B22222">      queryfunction()   - Requests a registered function that has been registered.</font>
<a name="line32"> 32: </a><font color="#B22222">      publish()         - Not currently used</font>
<a name="line33"> 33: </a><font color="#B22222">*/</font>

<a name="line35"> 35: </a><font color="#4169E1">typedef</font> <font color="#4169E1">struct</font> {
<a name="line36"> 36: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*getcomm)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,<A href="../../docs/manualpages/Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</A> *);
<a name="line37"> 37: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*view)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,<A href="../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>);
<a name="line38"> 38: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*destroy)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>);
<a name="line39"> 39: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*compose)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,const char[],<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>);
<a name="line40"> 40: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*query)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,const char[],<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> *);
<a name="line41"> 41: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*composefunction)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,const char[],const char[],void (*)(void));
<a name="line42"> 42: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*queryfunction)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,const char[],void (**)(void));
<a name="line43"> 43: </a>   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*publish)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>);
<a name="line44"> 44: </a>} PetscOps;

<a name="line46"> 46: </a><font color="#B22222">/*</font>
<a name="line47"> 47: </a><font color="#B22222">   All PETSc objects begin with the fields defined in PETSCHEADER.</font>
<a name="line48"> 48: </a><font color="#B22222">   The <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> is a way of examining these fields regardless of </font>
<a name="line49"> 49: </a><font color="#B22222">   the specific object. In C++ this could be a base abstract class</font>
<a name="line50"> 50: </a><font color="#B22222">   from which all objects are derived.</font>
<a name="line51"> 51: </a><font color="#B22222">*/</font>
<a name="line52"> 52: </a><font color="#4169E1"><a name="_p_PetscObject"></a>typedef struct _p_PetscObject </font>{
<a name="line53"> 53: </a>  <A href="../../docs/manualpages/Sys/PetscCookie.html#PetscCookie">PetscCookie</A>    cookie;
<a name="line54"> 54: </a>  PetscOps       *bops;
<a name="line55"> 55: </a>  <A href="../../docs/manualpages/Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</A>       comm;
<a name="line56"> 56: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       type;
<a name="line57"> 57: </a>  PetscLogDouble flops,time,mem;
<a name="line58"> 58: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       id;
<a name="line59"> 59: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       refct;
<a name="line60"> 60: </a>  <A href="../../docs/manualpages/Sys/PetscMPIInt.html#PetscMPIInt">PetscMPIInt</A>    tag;
<a name="line61"> 61: </a>  <A href="../../docs/manualpages/Sys/PetscFList.html#PetscFList">PetscFList</A>     qlist;
<a name="line62"> 62: </a>  <A href="../../docs/manualpages/Sys/PetscOList.html#PetscOList">PetscOList</A>     olist;
<a name="line63"> 63: </a>  char           *class_name;
<a name="line64"> 64: </a>  char           *type_name;
<a name="line65"> 65: </a>  <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>    parent;
<a name="line66"> 66: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       parentid;
<a name="line67"> 67: </a>  char*          name;
<a name="line68"> 68: </a>  char           *prefix;
<a name="line69"> 69: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       tablevel;
<a name="line70"> 70: </a>  void           *cpp;
<a name="line71"> 71: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       amem;
<a name="line72"> 72: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       state;
<a name="line73"> 73: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       int_idmax,        intstar_idmax;
<a name="line74"> 74: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       *intcomposedstate,*intstarcomposedstate;
<a name="line75"> 75: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       *intcomposeddata, **intstarcomposeddata;
<a name="line76"> 76: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       real_idmax,        realstar_idmax;
<a name="line77"> 77: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       *realcomposedstate,*realstarcomposedstate;
<a name="line78"> 78: </a>  <A href="../../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>      *realcomposeddata, **realstarcomposeddata;
<a name="line79"> 79: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       scalar_idmax,        scalarstar_idmax;
<a name="line80"> 80: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>       *scalarcomposedstate,*scalarstarcomposedstate;
<a name="line81"> 81: </a>  <A href="../../docs/manualpages/Sys/PetscScalar.html#PetscScalar">PetscScalar</A>    *scalarcomposeddata, **scalarstarcomposeddata;
<a name="line82"> 82: </a>  void           (**fortran_func_pointers)(void);                  <font color="#B22222">/* used by Fortran interface functions to stash user provided Fortran functions */</font>
<a name="line83"> 83: </a>  void           *python_context;
<a name="line84"> 84: </a>  <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*python_destroy)(void*);
<a name="line85"> 85: </a>} _p_PetscObject;

<a name="line87"> 87: </a><strong><font color="#228B22">#define PETSCHEADER(ObjectOps) \</font></strong>
<a name="line88"> 88: </a><strong><font color="#228B22">  _p_PetscObject hdr;               \</font></strong>
<a name="line89"> 89: </a><strong><font color="#228B22">  ObjectOps      *ops</font></strong>

<a name="line91"> 91: </a><strong><font color="#228B22">#define  PETSCFREEDHEADER -1</font></strong>

<a name="line94"> 94: </a><strong><font color="#4169E1">typedef <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*PetscObjectViewerFunction)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,<A href="../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>)</font></strong>;

<a name="line96"> 96: </a><font color="#B22222">/*@C</font>
<a name="line97"> 97: </a><font color="#B22222">    <A href="../../docs/manualpages/Sys/PetscHeaderCreate.html#PetscHeaderCreate">PetscHeaderCreate</A> - Creates a PETSc object</font>

<a name="line99"> 99: </a><font color="#B22222">    Input Parameters:</font>
<a name="line100">100: </a><font color="#B22222">+   tp - the data structure type of the object</font>
<a name="line101">101: </a><font color="#B22222">.   pops - the data structure type of the objects operations (for example VecOps)</font>
<a name="line102">102: </a><font color="#B22222">.   cook - the cookie associated with this object</font>
<a name="line103">103: </a><font color="#B22222">.   t - type (no longer should be used)</font>
<a name="line104">104: </a><font color="#B22222">.   class_name - string name of class; should be static</font>
<a name="line105">105: </a><font color="#B22222">.   com - the MPI Communicator</font>
<a name="line106">106: </a><font color="#B22222">.   des - the destroy routine for this object</font>
<a name="line107">107: </a><font color="#B22222">-   vie - the view routine for this object</font>

<a name="line109">109: </a><font color="#B22222">    Output Parameter:</font>
<a name="line110">110: </a><font color="#B22222">.   h - the newly created object</font>

<a name="line112">112: </a><font color="#B22222">    Level: developer</font>

<a name="line114">114: </a><font color="#B22222">.seealso: <A href="../../docs/manualpages/Sys/PetscHeaderDestroy.html#PetscHeaderDestroy">PetscHeaderDestroy</A>(), <A href="../../docs/manualpages/Profiling/PetscCookieRegister.html#PetscCookieRegister">PetscCookieRegister</A>()</font>

<a name="line116">116: </a><font color="#B22222">@*/</font>
<a name="line117">117: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscHeaderCreate.html#PetscHeaderCreate">PetscHeaderCreate</A>(h,tp,pops,cook,t,class_name,com,des,vie)        \</font></strong>
<a name="line118">118: </a><strong><font color="#228B22">  (<A href="../../docs/manualpages/Sys/PetscNew.html#PetscNew">PetscNew</A>(struct tp,&amp;(h)) ||                                                \</font></strong>
<a name="line119">119: </a><strong><font color="#228B22">   <A href="../../docs/manualpages/Sys/PetscNew.html#PetscNew">PetscNew</A>(PetscOps,&amp;(((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;bops)) ||                        \</font></strong>
<a name="line120">120: </a><strong><font color="#228B22">   <A href="../../docs/manualpages/Sys/PetscNew.html#PetscNew">PetscNew</A>(pops,&amp;((h)-&gt;ops)) ||                                        \</font></strong>
<a name="line121">121: </a><strong><font color="#228B22">   PetscHeaderCreate_Private((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)h,cook,t,class_name,com,(PetscObjectFunction)des,(PetscObjectViewerFunction)vie) || \</font></strong>
<a name="line122">122: </a><strong><font color="#228B22">   PetscLogObjectCreate(h) ||                                                \</font></strong>
<a name="line123">123: </a><strong><font color="#228B22">   PetscLogObjectMemory(h, sizeof(struct tp) + sizeof(PetscOps) + sizeof(pops)))</font></strong>

<a name="line125">125: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> PetscComposedQuantitiesDestroy(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj)</font></strong>;
<a name="line126">126: </a><strong><font color="#4169E1"><a name="PetscHeaderCreate_Private"></a>EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscHeaderCreate_Private(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,<A href="../../docs/manualpages/Sys/PetscCookie.html#PetscCookie">PetscCookie</A>,<A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>,const char[],<A href="../../docs/manualpages/Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</A>,<A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>),<A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*)(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,<A href="../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>)</font></strong>);

<a name="line128">128: </a><font color="#B22222">/*@C</font>
<a name="line129">129: </a><font color="#B22222">    <A href="../../docs/manualpages/Sys/PetscHeaderDestroy.html#PetscHeaderDestroy">PetscHeaderDestroy</A> - Final step in destroying a <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A></font>

<a name="line131">131: </a><font color="#B22222">    Input Parameters:</font>
<a name="line132">132: </a><font color="#B22222">.   h - the header created with <A href="../../docs/manualpages/Sys/PetscHeaderCreate.html#PetscHeaderCreate">PetscHeaderCreate</A>()</font>

<a name="line134">134: </a><font color="#B22222">    Level: developer</font>

<a name="line136">136: </a><font color="#B22222">.seealso: <A href="../../docs/manualpages/Sys/PetscHeaderCreate.html#PetscHeaderCreate">PetscHeaderCreate</A>()</font>
<a name="line137">137: </a><font color="#B22222">@*/</font>
<a name="line138">138: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscHeaderDestroy.html#PetscHeaderDestroy">PetscHeaderDestroy</A>(h)                           \</font></strong>
<a name="line139">139: </a><strong><font color="#228B22">  (PetscLogObjectDestroy((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h)) ||           \</font></strong>
<a name="line140">140: </a><strong><font color="#228B22">   PetscComposedQuantitiesDestroy((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)h) || \</font></strong>
<a name="line141">141: </a><strong><font color="#228B22">   PetscHeaderDestroy_Private((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h)) || \</font></strong>
<a name="line142">142: </a><strong><font color="#228B22">   <A href="../../docs/manualpages/Sys/PetscFree.html#PetscFree">PetscFree</A>((h)-&gt;ops) ||                           \</font></strong>
<a name="line143">143: </a><strong><font color="#228B22">   <A href="../../docs/manualpages/Sys/PetscFree.html#PetscFree">PetscFree</A>(h))</font></strong>

<a name="line145">145: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscHeaderDestroy_Private(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;

<a name="line147">147: </a><font color="#B22222">/* ---------------------------------------------------------------------------------------*/</font>

<a name="line149">149: </a><font color="#A020F0">#if !defined(PETSC_USE_DEBUG)</font>


<a name="line158">158: </a><font color="#A020F0">#elif !defined(PETSC_HAVE_UNALIGNED_POINTERS)</font>
<a name="line159">159: </a><font color="#B22222">/* </font>
<a name="line160">160: </a><font color="#B22222">    Macros to test if a PETSc object is valid and if pointers are</font>
<a name="line161">161: </a><font color="#B22222">valid</font>

<a name="line163">163: </a><font color="#B22222">*/</font>
<a name="line165">165: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Object: Parameter # %d"</font><font color="#228B22">,arg);}          \</font></strong>
<a name="line166">166: </a><strong><font color="#228B22">   if ((unsigned long)(h) &amp; (unsigned long)3) {                        \</font></strong>
<a name="line167">167: </a><strong><font color="#228B22">    <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Invalid Pointer to Object: Parameter # %d"</font><font color="#228B22">,arg);   \</font></strong>
<a name="line168">168: </a><strong><font color="#228B22">  }                                                                                   \</font></strong>
<a name="line169">169: </a><strong><font color="#228B22">  if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie != ck) {                                             \</font></strong>
<a name="line170">170: </a><strong><font color="#228B22">    if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie == PETSCFREEDHEADER) {                             \</font></strong>
<a name="line171">171: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Object already free: Parameter # %d"</font><font color="#228B22">,arg);       \</font></strong>
<a name="line172">172: </a><strong><font color="#228B22">    } else {                                                                          \</font></strong>
<a name="line173">173: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_WRONG,</font><font color="#666666">"Wrong type of object: Parameter # %d"</font><font color="#228B22">,arg);       \</font></strong>
<a name="line174">174: </a><strong><font color="#228B22">    }                                                                                 \</font></strong>
<a name="line175">175: </a><strong><font color="#228B22">  }} </font></strong>

<a name="line178">178: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Object: Parameter # %d"</font><font color="#228B22">,arg);}             \</font></strong>
<a name="line179">179: </a><strong><font color="#228B22">   if ((unsigned long)(h) &amp; (unsigned long)3) {                        \</font></strong>
<a name="line180">180: </a><strong><font color="#228B22">    <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Invalid Pointer to Object: Parameter # %d"</font><font color="#228B22">,arg);     \</font></strong>
<a name="line181">181: </a><strong><font color="#228B22">  } else if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie == PETSCFREEDHEADER) {                           \</font></strong>
<a name="line182">182: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Object already free: Parameter # %d"</font><font color="#228B22">,arg);         \</font></strong>
<a name="line183">183: </a><strong><font color="#228B22">  } else if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie &lt; PETSC_SMALLEST_COOKIE ||                                \</font></strong>
<a name="line184">184: </a><strong><font color="#228B22">      ((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie &gt; PETSC_LARGEST_COOKIE) {                               \</font></strong>
<a name="line185">185: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Invalid type of object: Parameter # %d"</font><font color="#228B22">,arg);      \</font></strong>
<a name="line186">186: </a><strong><font color="#228B22">  }}</font></strong>

<a name="line189">189: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer: Parameter # %d"</font><font color="#228B22">,arg);}             \</font></strong>
<a name="line190">190: </a><strong><font color="#228B22">   if ((unsigned long)(h) &amp; (unsigned long)3){                                \</font></strong>
<a name="line191">191: </a><strong><font color="#228B22">    <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_BADPTR,</font><font color="#666666">"Invalid Pointer: Parameter # %d"</font><font color="#228B22">,arg);                 \</font></strong>
<a name="line192">192: </a><strong><font color="#228B22">  }}</font></strong>

<a name="line195">195: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer: Parameter # %d"</font><font color="#228B22">,arg);}              \</font></strong>
<a name="line196">196: </a><strong><font color="#228B22">  }</font></strong>

<a name="line199">199: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_BADPTR,</font><font color="#666666">"Null Pointer: Parameter # %d"</font><font color="#228B22">,arg);}            \</font></strong>
<a name="line200">200: </a><strong><font color="#228B22">  if ((unsigned long)(h) &amp; (unsigned long)3){                                \</font></strong>
<a name="line201">201: </a><strong><font color="#228B22">    <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_BADPTR,</font><font color="#666666">"Invalid Pointer to Int: Parameter # %d"</font><font color="#228B22">,arg);           \</font></strong>
<a name="line202">202: </a><strong><font color="#228B22">  }}</font></strong>

<a name="line204">204: </a><font color="#A020F0">#if !defined(PETSC_HAVE_DOUBLES_ALIGNED) </font>
<a name="line206">206: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer: Parameter # %d"</font><font color="#228B22">,arg);}               \</font></strong>
<a name="line207">207: </a><strong><font color="#228B22">  if ((unsigned long)(h) &amp; (unsigned long)3) {                        \</font></strong>
<a name="line208">208: </a><strong><font color="#228B22">    <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_BADPTR,</font><font color="#666666">"Invalid Pointer to <A href="../../docs/manualpages/Sys/PetscScalar.html#PetscScalar">PetscScalar</A>: Parameter # %d"</font><font color="#228B22">,arg);    \</font></strong>
<a name="line209">209: </a><strong><font color="#228B22">  }}</font></strong>
<a name="line210">210: </a><font color="#A020F0">#else</font>
<a name="line212">212: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer: Parameter # %d"</font><font color="#228B22">,arg);}               \</font></strong>
<a name="line213">213: </a><strong><font color="#228B22">  if ((unsigned long)(h) &amp; (unsigned long)7) {                        \</font></strong>
<a name="line214">214: </a><strong><font color="#228B22">    <A href="../../docs/manualpages/Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(PETSC_ERR_ARG_BADPTR,</font><font color="#666666">"Invalid Pointer to <A href="../../docs/manualpages/Sys/PetscScalar.html#PetscScalar">PetscScalar</A>: Parameter # %d"</font><font color="#228B22">,arg);    \</font></strong>
<a name="line215">215: </a><strong><font color="#228B22">  }}</font></strong>
<a name="line216">216: </a><font color="#A020F0">#endif</font>

<a name="line218">218: </a><font color="#A020F0">#else</font>
<a name="line219">219: </a><font color="#B22222">/*</font>
<a name="line220">220: </a><font color="#B22222">     Version where pointers don't have any particular alignment</font>
<a name="line221">221: </a><font color="#B22222">*/</font>
<a name="line223">223: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Object"</font><font color="#228B22">);}        \</font></strong>
<a name="line224">224: </a><strong><font color="#228B22">  if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie != ck) {                           \</font></strong>
<a name="line225">225: </a><strong><font color="#228B22">    if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie == PETSCFREEDHEADER) {           \</font></strong>
<a name="line226">226: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Object already free"</font><font color="#228B22">);       \</font></strong>
<a name="line227">227: </a><strong><font color="#228B22">    } else {                                                        \</font></strong>
<a name="line228">228: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_WRONG,</font><font color="#666666">"Wrong Object"</font><font color="#228B22">);                \</font></strong>
<a name="line229">229: </a><strong><font color="#228B22">    }                                                               \</font></strong>
<a name="line230">230: </a><strong><font color="#228B22">  }} </font></strong>

<a name="line233">233: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Object"</font><font color="#228B22">);}        \</font></strong>
<a name="line234">234: </a><strong><font color="#228B22">  if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie == PETSCFREEDHEADER) {      \</font></strong>
<a name="line235">235: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Object already free"</font><font color="#228B22">);       \</font></strong>
<a name="line236">236: </a><strong><font color="#228B22">  } else if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie &lt; PETSC_SMALLEST_COOKIE ||           \</font></strong>
<a name="line237">237: </a><strong><font color="#228B22">      ((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)(h))-&gt;cookie &gt; PETSC_LARGEST_COOKIE) {          \</font></strong>
<a name="line238">238: </a><strong><font color="#228B22">      <A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_CORRUPT,</font><font color="#666666">"Invalid type of object"</font><font color="#228B22">);            \</font></strong>
<a name="line239">239: </a><strong><font color="#228B22">  }}</font></strong>

<a name="line242">242: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer"</font><font color="#228B22">);}        \</font></strong>
<a name="line243">243: </a><strong><font color="#228B22">  }</font></strong>

<a name="line246">246: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer"</font><font color="#228B22">);}        \</font></strong>
<a name="line247">247: </a><strong><font color="#228B22">  }</font></strong>

<a name="line250">250: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer"</font><font color="#228B22">);}        \</font></strong>
<a name="line251">251: </a><strong><font color="#228B22">  }</font></strong>

<a name="line253">253: </a><font color="#A020F0">#if !defined(PETSC_HAVE_DOUBLES_ALIGNED)</font>
<a name="line255">255: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer"</font><font color="#228B22">);}        \</font></strong>
<a name="line256">256: </a><strong><font color="#228B22">  }</font></strong>
<a name="line257">257: </a><font color="#A020F0">#else</font>
<a name="line259">259: </a><strong><font color="#228B22">  {if (!h) {<A href="../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(PETSC_ERR_ARG_NULL,</font><font color="#666666">"Null Pointer"</font><font color="#228B22">);}        \</font></strong>
<a name="line260">260: </a><strong><font color="#228B22">  }</font></strong>
<a name="line261">261: </a><font color="#A020F0">#endif</font>

<a name="line263">263: </a><font color="#A020F0">#endif</font>

<a name="line266">266: </a><font color="#A020F0">#if !defined(PETSC_USE_DEBUG)</font>


<a name="line273">273: </a><font color="#A020F0">#else</font>

<a name="line275">275: </a><font color="#B22222">/*</font>
<a name="line276">276: </a><font color="#B22222">    For example, in the dot product between two vectors,</font>
<a name="line277">277: </a><font color="#B22222">  both vectors must be either Seq or MPI, not one of each </font>
<a name="line278">278: </a><font color="#B22222">*/</font>
<a name="line280">280: </a><strong><font color="#228B22">  if (((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)a)-&gt;type != ((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)b)-&gt;type) <A href="../../docs/manualpages/Sys/SETERRQ2.html#SETERRQ2">SETERRQ2</A>(PETSC_ERR_ARG_NOTSAMETYPE,</font><font color="#666666">"Objects not of same type: Argument # %d and %d"</font><font color="#228B22">,arga,argb);</font></strong>
<a name="line281">281: </a><font color="#B22222">/* </font>
<a name="line282">282: </a><font color="#B22222">   Use this macro to check if the type is set</font>
<a name="line283">283: </a><font color="#B22222">*/</font>
<a name="line285">285: </a><strong><font color="#228B22">  if (!((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)a)-&gt;type_name) <A href="../../docs/manualpages/Sys/SETERRQ2.html#SETERRQ2">SETERRQ2</A>(PETSC_ERR_ARG_WRONGSTATE,</font><font color="#666666">"%s object's type is not set: Argument # %d"</font><font color="#228B22">,((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)a)-&gt;class_name,arg);</font></strong>
<a name="line286">286: </a><font color="#B22222">/*</font>
<a name="line287">287: </a><font color="#B22222">   Sometimes object must live on same communicator to inter-operate</font>
<a name="line288">288: </a><font color="#B22222">*/</font>
<a name="line290">290: </a><strong><font color="#228B22">  {<A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> _6_ierr,__flag; _6_MPI_Comm_compare(((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)a)-&gt;comm,((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)b)-&gt;comm,&amp;__flag);\</font></strong>
<a name="line291">291: </a><strong><font color="#228B22">  <A href="../../docs/manualpages/Sys/CHKERRQ.html#CHKERRQ">CHKERRQ</A>(_6_ierr); \</font></strong>
<a name="line292">292: </a><strong><font color="#228B22">  if (__flag != MPI_CONGRUENT &amp;&amp; __flag != MPI_IDENT) \</font></strong>
<a name="line293">293: </a><strong><font color="#228B22">  <A href="../../docs/manualpages/Sys/SETERRQ2.html#SETERRQ2">SETERRQ2</A>(PETSC_ERR_ARG_NOTSAMECOMM,</font><font color="#666666">"Different communicators in the two objects: Argument # %d and %d"</font><font color="#228B22">,arga,argb);}</font></strong>


<a name="line299">299: </a><font color="#A020F0">#endif</font>

<a name="line301">301: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectPublishBaseBegin(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;
<a name="line302">302: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectPublishBaseEnd(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;

<a name="line304">304: </a><font color="#B22222">/*MC</font>
<a name="line305">305: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectStateIncrease.html#PetscObjectStateIncrease">PetscObjectStateIncrease</A> - Increases the state of any <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>, </font>
<a name="line306">306: </a><font color="#B22222">   regardless of the type.</font>

<a name="line308">308: </a><font color="#B22222">   Synopsis:</font>
<a name="line309">309: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectStateIncrease.html#PetscObjectStateIncrease">PetscObjectStateIncrease</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj)</font>

<a name="line311">311: </a><font color="#B22222">   Not Collective</font>

<a name="line313">313: </a><font color="#B22222">   Input Parameter:</font>
<a name="line314">314: </a><font color="#B22222">.  obj - any PETSc object, for example a <A href="../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>, <A href="../../docs/manualpages/Mat/Mat.html#Mat">Mat</A> or <A href="../../docs/manualpages/KSP/KSP.html#KSP">KSP</A>. This must be</font>
<a name="line315">315: </a><font color="#B22222">         cast with a (<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>), for example, </font>
<a name="line316">316: </a><font color="#B22222">         <A href="../../docs/manualpages/Sys/PetscObjectStateIncrease.html#PetscObjectStateIncrease">PetscObjectStateIncrease</A>((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)mat);</font>

<a name="line318">318: </a><font color="#B22222">   Notes: object state is an integer which gets increased every time</font>
<a name="line319">319: </a><font color="#B22222">   the object is changed. By saving and later querying the object state</font>
<a name="line320">320: </a><font color="#B22222">   one can determine whether information about the object is still current.</font>
<a name="line321">321: </a><font color="#B22222">   Currently, state is maintained for <A href="../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> and <A href="../../docs/manualpages/Mat/Mat.html#Mat">Mat</A> objects.</font>

<a name="line323">323: </a><font color="#B22222">   This routine is mostly for internal use by PETSc; a developer need only</font>
<a name="line324">324: </a><font color="#B22222">   call it after explicit access to an object's internals. Routines such</font>
<a name="line325">325: </a><font color="#B22222">   as <A href="../../docs/manualpages/Vec/VecSet.html#VecSet">VecSet</A> or <A href="../../docs/manualpages/Mat/MatScale.html#MatScale">MatScale</A> already call this routine. It is also called, as a </font>
<a name="line326">326: </a><font color="#B22222">   precaution, in <A href="../../docs/manualpages/Vec/VecRestoreArray.html#VecRestoreArray">VecRestoreArray</A>, <A href="../../docs/manualpages/Mat/MatRestoreRow.html#MatRestoreRow">MatRestoreRow</A>, <A href="../../docs/manualpages/Mat/MatRestoreArray.html#MatRestoreArray">MatRestoreArray</A>.</font>

<a name="line328">328: </a><font color="#B22222">   Level: developer</font>

<a name="line330">330: </a><font color="#B22222">   seealso: <A href="../../docs/manualpages/Sys/PetscObjectStateQuery.html#PetscObjectStateQuery">PetscObjectStateQuery</A>(), <A href="../../docs/manualpages/Sys/PetscObjectStateDecrease.html#PetscObjectStateDecrease">PetscObjectStateDecrease</A>()</font>

<a name="line332">332: </a><font color="#B22222">   Concepts: state</font>

<a name="line334">334: </a><font color="#B22222">M*/</font>
<a name="line335">335: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectStateIncrease.html#PetscObjectStateIncrease">PetscObjectStateIncrease</A>(obj) ((obj)-&gt;state++,0)</font></strong>

<a name="line337">337: </a><font color="#B22222">/*MC</font>
<a name="line338">338: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectStateDecrease.html#PetscObjectStateDecrease">PetscObjectStateDecrease</A> - Decreases the state of any <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>, </font>
<a name="line339">339: </a><font color="#B22222">   regardless of the type.</font>

<a name="line341">341: </a><font color="#B22222">   Synopsis:</font>
<a name="line342">342: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectStateDecrease.html#PetscObjectStateDecrease">PetscObjectStateDecrease</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj)</font>

<a name="line344">344: </a><font color="#B22222">   Not Collective</font>

<a name="line346">346: </a><font color="#B22222">   Input Parameter:</font>
<a name="line347">347: </a><font color="#B22222">.  obj - any PETSc object, for example a <A href="../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>, <A href="../../docs/manualpages/Mat/Mat.html#Mat">Mat</A> or <A href="../../docs/manualpages/KSP/KSP.html#KSP">KSP</A>. This must be</font>
<a name="line348">348: </a><font color="#B22222">         cast with a (<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>), for example, </font>
<a name="line349">349: </a><font color="#B22222">         <A href="../../docs/manualpages/Sys/PetscObjectStateIncrease.html#PetscObjectStateIncrease">PetscObjectStateIncrease</A>((<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)mat);</font>

<a name="line351">351: </a><font color="#B22222">   Notes: object state is an integer which gets increased every time</font>
<a name="line352">352: </a><font color="#B22222">   the object is changed. By saving and later querying the object state</font>
<a name="line353">353: </a><font color="#B22222">   one can determine whether information about the object is still current.</font>
<a name="line354">354: </a><font color="#B22222">   Currently, state is maintained for <A href="../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> and <A href="../../docs/manualpages/Mat/Mat.html#Mat">Mat</A> objects.</font>

<a name="line356">356: </a><font color="#B22222">   Level: developer</font>

<a name="line358">358: </a><font color="#B22222">   seealso: <A href="../../docs/manualpages/Sys/PetscObjectStateQuery.html#PetscObjectStateQuery">PetscObjectStateQuery</A>(), <A href="../../docs/manualpages/Sys/PetscObjectStateIncrease.html#PetscObjectStateIncrease">PetscObjectStateIncrease</A>()</font>

<a name="line360">360: </a><font color="#B22222">   Concepts: state</font>

<a name="line362">362: </a><font color="#B22222">M*/</font>
<a name="line363">363: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectStateDecrease.html#PetscObjectStateDecrease">PetscObjectStateDecrease</A>(obj) ((obj)-&gt;state--,0)</font></strong>

<a name="line365">365: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  <A href="../../docs/manualpages/Sys/PetscObjectStateQuery.html#PetscObjectStateQuery">PetscObjectStateQuery</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,<A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>*)</font></strong>;
<a name="line366">366: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  <A href="../../docs/manualpages/Sys/PetscObjectSetState.html#PetscObjectSetState">PetscObjectSetState</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>,<A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>)</font></strong>;
<a name="line367">367: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  <A href="../../docs/manualpages/Sys/PetscObjectComposedDataRegister.html#PetscObjectComposedDataRegister">PetscObjectComposedDataRegister</A>(<A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>*)</font></strong>;
<a name="line368">368: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectComposedDataIncreaseInt(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;
<a name="line369">369: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectComposedDataIncreaseIntstar(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;
<a name="line370">370: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectComposedDataIncreaseReal(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;
<a name="line371">371: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectComposedDataIncreaseRealstar(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;
<a name="line372">372: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectComposedDataIncreaseScalar(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;
<a name="line373">373: </a><strong><font color="#4169E1">EXTERN <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  PetscObjectComposedDataIncreaseScalarstar(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)</font></strong>;
<a name="line374">374: </a>EXTERN <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>        globalcurrentstate;
<a name="line375">375: </a>EXTERN <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>        globalmaxstate;
<a name="line376">376: </a><font color="#B22222">/*MC</font>
<a name="line377">377: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetInt.html#PetscObjectComposedDataSetInt">PetscObjectComposedDataSetInt</A> - attach integer data to a <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A></font>

<a name="line379">379: </a><font color="#B22222">   Synopsis:</font>
<a name="line380">380: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetInt.html#PetscObjectComposedDataSetInt">PetscObjectComposedDataSetInt</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,int data)</font>

<a name="line382">382: </a><font color="#B22222">   Not collective</font>

<a name="line384">384: </a><font color="#B22222">   Input parameters:</font>
<a name="line385">385: </a><font color="#B22222">+  obj - the object to which data is to be attached</font>
<a name="line386">386: </a><font color="#B22222">.  id - the identifier for the data</font>
<a name="line387">387: </a><font color="#B22222">-  data - the data to  be attached</font>

<a name="line389">389: </a><font color="#B22222">   Notes</font>
<a name="line390">390: </a><font color="#B22222">   The data identifier can best be determined through a call to</font>
<a name="line391">391: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataRegister.html#PetscObjectComposedDataRegister">PetscObjectComposedDataRegister</A>()</font>

<a name="line393">393: </a><font color="#B22222">   Level: developer</font>
<a name="line394">394: </a><font color="#B22222">M*/</font>
<a name="line395">395: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetInt.html#PetscObjectComposedDataSetInt">PetscObjectComposedDataSetInt</A>(obj,id,data)                                      \</font></strong>
<a name="line396">396: </a><strong><font color="#228B22">  ((((obj)-&gt;int_idmax &lt; globalmaxstate) ? PetscObjectComposedDataIncreaseInt(obj) : 0), \</font></strong>
<a name="line397">397: </a><strong><font color="#228B22">   (obj)-&gt;intcomposeddata[id] = data,(obj)-&gt;intcomposedstate[id] = (obj)-&gt;state, 0)</font></strong>

<a name="line399">399: </a><font color="#B22222">/*MC</font>
<a name="line400">400: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetInt.html#PetscObjectComposedDataGetInt">PetscObjectComposedDataGetInt</A> - retrieve integer data attached to an object</font>

<a name="line402">402: </a><font color="#B22222">   Synopsis:</font>
<a name="line403">403: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetInt.html#PetscObjectComposedDataGetInt">PetscObjectComposedDataGetInt</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,int data,<A href="../../docs/manualpages/Sys/PetscTruth.html#PetscTruth">PetscTruth</A> flag)</font>

<a name="line405">405: </a><font color="#B22222">   Not collective</font>

<a name="line407">407: </a><font color="#B22222">   Input parameters:</font>
<a name="line408">408: </a><font color="#B22222">+  obj - the object from which data is to be retrieved</font>
<a name="line409">409: </a><font color="#B22222">-  id - the identifier for the data</font>

<a name="line411">411: </a><font color="#B22222">   Output parameters</font>
<a name="line412">412: </a><font color="#B22222">+  data - the data to be retrieved</font>
<a name="line413">413: </a><font color="#B22222">-  flag - <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> if the data item exists and is valid, <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> otherwise</font>

<a name="line415">415: </a><font color="#B22222">   The 'data' and 'flag' variables are inlined, so they are not pointers.</font>

<a name="line417">417: </a><font color="#B22222">   Level: developer</font>
<a name="line418">418: </a><font color="#B22222">M*/</font>
<a name="line419">419: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetInt.html#PetscObjectComposedDataGetInt">PetscObjectComposedDataGetInt</A>(obj,id,data,flag)                            \</font></strong>
<a name="line420">420: </a><strong><font color="#228B22">  ((((obj)-&gt;intcomposedstate &amp;&amp; ((obj)-&gt;intcomposedstate[id] == (obj)-&gt;state)) ?   \</font></strong>
<a name="line421">421: </a><strong><font color="#228B22">   (data = (obj)-&gt;intcomposeddata[id],flag = <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A>) : (flag = <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A>)),0)</font></strong>

<a name="line423">423: </a><font color="#B22222">/*MC</font>
<a name="line424">424: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetIntstar.html#PetscObjectComposedDataSetIntstar">PetscObjectComposedDataSetIntstar</A> - attach integer array data to a <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A></font>

<a name="line426">426: </a><font color="#B22222">   Synopsis:</font>
<a name="line427">427: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetIntstar.html#PetscObjectComposedDataSetIntstar">PetscObjectComposedDataSetIntstar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,int *data)</font>

<a name="line429">429: </a><font color="#B22222">   Not collective</font>

<a name="line431">431: </a><font color="#B22222">   Input parameters:</font>
<a name="line432">432: </a><font color="#B22222">+  obj - the object to which data is to be attached</font>
<a name="line433">433: </a><font color="#B22222">.  id - the identifier for the data</font>
<a name="line434">434: </a><font color="#B22222">-  data - the data to  be attached</font>

<a name="line436">436: </a><font color="#B22222">   Notes</font>
<a name="line437">437: </a><font color="#B22222">   The data identifier can best be determined through a call to</font>
<a name="line438">438: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataRegister.html#PetscObjectComposedDataRegister">PetscObjectComposedDataRegister</A>()</font>

<a name="line440">440: </a><font color="#B22222">   Level: developer</font>
<a name="line441">441: </a><font color="#B22222">M*/</font>
<a name="line442">442: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetIntstar.html#PetscObjectComposedDataSetIntstar">PetscObjectComposedDataSetIntstar</A>(obj,id,data)                                          \</font></strong>
<a name="line443">443: </a><strong><font color="#228B22">  ((((obj)-&gt;intstar_idmax &lt; globalmaxstate) ? PetscObjectComposedDataIncreaseIntstar(obj) : 0), \</font></strong>
<a name="line444">444: </a><strong><font color="#228B22">  (obj)-&gt;intstarcomposeddata[id] = data,(obj)-&gt;intstarcomposedstate[id] = (obj)-&gt;state, 0)</font></strong>

<a name="line446">446: </a><font color="#B22222">/*MC</font>
<a name="line447">447: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetIntstar.html#PetscObjectComposedDataGetIntstar">PetscObjectComposedDataGetIntstar</A> - retrieve integer array data </font>
<a name="line448">448: </a><font color="#B22222">   attached to an object</font>

<a name="line450">450: </a><font color="#B22222">   Synopsis:</font>
<a name="line451">451: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetIntstar.html#PetscObjectComposedDataGetIntstar">PetscObjectComposedDataGetIntstar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,int *data,<A href="../../docs/manualpages/Sys/PetscTruth.html#PetscTruth">PetscTruth</A> flag)</font>

<a name="line453">453: </a><font color="#B22222">   Not collective</font>

<a name="line455">455: </a><font color="#B22222">   Input parameters:</font>
<a name="line456">456: </a><font color="#B22222">+  obj - the object from which data is to be retrieved</font>
<a name="line457">457: </a><font color="#B22222">-  id - the identifier for the data</font>

<a name="line459">459: </a><font color="#B22222">   Output parameters</font>
<a name="line460">460: </a><font color="#B22222">+  data - the data to be retrieved</font>
<a name="line461">461: </a><font color="#B22222">-  flag - <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> if the data item exists and is valid, <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> otherwise</font>

<a name="line463">463: </a><font color="#B22222">   The 'data' and 'flag' variables are inlined, so they are not pointers.</font>

<a name="line465">465: </a><font color="#B22222">   Level: developer</font>
<a name="line466">466: </a><font color="#B22222">M*/</font>
<a name="line467">467: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetIntstar.html#PetscObjectComposedDataGetIntstar">PetscObjectComposedDataGetIntstar</A>(obj,id,data,flag)                               \</font></strong>
<a name="line468">468: </a><strong><font color="#228B22">  ((((obj)-&gt;intstarcomposedstate &amp;&amp; ((obj)-&gt;intstarcomposedstate[id] == (obj)-&gt;state)) ?  \</font></strong>
<a name="line469">469: </a><strong><font color="#228B22">   (data = (obj)-&gt;intstarcomposeddata[id],flag = <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A>) : (flag = <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A>)),0)</font></strong>

<a name="line471">471: </a><font color="#B22222">/*MC</font>
<a name="line472">472: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetReal.html#PetscObjectComposedDataSetReal">PetscObjectComposedDataSetReal</A> - attach real data to a <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A></font>

<a name="line474">474: </a><font color="#B22222">   Synopsis:</font>
<a name="line475">475: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetReal.html#PetscObjectComposedDataSetReal">PetscObjectComposedDataSetReal</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> data)</font>

<a name="line477">477: </a><font color="#B22222">   Not collective</font>

<a name="line479">479: </a><font color="#B22222">   Input parameters:</font>
<a name="line480">480: </a><font color="#B22222">+  obj - the object to which data is to be attached</font>
<a name="line481">481: </a><font color="#B22222">.  id - the identifier for the data</font>
<a name="line482">482: </a><font color="#B22222">-  data - the data to  be attached</font>

<a name="line484">484: </a><font color="#B22222">   Notes</font>
<a name="line485">485: </a><font color="#B22222">   The data identifier can best be determined through a call to</font>
<a name="line486">486: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataRegister.html#PetscObjectComposedDataRegister">PetscObjectComposedDataRegister</A>()</font>

<a name="line488">488: </a><font color="#B22222">   Level: developer</font>
<a name="line489">489: </a><font color="#B22222">M*/</font>
<a name="line490">490: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetReal.html#PetscObjectComposedDataSetReal">PetscObjectComposedDataSetReal</A>(obj,id,data)                                       \</font></strong>
<a name="line491">491: </a><strong><font color="#228B22">  ((((obj)-&gt;real_idmax &lt; globalmaxstate) ? PetscObjectComposedDataIncreaseReal(obj) : 0), \</font></strong>
<a name="line492">492: </a><strong><font color="#228B22">   (obj)-&gt;realcomposeddata[id] = data,(obj)-&gt;realcomposedstate[id] = (obj)-&gt;state, 0)</font></strong>

<a name="line494">494: </a><font color="#B22222">/*MC</font>
<a name="line495">495: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetReal.html#PetscObjectComposedDataGetReal">PetscObjectComposedDataGetReal</A> - retrieve real data attached to an object</font>

<a name="line497">497: </a><font color="#B22222">   Synopsis:</font>
<a name="line498">498: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetReal.html#PetscObjectComposedDataGetReal">PetscObjectComposedDataGetReal</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> data,<A href="../../docs/manualpages/Sys/PetscTruth.html#PetscTruth">PetscTruth</A> flag)</font>

<a name="line500">500: </a><font color="#B22222">   Not collective</font>

<a name="line502">502: </a><font color="#B22222">   Input parameters:</font>
<a name="line503">503: </a><font color="#B22222">+  obj - the object from which data is to be retrieved</font>
<a name="line504">504: </a><font color="#B22222">-  id - the identifier for the data</font>

<a name="line506">506: </a><font color="#B22222">   Output parameters</font>
<a name="line507">507: </a><font color="#B22222">+  data - the data to be retrieved</font>
<a name="line508">508: </a><font color="#B22222">-  flag - <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> if the data item exists and is valid, <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> otherwise</font>

<a name="line510">510: </a><font color="#B22222">   The 'data' and 'flag' variables are inlined, so they are not pointers.</font>

<a name="line512">512: </a><font color="#B22222">   Level: developer</font>
<a name="line513">513: </a><font color="#B22222">M*/</font>
<a name="line514">514: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetReal.html#PetscObjectComposedDataGetReal">PetscObjectComposedDataGetReal</A>(obj,id,data,flag)                            \</font></strong>
<a name="line515">515: </a><strong><font color="#228B22">  ((((obj)-&gt;realcomposedstate &amp;&amp; ((obj)-&gt;realcomposedstate[id] == (obj)-&gt;state)) ?  \</font></strong>
<a name="line516">516: </a><strong><font color="#228B22">   (data = (obj)-&gt;realcomposeddata[id],flag = <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A>) : (flag = <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A>)),0)</font></strong>

<a name="line518">518: </a><font color="#B22222">/*MC</font>
<a name="line519">519: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetRealstar.html#PetscObjectComposedDataSetRealstar">PetscObjectComposedDataSetRealstar</A> - attach real array data to a <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A></font>

<a name="line521">521: </a><font color="#B22222">   Synopsis:</font>
<a name="line522">522: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetRealstar.html#PetscObjectComposedDataSetRealstar">PetscObjectComposedDataSetRealstar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> *data)</font>

<a name="line524">524: </a><font color="#B22222">   Not collective</font>

<a name="line526">526: </a><font color="#B22222">   Input parameters:</font>
<a name="line527">527: </a><font color="#B22222">+  obj - the object to which data is to be attached</font>
<a name="line528">528: </a><font color="#B22222">.  id - the identifier for the data</font>
<a name="line529">529: </a><font color="#B22222">-  data - the data to  be attached</font>

<a name="line531">531: </a><font color="#B22222">   Notes</font>
<a name="line532">532: </a><font color="#B22222">   The data identifier can best be determined through a call to</font>
<a name="line533">533: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataRegister.html#PetscObjectComposedDataRegister">PetscObjectComposedDataRegister</A>()</font>

<a name="line535">535: </a><font color="#B22222">   Level: developer</font>
<a name="line536">536: </a><font color="#B22222">M*/</font>
<a name="line537">537: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetRealstar.html#PetscObjectComposedDataSetRealstar">PetscObjectComposedDataSetRealstar</A>(obj,id,data)                                           \</font></strong>
<a name="line538">538: </a><strong><font color="#228B22">  ((((obj)-&gt;realstar_idmax &lt; globalmaxstate) ? PetscObjectComposedDataIncreaseRealstar(obj) : 0), \</font></strong>
<a name="line539">539: </a><strong><font color="#228B22">  (obj)-&gt;realstarcomposeddata[id] = data, (obj)-&gt;realstarcomposedstate[id] = (obj)-&gt;state, 0)</font></strong>

<a name="line541">541: </a><font color="#B22222">/*MC</font>
<a name="line542">542: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetRealstar.html#PetscObjectComposedDataGetRealstar">PetscObjectComposedDataGetRealstar</A> - retrieve real array data</font>
<a name="line543">543: </a><font color="#B22222">   attached to an object</font>

<a name="line545">545: </a><font color="#B22222">   Synopsis:</font>
<a name="line546">546: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetRealstar.html#PetscObjectComposedDataGetRealstar">PetscObjectComposedDataGetRealstar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> *data,<A href="../../docs/manualpages/Sys/PetscTruth.html#PetscTruth">PetscTruth</A> flag)</font>

<a name="line548">548: </a><font color="#B22222">   Not collective</font>

<a name="line550">550: </a><font color="#B22222">   Input parameters:</font>
<a name="line551">551: </a><font color="#B22222">+  obj - the object from which data is to be retrieved</font>
<a name="line552">552: </a><font color="#B22222">-  id - the identifier for the data</font>

<a name="line554">554: </a><font color="#B22222">   Output parameters</font>
<a name="line555">555: </a><font color="#B22222">+  data - the data to be retrieved</font>
<a name="line556">556: </a><font color="#B22222">-  flag - <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> if the data item exists and is valid, <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> otherwise</font>

<a name="line558">558: </a><font color="#B22222">   The 'data' and 'flag' variables are inlined, so they are not pointers.</font>

<a name="line560">560: </a><font color="#B22222">   Level: developer</font>
<a name="line561">561: </a><font color="#B22222">M*/</font>
<a name="line562">562: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetRealstar.html#PetscObjectComposedDataGetRealstar">PetscObjectComposedDataGetRealstar</A>(obj,id,data,flag)                                \</font></strong>
<a name="line563">563: </a><strong><font color="#228B22">  ((((obj)-&gt;realstarcomposedstate &amp;&amp; ((obj)-&gt;realstarcomposedstate[id] == (obj)-&gt;state)) ?  \</font></strong>
<a name="line564">564: </a><strong><font color="#228B22">   (data = (obj)-&gt;realstarcomposeddata[id],flag = <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A>) : (flag = <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A>)),0)</font></strong>

<a name="line566">566: </a><font color="#B22222">/*MC</font>
<a name="line567">567: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalar.html#PetscObjectComposedDataSetScalar">PetscObjectComposedDataSetScalar</A> - attach scalar data to a <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A></font>

<a name="line569">569: </a><font color="#B22222">   Synopsis:</font>
<a name="line570">570: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalar.html#PetscObjectComposedDataSetScalar">PetscObjectComposedDataSetScalar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscScalar.html#PetscScalar">PetscScalar</A> data)</font>

<a name="line572">572: </a><font color="#B22222">   Not collective</font>

<a name="line574">574: </a><font color="#B22222">   Input parameters:</font>
<a name="line575">575: </a><font color="#B22222">+  obj - the object to which data is to be attached</font>
<a name="line576">576: </a><font color="#B22222">.  id - the identifier for the data</font>
<a name="line577">577: </a><font color="#B22222">-  data - the data to  be attached</font>

<a name="line579">579: </a><font color="#B22222">   Notes</font>
<a name="line580">580: </a><font color="#B22222">   The data identifier can best be determined through a call to</font>
<a name="line581">581: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataRegister.html#PetscObjectComposedDataRegister">PetscObjectComposedDataRegister</A>()</font>

<a name="line583">583: </a><font color="#B22222">   Level: developer</font>
<a name="line584">584: </a><font color="#B22222">M*/</font>
<a name="line585">585: </a><font color="#A020F0">#if defined(PETSC_USE_COMPLEX)</font>
<a name="line586">586: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalar.html#PetscObjectComposedDataSetScalar">PetscObjectComposedDataSetScalar</A>(obj,id,data)                                        \</font></strong>
<a name="line587">587: </a><strong><font color="#228B22">  ((((obj)-&gt;scalar_idmax &lt; globalmaxstate) ? PetscObjectComposedDataIncreaseScalar(obj) : 0) \</font></strong>
<a name="line588">588: </a><strong><font color="#228B22">  (obj)-&gt;scalarcomposeddata[id] = data,(obj)-&gt;scalarcomposedstate[id] = (obj)-&gt;state, 0)</font></strong>
<a name="line589">589: </a><font color="#A020F0">#else</font>
<a name="line590">590: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalar.html#PetscObjectComposedDataSetScalar">PetscObjectComposedDataSetScalar</A>(obj,id,data) \</font></strong>
<a name="line591">591: </a><strong><font color="#228B22">        <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetReal.html#PetscObjectComposedDataSetReal">PetscObjectComposedDataSetReal</A>(obj,id,data)</font></strong>
<a name="line592">592: </a><font color="#A020F0">#endif</font>
<a name="line593">593: </a><font color="#B22222">/*MC</font>
<a name="line594">594: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalar.html#PetscObjectComposedDataGetScalar">PetscObjectComposedDataGetScalar</A> - retrieve scalar data attached to an object</font>

<a name="line596">596: </a><font color="#B22222">   Synopsis:</font>
<a name="line597">597: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalar.html#PetscObjectComposedDataGetScalar">PetscObjectComposedDataGetScalar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscScalar.html#PetscScalar">PetscScalar</A> data,<A href="../../docs/manualpages/Sys/PetscTruth.html#PetscTruth">PetscTruth</A> flag)</font>

<a name="line599">599: </a><font color="#B22222">   Not collective</font>

<a name="line601">601: </a><font color="#B22222">   Input parameters:</font>
<a name="line602">602: </a><font color="#B22222">+  obj - the object from which data is to be retrieved</font>
<a name="line603">603: </a><font color="#B22222">-  id - the identifier for the data</font>

<a name="line605">605: </a><font color="#B22222">   Output parameters</font>
<a name="line606">606: </a><font color="#B22222">+  data - the data to be retrieved</font>
<a name="line607">607: </a><font color="#B22222">-  flag - <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> if the data item exists and is valid, <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> otherwise</font>

<a name="line609">609: </a><font color="#B22222">   The 'data' and 'flag' variables are inlined, so they are not pointers.</font>

<a name="line611">611: </a><font color="#B22222">   Level: developer</font>
<a name="line612">612: </a><font color="#B22222">M*/</font>
<a name="line613">613: </a><font color="#A020F0">#if defined(PETSC_USE_COMPLEX)</font>
<a name="line614">614: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalar.html#PetscObjectComposedDataGetScalar">PetscObjectComposedDataGetScalar</A>(obj,id,data,flag)                              \</font></strong>
<a name="line615">615: </a><strong><font color="#228B22">  ((((obj)-&gt;scalarcomposedstate &amp;&amp; ((obj)-&gt;scalarcomposedstate[id] == (obj)-&gt;state) ) ? \</font></strong>
<a name="line616">616: </a><strong><font color="#228B22">   (data = (obj)-&gt;scalarcomposeddata[id],flag = <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A>) : (flag = <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A>)),0)</font></strong>
<a name="line617">617: </a><font color="#A020F0">#else</font>
<a name="line618">618: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalar.html#PetscObjectComposedDataGetScalar">PetscObjectComposedDataGetScalar</A>(obj,id,data,flag)                             \</font></strong>
<a name="line619">619: </a><strong><font color="#228B22">        <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetReal.html#PetscObjectComposedDataGetReal">PetscObjectComposedDataGetReal</A>(obj,id,data,flag)</font></strong>
<a name="line620">620: </a><font color="#A020F0">#endif</font>

<a name="line622">622: </a><font color="#B22222">/*MC</font>
<a name="line623">623: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalarstar.html#PetscObjectComposedDataSetScalarstar">PetscObjectComposedDataSetScalarstar</A> - attach scalar array data to a <A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> </font>

<a name="line625">625: </a><font color="#B22222">   Synopsis:</font>
<a name="line626">626: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalarstar.html#PetscObjectComposedDataSetScalarstar">PetscObjectComposedDataSetScalarstar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscScalar.html#PetscScalar">PetscScalar</A> *data)</font>

<a name="line628">628: </a><font color="#B22222">   Not collective</font>

<a name="line630">630: </a><font color="#B22222">   Input parameters:</font>
<a name="line631">631: </a><font color="#B22222">+  obj - the object to which data is to be attached</font>
<a name="line632">632: </a><font color="#B22222">.  id - the identifier for the data</font>
<a name="line633">633: </a><font color="#B22222">-  data - the data to  be attached</font>

<a name="line635">635: </a><font color="#B22222">   Notes</font>
<a name="line636">636: </a><font color="#B22222">   The data identifier can best be determined through a call to</font>
<a name="line637">637: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataRegister.html#PetscObjectComposedDataRegister">PetscObjectComposedDataRegister</A>()</font>

<a name="line639">639: </a><font color="#B22222">   Level: developer</font>
<a name="line640">640: </a><font color="#B22222">M*/</font>
<a name="line641">641: </a><font color="#A020F0">#if defined(PETSC_USE_COMPLEX)</font>
<a name="line642">642: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalarstar.html#PetscObjectComposedDataSetScalarstar">PetscObjectComposedDataSetScalarstar</A>(obj,id,data)                                             \</font></strong>
<a name="line643">643: </a><strong><font color="#228B22">  ((((obj)-&gt;scalarstar_idmax &lt; globalmaxstate) ? PetscObjectComposedDataIncreaseScalarstar(obj) : 0), \</font></strong>
<a name="line644">644: </a><strong><font color="#228B22">   (obj)-&gt;scalarstarcomposeddata[id] = data,(obj)-&gt;scalarstarcomposedstate[id] = (obj)-&gt;state, 0)</font></strong>
<a name="line645">645: </a><font color="#A020F0">#else</font>
<a name="line646">646: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetScalarstar.html#PetscObjectComposedDataSetScalarstar">PetscObjectComposedDataSetScalarstar</A>(obj,id,data) \</font></strong>
<a name="line647">647: </a><strong><font color="#228B22">        <A href="../../docs/manualpages/Sys/PetscObjectComposedDataSetRealstar.html#PetscObjectComposedDataSetRealstar">PetscObjectComposedDataSetRealstar</A>(obj,id,data)</font></strong>
<a name="line648">648: </a><font color="#A020F0">#endif</font>
<a name="line649">649: </a><font color="#B22222">/*MC</font>
<a name="line650">650: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalarstar.html#PetscObjectComposedDataGetScalarstar">PetscObjectComposedDataGetScalarstar</A> - retrieve scalar array data</font>
<a name="line651">651: </a><font color="#B22222">   attached to an object</font>

<a name="line653">653: </a><font color="#B22222">   Synopsis:</font>
<a name="line654">654: </a><font color="#B22222">   <A href="../../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalarstar.html#PetscObjectComposedDataGetScalarstar">PetscObjectComposedDataGetScalarstar</A>(<A href="../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A> obj,int id,<A href="../../docs/manualpages/Sys/PetscScalar.html#PetscScalar">PetscScalar</A> *data,<A href="../../docs/manualpages/Sys/PetscTruth.html#PetscTruth">PetscTruth</A> flag)</font>

<a name="line656">656: </a><font color="#B22222">   Not collective</font>

<a name="line658">658: </a><font color="#B22222">   Input parameters:</font>
<a name="line659">659: </a><font color="#B22222">+  obj - the object from which data is to be retrieved</font>
<a name="line660">660: </a><font color="#B22222">-  id - the identifier for the data</font>

<a name="line662">662: </a><font color="#B22222">   Output parameters</font>
<a name="line663">663: </a><font color="#B22222">+  data - the data to be retrieved</font>
<a name="line664">664: </a><font color="#B22222">-  flag - <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> if the data item exists and is valid, <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> otherwise</font>

<a name="line666">666: </a><font color="#B22222">   The 'data' and 'flag' variables are inlined, so they are not pointers.</font>

<a name="line668">668: </a><font color="#B22222">   Level: developer</font>
<a name="line669">669: </a><font color="#B22222">M*/</font>
<a name="line670">670: </a><font color="#A020F0">#if defined(PETSC_USE_COMPLEX)</font>
<a name="line671">671: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalarstar.html#PetscObjectComposedDataGetScalarstar">PetscObjectComposedDataGetScalarstar</A>(obj,id,data,flag)                                 \</font></strong>
<a name="line672">672: </a><strong><font color="#228B22">  ((((obj)-&gt;scalarstarcomposedstate &amp;&amp; ((obj)-&gt;scalarstarcomposedstate[id] == (obj)-&gt;state)) ? \</font></strong>
<a name="line673">673: </a><strong><font color="#228B22">       (data = (obj)-&gt;scalarstarcomposeddata[id],flag = <A href="../../docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A>) : (flag = <A href="../../docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A>)),0)</font></strong>
<a name="line674">674: </a><font color="#A020F0">#else</font>
<a name="line675">675: </a><strong><font color="#228B22">#define <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetScalarstar.html#PetscObjectComposedDataGetScalarstar">PetscObjectComposedDataGetScalarstar</A>(obj,id,data,flag)                 \</font></strong>
<a name="line676">676: </a><strong><font color="#228B22">        <A href="../../docs/manualpages/Sys/PetscObjectComposedDataGetRealstar.html#PetscObjectComposedDataGetRealstar">PetscObjectComposedDataGetRealstar</A>(obj,id,data,flag)</font></strong>
<a name="line677">677: </a><font color="#A020F0">#endif</font>

<a name="line679">679: </a><font color="#B22222">/* some vars for logging */</font>


<a name="line687">687: </a><font color="#B22222">/*</font>
<a name="line688">688: </a><font color="#B22222">  PETSc communicators have this attribute, see</font>
<a name="line689">689: </a><font color="#B22222">  <A href="../../docs/manualpages/Sys/PetscCommDuplicate.html#PetscCommDuplicate">PetscCommDuplicate</A>(), <A href="../../docs/manualpages/Sys/PetscCommDestroy.html#PetscCommDestroy">PetscCommDestroy</A>(), <A href="../../docs/manualpages/Sys/PetscCommGetNewTag.html#PetscCommGetNewTag">PetscCommGetNewTag</A>(), <A href="../../docs/manualpages/Sys/PetscObjectGetName.html#PetscObjectGetName">PetscObjectGetName</A>()</font>
<a name="line690">690: </a><font color="#B22222">*/</font>
<a name="line691">691: </a><font color="#4169E1">typedef</font> <font color="#4169E1">struct</font> {
<a name="line692">692: </a>  <A href="../../docs/manualpages/Sys/PetscMPIInt.html#PetscMPIInt">PetscMPIInt</A> tag;              <font color="#B22222">/* next free tag value */</font>
<a name="line693">693: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>    refcount;         <font color="#B22222">/* number of references, communicator can be freed when this reaches 0 */</font>
<a name="line694">694: </a>  <A href="../../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>    namecount;        <font color="#B22222">/* used to generate the next name, as in Vec_0, Mat_1, ... */</font>
<a name="line695">695: </a>} PetscCommCounter;


<a name="line699">699: </a><font color="#A020F0">#endif </font><font color="#B22222">/* _PETSCHEAD_H */</font><font color="#A020F0"></font>
</pre>
</body>

</html>