[petsc-users] VecValid

2012-05-03 Thread Matthew Knepley
On Thu, May 3, 2012 at 9:20 PM, Sanjay Govindjee wrote: > We have some code that has worked up through petsc-3.1 and we are in the > process of updating it to petsc-3.2. > > One thing that I can not find mentioned in the change logs (looking all > the way back to petsc-2.1.0) or the FAQs is the e

[petsc-users] VecValid

2012-05-03 Thread Barry Smith
On May 3, 2012, at 9:39 PM, Blaise Bourdin wrote: > Hi, > > As a side note: this is actually a problem I have met in one of the TS > examples. When using fortran datatypes, the statements "A=0" and "if (A .eq. > 0)" are not valid. They would require overloading the assignment and > comparison

[petsc-users] VecValid

2012-05-03 Thread Blaise Bourdin
Hi, As a side note: this is actually a problem I have met in one of the TS examples. When using fortran datatypes, the statements "A=0" and "if (A .eq. 0)" are not valid. They would require overloading the assignment and comparison operators. Can anybody see an alternative? Blaise > > VecVa

[petsc-users] VecValid

2012-05-03 Thread Barry Smith
VecValid was unsafe because it looks inside a data structure that may or not be valid. In Fortran the safe way to do this is to set the value to 0 right after declaration and then check if not zero. So MatA A = 0 ... if (A .eq. 0) then call VecCreate(

[petsc-users] VecValid

2012-05-03 Thread Sanjay Govindjee
Thanks. I think this will work for us. -sanjay On 5/3/12 7:22 PM, Barry Smith wrote: >VecValid was unsafe because it looks inside a data structure that may or > not be valid. > > In Fortran the safe way to do this is to set the value to 0 right after > declaration and then check if not

[petsc-users] VecValid

2012-05-03 Thread Sanjay Govindjee
The entry points for our code can vary. Thus a vector for example can get created in a handful of routines. But it is possible that the vector has already been created in another routine. So we perform a VecValid check on it. If it is false we create it, else we go on and use it. Also at th

[petsc-users] VecValid

2012-05-03 Thread Sanjay Govindjee
We have some code that has worked up through petsc-3.1 and we are in the process of updating it to petsc-3.2. One thing that I can not find mentioned in the change logs (looking all the way back to petsc-2.1.0) or the FAQs is the elimination of the VecValid and MatValid tests. We used to perfo

[petsc-users] VecValid gone in 3.2

2011-10-21 Thread Dominik Szczerba
VecValid is gone in 3.2 with no mention in the Changes. Is there any replacement? Dominik

[petsc-users] VecValid gone in 3.2

2011-10-21 Thread Jed Brown
On Fri, Oct 21, 2011 at 15:23, Dominik Szczerba wrote: > VecValid is gone in 3.2 with no mention in the Changes. Is there any > replacement? > You can use PetscValidHeaderSpecific(vec,VEC_CLASSID,argnum); if you are validating function arguments. VecValid() didn't have meaningful semantics when