Thank you both for your response.
From: Barry Smith
Date: Thursday, 5 September 2024 at 23:19
To: Chockalingam, Karthikeyan (STFC,DL,HC)
Cc: petsc-users@mcs.anl.gov
Subject: Re: [petsc-users] MPIAIJ MatMult and non conforming object sizes
You can use MatCreateVecs() to create vectors sized
You can use MatCreateVecs() to create vectors sized properly for both x and y
in y = Ax when A is not square.
> On Sep 5, 2024, at 5:20 PM, Karthikeyan Chockalingam - STFC UKRI via
> petsc-users wrote:
>
> Hello,
>
> I am unsure why the program crashes even while running the code seriall
It is triggered by
PetscCheck(mat->rmap->N == y->map->N, PetscObjectComm((PetscObject)mat),
PETSC_ERR_ARG_SIZ, "Mat mat,Vec y: global dim %" PetscInt_FMT " %"
PetscInt_FMT, mat->rmap->N, y->map->N);
The error says in your y = Ax, A has 40 rows but y has 25.
Generally, VecDuplicate(par_xcoord,&par
Hello,
I am unsure why the program crashes even while running the code serially
petscErr = MatCreate(mesh.comm().get(), &par_G);
petscErr = MatSetType(par_G, MATMPIAIJ);
petscErr = MatSetSizes(par_G, local_num_rows, local_num_cols,
total_num_rows, total_num_cols);
PetscInt d_nz = 2;