[petsc-users] from Petsc 3.7.4.0 to 3.13.3.0

Anthony Paul Haas aph at email.arizona.edu
Mon Aug 2 16:06:33 CDT 2021


Hello,

I recently updated our code from Petsc 3.7.4.0 to 3.13.3.0. Among other
things I noticed is that all the includes (such as #include
<petsc/finclude/petscvec.h>) have now to be accompanied with  use
statements (such as use petscvec).

It seems that due to the use statements the compiler is now way more
strict. In our code, we can solve stability equations in real arithmetic or
in complex arithmetic, where some subroutines are used for complex
arithmetic and some other ones for real arithmetic.

My question is, is it good practice to wrap around a Petsc call  with the
pre-compiler flag PETSC_USE_COMPLEX in order to avoid compilation error if
that call is not used say in the complex part of the code?

Example, the call to MatSetValuesBlocked below is not used in the complex
arithmetic code, so to avoid a compilation error, I wrapped the call
with PETSC_USE_COMPLEX==0
(Mat1 is a real array in this example)

#if (PETSC_USE_COMPLEX==0)

       call MatSetValuesBlocked(self%fieldLHSMat_ps,1,ptLoc-1,1,colIndex-1,
transpose(Mat1(1:ndim1,1:ndim2)),INSERT_VALUES,ierr)

#endif


Thanks,


Anthony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210802/64e4d821/attachment.html>


More information about the petsc-users mailing list