Create vectors

Matthew Knepley knepley at gmail.com
Mon Nov 9 07:32:36 CST 2009


Yes, Vec is just a regular type.

  Matt

On Mon, Nov 9, 2009 at 7:29 AM, <jarunan at ascomp.ch> wrote:

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



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20091109/3ffd9151/attachment.htm>


More information about the petsc-users mailing list