Create vectors

jarunan at jarunan at
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  

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

do i = 1, level_numbers

Is it possible to create pointer to vectors?

Thank you

Quoting jarunan at

> 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

More information about the petsc-users mailing list