On , 2020Feb28, at 14:14, Jed Brown
mailto:jed.br...@colorado.edu>> wrote:
Can't do this because std::vector can't be wrapped around existing memory.
That’s why I use gsl::span which ?will be in c++20?
Victor.
Matthew Knepley writes:
> On Fri, Feb 28, 2020 at 2:12 PM Zane Charles Jakobs <
> zane.jak...@colorado.edu> wrote:
>
>> Hi PETSc devs,
>>
>> I'm writing some C++ code that calls PETSc, and I'd like to be able to
>> place the result of VecGetArray into an std::vector and then later call
>>
You can create the C++ vector vals and resize it to a proper size, get its
data pointer, then pass it to PETSc,
int n;
Vec x;
std::vector vals;
vals.resize(n); /* You need to calculate n by other means */
ierr =
VecCreateMPIWithArray(PETSC_COMM_WORLD,bs,n,PETSC_DECIDE,vals.data(),);CHKERRQ(ierr);
On Fri, Feb 28, 2020 at 2:12 PM Zane Charles Jakobs <
zane.jak...@colorado.edu> wrote:
> Hi PETSc devs,
>
> I'm writing some C++ code that calls PETSc, and I'd like to be able to
> place the result of VecGetArray into an std::vector and then later call
> VecRestoreArray on that data, or get the
Hi PETSc devs,
I'm writing some C++ code that calls PETSc, and I'd like to be able to
place the result of VecGetArray into an std::vector and then later call
VecRestoreArray on that data, or get the same effects. It seems like the
correct way to do this would be something like:
Vec x;
I will take a look at it and get back to you. Thanks.
On Fri, Feb 28, 2020, 7:29 AM jordic wrote:
> Dear all,
>
> the following simple program:
>
>
> //
>
> #include
>
> PetscInt ierr=0;
> int main(int
Dear all,
I have a master student exploring DMPLEX and TS/ex11.c.
He has build his own examples aiming at easing the learning curve.
His examples are here GITHUB LINK ->
Hi, Thanks.
Kind regards.
El vie., 28 de feb. de 2020 a la(s) 10:04, hzh...@mcs.anl.gov (
hzh...@mcs.anl.gov) escribió:
> Emmanuel:
> This is a bug in petsc. I've pushed a fix
> https://gitlab.com/petsc/petsc/-/commit/fd2a003f2c07165526de5c2fa5ca4f3c85618da7
>
> You can edit it in your petsc
Emmanuel:
This is a bug in petsc. I've pushed a fix
https://gitlab.com/petsc/petsc/-/commit/fd2a003f2c07165526de5c2fa5ca4f3c85618da7
You can edit it in your petsc library, or add MatAssemblyBegin/End in your
application code until petsc-release is patched.
Thanks for reporting it and sending us
Dear all,
the following simple program:
//
#include
PetscInt ierr=0;
int main(int argc,char **argv)
{
MPI_Comm comm;
PetscMPIInt rank,size;
PetscInitialize(,,NULL,help);if (ierr) return ierr;
10 matches
Mail list logo