Please reply to email rather than starting a new thread. Your email client might be dropping headers.<br><br><div class="gmail_quote">On Sat, Jul 21, 2012 at 12:48 PM, Florian <span dir="ltr"><<a href="mailto:flo.44@gmx.de" target="_blank">flo.44@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>On Sat, Jul 21, 2012 at 12:26 PM, Florian <flo.44 at <a href="http://gmx.de" target="_blank">gmx.de</a>> wrote:<br>
><br>
>> I made it to step with gdb now in VecCreate(). The problem is inside the<br>
>> VecCreate<br>
>> function the new created vector vec has all the adresses set. But when I'm<br>
>> stepping<br>
>> back in my function the addresses are all 0x0.<br>
>><br>
><br>
>Let VecCreate finish.<br>
<br>
What do you mean? I step to the last line in VecCreate and after the last line back.<br></blockquote><div><br></div><div>The last line is</div><div><br></div><div> *vec = v; </div><div><br></div><div>which makes your pointer point at the new vector.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
><br>
><br>
>><br>
>> Another question is, what happens with my created vector. I mean I create<br>
>> a Object<br>
>> with Vec v and inside the VecCreate function the addres of my object v is<br>
>> first set<br>
>> to PETSC_NULL and later to the Vec which is created inside the VecCreate<br>
>> function.<br>
>> It seems like I never could destroy my created vector. Can somebody<br>
>> explain this to me?<br>
>><br>
><br>
>The new object is created, then your pointer is made to point at the new<br>
>object.<br>
<br>
So if I get it right I create with "Vec v;" only a pointer? But why is it possible before I call VecCreate<br>
to have a look at a vector object. I mean in ddd I can display a full vector object.<br>
<br>
</blockquote></div><br><div>In petscvec.h, you will find<br><br>typedef struct _p_Vec *Vec;</div><div><br></div><div>Of course DDD allows you to follow an invalid pointer.</div>