How to declare an array of ksp object in fortran?

Barry Smith bsmith at mcs.anl.gov
Mon Dec 7 15:08:45 CST 2009


    In Fortran you need to declare an array that is "big enough", so,  
for example, if you know there are always less then 10 block per  
process you can do

    KSP     subksp(10)

    less than 100 then use

    KSP  subksp(100)

    note that since this is just an array of pointers it takes very  
little space.

    Barry

On Dec 7, 2009, at 2:02 PM, Matthew Knepley wrote:

> I realized you only wanted to know how to declare the array. It is  
> just a normal F77 array.
>
>   Matt
>
> On Mon, Dec 7, 2009 at 2:00 PM, Matthew Knepley <knepley at gmail.com>  
> wrote:
> 1) Always use options. It makes you code generic and process more  
> flexible
>
> 2) If after thinking for a few hours, you still really want to do it  
> in the code:
>
>   http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/PC/PCBJacobiGetSubKSP.html
>
>    Matt
>
> On Mon, Dec 7, 2009 at 11:52 AM, <hxie at umn.edu> wrote:
> Hi,
>
> I try to customize the subksp for block jacobi method. Does anybody  
> have an fortran example for this?
> For c language, we can declare "ksp *subksp". Then how for fortran?  
> Thanks.
>
> Bests,
> Hui
>
>
>
> -- 
> What most experimenters take for granted before they begin their  
> experiments is infinitely more interesting than any results to which  
> their experiments lead.
> -- Norbert Wiener
>
>
>
> -- 
> What most experimenters take for granted before they begin their  
> experiments is infinitely more interesting than any results to which  
> their experiments lead.
> -- Norbert Wiener



More information about the petsc-users mailing list