[petsc-users] VecChop not in petsc4py

Jed Brown jed at jedbrown.org
Mon Sep 21 14:53:08 CDT 2015


Justin Chang <jychang48 at gmail.com> writes:

> Hi all,
>
> I noticed that there's no VecChop in petsc4py. I see a MatChop, but was
> wondering if you guys can add the petsc4py implementation of VecChop.
>
> I am guessing it would be something like:

Since you've done the work, you might as well submit it as a pull
request.

> in src/PETSc/Vec.pyx:
>
> def chop(self, tol):
>   cdef PetscReal rval = asReal(tol)
>   CHKERR( VecChop(self.vec, rval) )
>
> in src/PETSc/petscvec.pxi:
>
> int VecChop(PetscVec, PetscReal)
>
> Thanks,
> Justin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150921/db696661/attachment.pgp>


More information about the petsc-users mailing list