Create vectors

jarunan at ascomp.ch jarunan at ascomp.ch
Mon Nov 9 07:29:07 CST 2009


I am solving multi-level grid (similar to multi grid but not the  
same). In each iteration, each level is solved separately but  
solutions are mapped to eachother. Each level has different size of  
matrix and vector. And each test case has different numbers of grid  
level.

I have a difficulty to create vectors and matrices for each level,  
preparing for the computation, as I do not want to create and destroy  
them in every iteration. I am thinking of something similar to array  
pointer (the code is in fortran) e.g.,

Type(real_array), Dimension(:), allocatable:: pointername
Allocate(pointername(level_numbers))

do i = 1, level_numbers
    allocate(pointername(i)%p(size))
enddo


Is it possible to create pointer to vectors?


Thank you
Jarunan


Quoting jarunan at ascomp.ch:

>
> Hello,
>
> Is there an equivalent way to allocating array pointer for creating
> vectors (or vector pointers)?
>
>
> Jarunan



-- 
Jarunan Panyasantisuk
Development Engineer
ASCOMP GmbH, Technoparkstr. 1
CH-8005 Zurich, Switzerland
Phone : +41 44 445 4072
Fax   : +41 44 445 4075
E-mail: jarunan at ascomp.ch
www.ascomp.ch


More information about the petsc-users mailing list