xref: /petsc/src/sys/objects/inherit.c (revision 76af4d96c0b2fd8548bae8feccfd481c41091993)
1 #define PETSC_DLL
2 /*
3      Provides utility routines for manipulating any type of PETSc object.
4 */
5 #include "petscsys.h"  /*I   "petscsys.h"    I*/
6 
7 EXTERN PetscErrorCode PetscObjectGetComm_Petsc(PetscObject,MPI_Comm *);
8 EXTERN PetscErrorCode PetscObjectCompose_Petsc(PetscObject,const char[],PetscObject);
9 EXTERN PetscErrorCode PetscObjectQuery_Petsc(PetscObject,const char[],PetscObject *);
10 EXTERN PetscErrorCode PetscObjectComposeFunction_Petsc(PetscObject,const char[],const char[],void (*)(void));
11 EXTERN PetscErrorCode PetscObjectQueryFunction_Petsc(PetscObject,const char[],void (**)(void));
12 
13 #undef __FUNCT__
14 #define __FUNCT__ "PetscHeaderCreate_Private"
15 /*
16    PetscHeaderCreate_Private - Creates a base PETSc object header and fills
17    in the default values.  Called by the macro PetscHeaderCreate().
18 */
19 PetscErrorCode PETSCSYS_DLLEXPORT PetscHeaderCreate_Private(PetscObject h,PetscClassId classid,PetscInt type,const char class_name[],MPI_Comm comm,
20                                          PetscErrorCode (*des)(PetscObject),PetscErrorCode (*vie)(PetscObject,PetscViewer))
21 {
22   static PetscInt idcnt = 1;
23   PetscErrorCode  ierr;
24 
25   PetscFunctionBegin;
26   h->classid                = classid;
27   h->type                   = type;
28   h->class_name             = (char*)class_name;
29   h->prefix                 = 0;
30   h->refct                  = 1;
31   h->amem                   = -1;
32   h->id                     = idcnt++;
33   h->parentid               = 0;
34   h->qlist                  = 0;
35   h->olist                  = 0;
36   h->bops->destroy          = des;
37   h->bops->view             = vie;
38   h->bops->getcomm          = PetscObjectGetComm_Petsc;
39   h->bops->compose          = PetscObjectCompose_Petsc;
40   h->bops->query            = PetscObjectQuery_Petsc;
41   h->bops->composefunction  = PetscObjectComposeFunction_Petsc;
42   h->bops->queryfunction    = PetscObjectQueryFunction_Petsc;
43   ierr = PetscCommDuplicate(comm,&h->comm,&h->tag);CHKERRQ(ierr);
44   PetscFunctionReturn(0);
45 }
46 
47 extern PetscTruth     PetscMemoryCollectMaximumUsage;
48 extern PetscLogDouble PetscMemoryMaximumUsage;
49 
50 #undef __FUNCT__
51 #define __FUNCT__ "PetscHeaderDestroy_Private"
52 /*
53     PetscHeaderDestroy_Private - Destroys a base PETSc object header. Called by
54     the macro PetscHeaderDestroy().
55 */
56 PetscErrorCode PETSCSYS_DLLEXPORT PetscHeaderDestroy_Private(PetscObject h)
57 {
58   PetscErrorCode ierr;
59 
60   PetscFunctionBegin;
61 #if defined(PETSC_HAVE_AMS)
62 
63 #endif
64   if (PetscMemoryCollectMaximumUsage) {
65     PetscLogDouble usage;
66     ierr = PetscMemoryGetCurrentUsage(&usage);CHKERRQ(ierr);
67     if (usage > PetscMemoryMaximumUsage) PetscMemoryMaximumUsage = usage;
68   }
69   /* first destroy things that could execute arbitrary code */
70   if (h->python_destroy) {
71     void           *python_context          = h->python_context;
72     PetscErrorCode (*python_destroy)(void*) = h->python_destroy;
73     h->python_context = 0;
74     h->python_destroy = 0;
75     ierr = (*python_destroy)(python_context);CHKERRQ(ierr);
76   }
77   ierr = PetscOListDestroy(h->olist);CHKERRQ(ierr);
78   ierr = PetscCommDestroy(&h->comm);CHKERRQ(ierr);
79   /* next destroy other things */
80   h->classid = PETSCFREEDHEADER;
81   ierr = PetscFree(h->bops);CHKERRQ(ierr);
82   ierr = PetscFListDestroy(&h->qlist);CHKERRQ(ierr);
83   ierr = PetscFree(h->type_name);CHKERRQ(ierr);
84   ierr = PetscFree(h->name);CHKERRQ(ierr);
85   ierr = PetscFree(h->prefix);CHKERRQ(ierr);
86   ierr = PetscFree(h->fortran_func_pointers);CHKERRQ(ierr);
87   ierr = PetscFree(h->intcomposeddata);CHKERRQ(ierr);
88   ierr = PetscFree(h->intcomposedstate);CHKERRQ(ierr);
89   ierr = PetscFree(h->realcomposeddata);CHKERRQ(ierr);
90   ierr = PetscFree(h->realcomposedstate);CHKERRQ(ierr);
91   ierr = PetscFree(h->scalarcomposeddata);CHKERRQ(ierr);
92   ierr = PetscFree(h->scalarcomposedstate);CHKERRQ(ierr);
93   PetscFunctionReturn(0);
94 }
95 
96 #undef __FUNCT__
97 #define __FUNCT__ "PetscObjectAddOptionsHandler"
98 /*@C
99     PetscObjectAddOptionsHandler - Adds an additional function to check for options when XXXSetFromOptions() is called.
100 
101     Not Collective
102 
103     Input Parameter:
104 +   obj - the PETSc object
105 .   handle - function that checks for options
106 .   destroy - function to destroy context if provided
107 -   ctx - optional context for check function
108 
109     Level: developer
110 
111 
112 .seealso: KSPSetFromOptions(), PCSetFromOptions(), SNESSetFromOptions(), PetscObjectProcessOptionsHandlers(), PetscObjectDestroyOptionsHandlers()
113 
114 @*/
115 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectAddOptionsHandler(PetscObject obj,PetscErrorCode (*handle)(PetscObject,void*),PetscErrorCode (*destroy)(PetscObject,void*),void *ctx)
116 {
117   PetscFunctionBegin;
118   if (obj->noptionhandler >= PETSC_MAX_OPTIONS_HANDLER) SETERRQ(obj->comm,PETSC_ERR_ARG_OUTOFRANGE,"To many options handlers added");
119   obj->optionhandler[obj->noptionhandler]   = handle;
120   obj->optiondestroy[obj->noptionhandler]   = destroy;
121   obj->optionctx[obj->noptionhandler++]     = ctx;
122   PetscFunctionReturn(0);
123 }
124 
125 #undef __FUNCT__
126 #define __FUNCT__ "PetscObjectProcessOptionsHandlers"
127 /*@C
128     PetscObjectProcessOptionsHandlers - Calls all the options handler attached to an object
129 
130     Not Collective
131 
132     Input Parameter:
133 .   obj - the PETSc object
134 
135     Level: developer
136 
137 
138 .seealso: KSPSetFromOptions(), PCSetFromOptions(), SNESSetFromOptions(), PetscObjectAddOptionsHandler(), PetscObjectDestroyOptionsHandlers()
139 
140 @*/
141 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectProcessOptionsHandlers(PetscObject obj)
142 {
143   PetscInt       i;
144   PetscErrorCode ierr;
145 
146   PetscFunctionBegin;
147   for (i=0; i<obj->noptionhandler; i++) {
148     ierr = (*obj->optionhandler[i])(obj,obj->optionctx[i]);CHKERRQ(ierr);
149   }
150   PetscFunctionReturn(0);
151 }
152 
153 #undef __FUNCT__
154 #define __FUNCT__ "PetscObjectDestroyOptionsHandlers"
155 /*@C
156     PetscObjectDestroyOptionsHandlers - Destroys all the option handlers attached to an objeft
157 
158     Not Collective
159 
160     Input Parameter:
161 .   obj - the PETSc object
162 
163     Level: developer
164 
165 
166 .seealso: KSPSetFromOptions(), PCSetFromOptions(), SNESSetFromOptions(), PetscObjectAddOptionsHandler(), PetscObjectProcessOptionsHandlers()
167 
168 @*/
169 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectDestroyOptionsHandlers(PetscObject obj)
170 {
171   PetscInt       i;
172   PetscErrorCode ierr;
173 
174   PetscFunctionBegin;
175   for (i=0; i<obj->noptionhandler; i++) {
176     ierr = (*obj->optiondestroy[i])(obj,obj->optionctx[i]);CHKERRQ(ierr);
177   }
178   obj->noptionhandler = 0;
179   PetscFunctionReturn(0);
180 }
181 
182 
183 #undef __FUNCT__
184 #define __FUNCT__ "PetscObjectReference"
185 /*@
186    PetscObjectReference - Indicates to any PetscObject that it is being
187    referenced by another PetscObject. This increases the reference
188    count for that object by one.
189 
190    Logically Collective on PetscObject
191 
192    Input Parameter:
193 .  obj - the PETSc object. This must be cast with (PetscObject), for example,
194          PetscObjectReference((PetscObject)mat);
195 
196    Level: advanced
197 
198 .seealso: PetscObjectCompose(), PetscObjectDereference()
199 @*/
200 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectReference(PetscObject obj)
201 {
202   PetscFunctionBegin;
203   PetscValidHeader(obj,1);
204   obj->refct++;
205   PetscFunctionReturn(0);
206 }
207 
208 #undef __FUNCT__
209 #define __FUNCT__ "PetscObjectGetReference"
210 /*@
211    PetscObjectGetReference - Gets the current reference count for
212    any PETSc object.
213 
214    Not Collective
215 
216    Input Parameter:
217 .  obj - the PETSc object; this must be cast with (PetscObject), for example,
218          PetscObjectGetReference((PetscObject)mat,&cnt);
219 
220    Output Parameter:
221 .  cnt - the reference count
222 
223    Level: advanced
224 
225 .seealso: PetscObjectCompose(), PetscObjectDereference(), PetscObjectReference()
226 @*/
227 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectGetReference(PetscObject obj,PetscInt *cnt)
228 {
229   PetscFunctionBegin;
230   PetscValidHeader(obj,1);
231   PetscValidIntPointer(cnt,2);
232   *cnt = obj->refct;
233   PetscFunctionReturn(0);
234 }
235 
236 #undef __FUNCT__
237 #define __FUNCT__ "PetscObjectDereference"
238 /*@
239    PetscObjectDereference - Indicates to any PetscObject that it is being
240    referenced by one less PetscObject. This decreases the reference
241    count for that object by one.
242 
243    Collective on PetscObject if reference reaches 0 otherwise Logically Collective
244 
245    Input Parameter:
246 .  obj - the PETSc object; this must be cast with (PetscObject), for example,
247          PetscObjectDereference((PetscObject)mat);
248 
249    Level: advanced
250 
251 .seealso: PetscObjectCompose(), PetscObjectReference()
252 @*/
253 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectDereference(PetscObject obj)
254 {
255   PetscErrorCode ierr;
256 
257   PetscFunctionBegin;
258   PetscValidHeader(obj,1);
259   if (obj->bops->destroy) {
260     ierr = (*obj->bops->destroy)(obj);CHKERRQ(ierr);
261   } else if (!--obj->refct) {
262     SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"This PETSc object does not have a generic destroy routine");
263   }
264   PetscFunctionReturn(0);
265 }
266 
267 /* ----------------------------------------------------------------------- */
268 /*
269      The following routines are the versions private to the PETSc object
270      data structures.
271 */
272 #undef __FUNCT__
273 #define __FUNCT__ "PetscObjectGetComm_Petsc"
274 PetscErrorCode PetscObjectGetComm_Petsc(PetscObject obj,MPI_Comm *comm)
275 {
276   PetscFunctionBegin;
277   *comm = obj->comm;
278   PetscFunctionReturn(0);
279 }
280 
281 #undef __FUNCT__
282 #define __FUNCT__ "PetscObjectCompose_Petsc"
283 PetscErrorCode PetscObjectCompose_Petsc(PetscObject obj,const char name[],PetscObject ptr)
284 {
285   PetscErrorCode ierr;
286   char           *tname;
287 
288   PetscFunctionBegin;
289   if (ptr) {
290     ierr = PetscOListReverseFind(ptr->olist,obj,&tname);CHKERRQ(ierr);
291     if (tname) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_INCOMP,"An object cannot be composed with an object that was compose with it");
292   }
293   ierr = PetscOListAdd(&obj->olist,name,ptr);CHKERRQ(ierr);
294   PetscFunctionReturn(0);
295 }
296 
297 #undef __FUNCT__
298 #define __FUNCT__ "PetscObjectQuery_Petsc"
299 PetscErrorCode PetscObjectQuery_Petsc(PetscObject obj,const char name[],PetscObject *ptr)
300 {
301   PetscErrorCode ierr;
302 
303   PetscFunctionBegin;
304   ierr = PetscOListFind(obj->olist,name,ptr);CHKERRQ(ierr);
305   PetscFunctionReturn(0);
306 }
307 
308 #undef __FUNCT__
309 #define __FUNCT__ "PetscObjectComposeFunction_Petsc"
310 PetscErrorCode PetscObjectComposeFunction_Petsc(PetscObject obj,const char name[],const char fname[],void (*ptr)(void))
311 {
312   PetscErrorCode ierr;
313 
314   PetscFunctionBegin;
315   ierr = PetscFListAdd(&obj->qlist,name,fname,ptr);CHKERRQ(ierr);
316   PetscFunctionReturn(0);
317 }
318 
319 #undef __FUNCT__
320 #define __FUNCT__ "PetscObjectQueryFunction_Petsc"
321 PetscErrorCode PetscObjectQueryFunction_Petsc(PetscObject obj,const char name[],void (**ptr)(void))
322 {
323   PetscErrorCode ierr;
324 
325   PetscFunctionBegin;
326   ierr = PetscFListFind(obj->qlist,obj->comm,name,ptr);CHKERRQ(ierr);
327   PetscFunctionReturn(0);
328 }
329 
330 /*
331         These are the versions that are usable to any CCA compliant objects
332 */
333 #undef __FUNCT__
334 #define __FUNCT__ "PetscObjectCompose"
335 /*@C
336    PetscObjectCompose - Associates another PETSc object with a given PETSc object.
337 
338    Not Collective
339 
340    Input Parameters:
341 +  obj - the PETSc object; this must be cast with (PetscObject), for example,
342          PetscObjectCompose((PetscObject)mat,...);
343 .  name - name associated with the child object
344 -  ptr - the other PETSc object to associate with the PETSc object; this must also be
345          cast with (PetscObject)
346 
347    Level: advanced
348 
349    Notes:
350    The second objects reference count is automatically increased by one when it is
351    composed.
352 
353    Replaces any previous object that had the same name.
354 
355    If ptr is null and name has previously been composed using an object, then that
356    entry is removed from the obj.
357 
358    PetscObjectCompose() can be used with any PETSc object (such as
359    Mat, Vec, KSP, SNES, etc.) or any user-provided object.  See
360    PetscContainerCreate() for info on how to create an object from a
361    user-provided pointer that may then be composed with PETSc objects.
362 
363    Concepts: objects^composing
364    Concepts: composing objects
365 
366 .seealso: PetscObjectQuery(), PetscContainerCreate()
367 @*/
368 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectCompose(PetscObject obj,const char name[],PetscObject ptr)
369 {
370   PetscErrorCode ierr;
371 
372   PetscFunctionBegin;
373   PetscValidHeader(obj,1);
374   PetscValidCharPointer(name,2);
375   if (ptr) PetscValidHeader(ptr,3);
376   ierr = (*obj->bops->compose)(obj,name,ptr);CHKERRQ(ierr);
377   PetscFunctionReturn(0);
378 }
379 
380 
381 
382 #undef __FUNCT__
383 #define __FUNCT__ "PetscObjectQuery"
384 /*@C
385    PetscObjectQuery  - Gets a PETSc object associated with a given object.
386 
387    Not Collective
388 
389    Input Parameters:
390 +  obj - the PETSc object
391          Thus must be cast with a (PetscObject), for example,
392          PetscObjectCompose((PetscObject)mat,...);
393 .  name - name associated with child object
394 -  ptr - the other PETSc object associated with the PETSc object, this must also be
395          cast with (PetscObject)
396 
397    Level: advanced
398 
399    Concepts: objects^composing
400    Concepts: composing objects
401    Concepts: objects^querying
402    Concepts: querying objects
403 
404 .seealso: PetscObjectQuery()
405 @*/
406 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectQuery(PetscObject obj,const char name[],PetscObject *ptr)
407 {
408   PetscErrorCode ierr;
409 
410   PetscFunctionBegin;
411   PetscValidHeader(obj,1);
412   PetscValidCharPointer(name,2);
413   PetscValidPointer(ptr,3);
414   ierr = (*obj->bops->query)(obj,name,ptr);CHKERRQ(ierr);
415   PetscFunctionReturn(0);
416 }
417 
418 #undef __FUNCT__
419 #define __FUNCT__ "PetscObjectComposeFunction"
420 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectComposeFunction(PetscObject obj,const char name[],const char fname[],void (*ptr)(void))
421 {
422   PetscErrorCode ierr;
423 
424   PetscFunctionBegin;
425   PetscValidHeader(obj,1);
426   PetscValidCharPointer(name,2);
427   PetscValidCharPointer(fname,2);
428   ierr = (*obj->bops->composefunction)(obj,name,fname,ptr);CHKERRQ(ierr);
429   PetscFunctionReturn(0);
430 }
431 
432 #undef __FUNCT__
433 #define __FUNCT__ "PetscObjectQueryFunction"
434 /*@C
435    PetscObjectQueryFunction - Gets a function associated with a given object.
436 
437    Logically Collective on PetscObject
438 
439    Input Parameters:
440 +  obj - the PETSc object; this must be cast with (PetscObject), for example,
441          PetscObjectQueryFunction((PetscObject)ksp,...);
442 -  name - name associated with the child function
443 
444    Output Parameter:
445 .  ptr - function pointer
446 
447    Level: advanced
448 
449    Concepts: objects^composing functions
450    Concepts: composing functions
451    Concepts: functions^querying
452    Concepts: objects^querying
453    Concepts: querying objects
454 
455 .seealso: PetscObjectComposeFunctionDynamic()
456 @*/
457 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectQueryFunction(PetscObject obj,const char name[],void (**ptr)(void))
458 {
459   PetscErrorCode ierr;
460 
461   PetscFunctionBegin;
462   PetscValidHeader(obj,1);
463   PetscValidCharPointer(name,2);
464   ierr = (*obj->bops->queryfunction)(obj,name,ptr);CHKERRQ(ierr);
465   PetscFunctionReturn(0);
466 }
467 
468 struct _p_PetscContainer {
469   PETSCHEADER(int);
470   void   *ptr;
471   PetscErrorCode (*userdestroy)(void*);
472 };
473 
474 #undef __FUNCT__
475 #define __FUNCT__ "PetscContainerGetPointer"
476 /*@C
477    PetscContainerGetPointer - Gets the pointer value contained in the container.
478 
479    Not Collective
480 
481    Input Parameter:
482 .  obj - the object created with PetscContainerCreate()
483 
484    Output Parameter:
485 .  ptr - the pointer value
486 
487    Level: advanced
488 
489 .seealso: PetscContainerCreate(), PetscContainerDestroy(),
490           PetscContainerSetPointer()
491 @*/
492 PetscErrorCode PETSCSYS_DLLEXPORT PetscContainerGetPointer(PetscContainer obj,void **ptr)
493 {
494   PetscFunctionBegin;
495   PetscValidHeaderSpecific(obj,PETSC_CONTAINER_CLASSID,1);
496   PetscValidPointer(ptr,2);
497   *ptr = obj->ptr;
498   PetscFunctionReturn(0);
499 }
500 
501 
502 #undef __FUNCT__
503 #define __FUNCT__ "PetscContainerSetPointer"
504 /*@C
505    PetscContainerSetPointer - Sets the pointer value contained in the container.
506 
507    Logically Collective on PetscContainer
508 
509    Input Parameters:
510 +  obj - the object created with PetscContainerCreate()
511 -  ptr - the pointer value
512 
513    Level: advanced
514 
515 .seealso: PetscContainerCreate(), PetscContainerDestroy(),
516           PetscContainerGetPointer()
517 @*/
518 PetscErrorCode PETSCSYS_DLLEXPORT PetscContainerSetPointer(PetscContainer obj,void *ptr)
519 {
520   PetscFunctionBegin;
521   PetscValidHeaderSpecific(obj,PETSC_CONTAINER_CLASSID,1);
522   if (ptr) PetscValidPointer(ptr,2);
523   obj->ptr = ptr;
524   PetscFunctionReturn(0);
525 }
526 
527 #undef __FUNCT__
528 #define __FUNCT__ "PetscContainerDestroy"
529 /*@C
530    PetscContainerDestroy - Destroys a PETSc container object.
531 
532    Collective on PetscContainer
533 
534    Input Parameter:
535 .  obj - an object that was created with PetscContainerCreate()
536 
537    Level: advanced
538 
539 .seealso: PetscContainerCreate()
540 @*/
541 PetscErrorCode PETSCSYS_DLLEXPORT PetscContainerDestroy(PetscContainer obj)
542 {
543   PetscErrorCode ierr;
544   PetscFunctionBegin;
545   PetscValidHeaderSpecific(obj,PETSC_CONTAINER_CLASSID,1);
546   if (--((PetscObject)obj)->refct > 0) PetscFunctionReturn(0);
547   if (obj->userdestroy) (*obj->userdestroy)(obj->ptr);
548   ierr = PetscHeaderDestroy(obj);CHKERRQ(ierr);
549   PetscFunctionReturn(0);
550 }
551 
552 #undef __FUNCT__
553 #define __FUNCT__ "PetscContainerSetUserDestroy"
554 /*@C
555    PetscContainerSetUserDestroy - Sets name of the user destroy function.
556 
557    Logically Collective on PetscContainer
558 
559    Input Parameter:
560 +  obj - an object that was created with PetscContainerCreate()
561 -  des - name of the user destroy function
562 
563    Level: advanced
564 
565 .seealso: PetscContainerDestroy()
566 @*/
567 PetscErrorCode PETSCSYS_DLLEXPORT PetscContainerSetUserDestroy(PetscContainer obj, PetscErrorCode (*des)(void*))
568 {
569   PetscFunctionBegin;
570   PetscValidHeaderSpecific(obj,PETSC_CONTAINER_CLASSID,1);
571   obj->userdestroy = des;
572   PetscFunctionReturn(0);
573 }
574 
575 PetscClassId PETSCSYS_DLLEXPORT PETSC_CONTAINER_CLASSID;
576 
577 #undef __FUNCT__
578 #define __FUNCT__ "PetscContainerCreate"
579 /*@C
580    PetscContainerCreate - Creates a PETSc object that has room to hold
581    a single pointer. This allows one to attach any type of data (accessible
582    through a pointer) with the PetscObjectCompose() function to a PetscObject.
583    The data item itself is attached by a call to PetscContainerSetPointer.
584 
585    Collective on MPI_Comm
586 
587    Input Parameters:
588 .  comm - MPI communicator that shares the object
589 
590    Output Parameters:
591 .  container - the container created
592 
593    Level: advanced
594 
595 .seealso: PetscContainerDestroy(), PetscContainerSetPointer(), PetscContainerGetPointer()
596 @*/
597 PetscErrorCode PETSCSYS_DLLEXPORT PetscContainerCreate(MPI_Comm comm,PetscContainer *container)
598 {
599   PetscErrorCode ierr;
600   PetscContainer contain;
601 
602   PetscFunctionBegin;
603   PetscValidPointer(container,2);
604   ierr = PetscHeaderCreate(contain,_p_PetscContainer,PetscInt,PETSC_CONTAINER_CLASSID,0,"PetscContainer",comm,PetscContainerDestroy,0);CHKERRQ(ierr);
605   *container = contain;
606   PetscFunctionReturn(0);
607 }
608 
609 #undef __FUNCT__
610 #define __FUNCT__ "PetscObjectSetFromOptions"
611 /*@
612    PetscObjectSetFromOptions - Sets generic parameters from user options.
613 
614    Collective on obj
615 
616    Input Parameter:
617 .  obj - the PetscObjcet
618 
619    Options Database Keys:
620 
621    Notes:
622    We have no generic options at present, so this does nothing
623 
624    Level: beginner
625 
626 .keywords: set, options, database
627 .seealso: PetscObjectSetOptionsPrefix(), PetscObjectGetOptionsPrefix()
628 @*/
629 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectSetFromOptions(PetscObject obj)
630 {
631   PetscFunctionBegin;
632   PetscValidHeader(obj,1);
633   PetscFunctionReturn(0);
634 }
635 
636 #undef __FUNCT__
637 #define __FUNCT__ "PetscObjectSetUp"
638 /*@
639    PetscObjectSetUp - Sets up the internal data structures for the later use.
640 
641    Collective on PetscObject
642 
643    Input Parameters:
644 .  obj - the PetscObject
645 
646    Notes:
647    This does nothing at present.
648 
649    Level: advanced
650 
651 .keywords: setup
652 .seealso: PetscObjectDestroy()
653 @*/
654 PetscErrorCode PETSCSYS_DLLEXPORT PetscObjectSetUp(PetscObject obj)
655 {
656   PetscFunctionBegin;
657   PetscValidHeader(obj,1);
658   PetscFunctionReturn(0);
659 }
660