<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
The entry points for our code can vary. Thus a vector for example
can get created in a handful<br>
of routines. But it is possible that the vector has already been
created in another routine. So<br>
we perform a VecValid check on it. If it is false we create it,
else we go on and use it. Also at<br>
the end when we exit the program we clean up with a series of
VecDestroy calls but we check first if the vector is valid before
calling VecDestroy on it. Same for MatValid/MatDestroy.<br>
<br>
Obviously we can store a logical flag in a common block or the like
upon creation; but VecValid and<br>
MatValid were handy utility functions for us.<br>
<br>
Is is feasible to call PetscValidHeaderSpecific( ) out of fortran?
Or should should I just set up my own<br>
collection of allocate/deallocate flags.<br>
<br>
-sanjay<br>
<br>
On 5/3/12 7:08 PM, Matthew Knepley wrote:
<blockquote
cite="mid:CAMYG4Gm_q5d7G8iYAuOSZdZtCTnncTqUkeg8gG105whZuCt+OA@mail.gmail.com"
type="cite">
<div class="gmail_extra">On Thu, May 3, 2012 at 9:20 PM, Sanjay
Govindjee <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:s_g@berkeley.edu" target="_blank">s_g@berkeley.edu</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<br>
<br>
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.<br>
</blockquote>
<div><br>
</div>
<div>In C, this is now the macro PetscValidHeaderSpecific().
This check now happens in every function call. What</div>
<div>logic would need to look for a corrupt Vec beyond
CHKERRQ?</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
We used to perform operations like:<br>
<br>
call VecValid(xvec, chk, ierr)<br>
<br>
if(chk .eqv. PETSC_FALSE) then<br>
call VecCreate (PETSC_COMM_WORLD,
xvec, ierr)<br>
call VecSetSizes (xvec, numpeq,
PETSC_DECIDE, ierr)<br>
call VecSetFromOptions(xvec, ierr)<br>
else<br>
....<br>
endif<br>
<br>
But it seems VecValid and MatValid have been eliminated. Is
there a reason for this? or have<br>
I made a mistake? Is there a replacement test for invalid
Vec and Mat pointers?<span class="HOEnZb"><font
color="#888888"><br>
<br>
-sanjay<br>
<br>
</font></span></blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to
which their experiments lead.<br>
-- Norbert Wiener<br>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
-----------------------------------------------
Sanjay Govindjee, PhD, PE
Professor of Civil Engineering
779 Davis Hall
Structural Engineering, Mechanics and Materials
Department of Civil Engineering
University of California
Berkeley, CA 94720-1710
Voice: +1 510 642 6060
FAX: +1 510 643 5264
<a class="moz-txt-link-abbreviated" href="mailto:s_g@berkeley.edu">s_g@berkeley.edu</a>
<a class="moz-txt-link-freetext" href="http://www.ce.berkeley.edu/~sanjay">http://www.ce.berkeley.edu/~sanjay</a>
-----------------------------------------------
</pre>
</body>
</html>