[petsc-users] about MatTranspose

Jed Brown jedbrown at mcs.anl.gov
Wed Aug 31 10:14:09 CDT 2011


On Wed, Aug 31, 2011 at 10:02, Likun Tan <likunt at andrew.cmu.edu> wrote:

> MatCreateSeqDense(PETSC_COMM_SELF, M, M, PESTC_NULL, &A)
>

yes


> MatCreateMPIDense(PETSC_COMM_WORLD, PETSC_DECIDE, PETSC_DECIDE, M, N,
> PETSC_NULL, &B)
>

No, use MatCreateSeqDense() here too. Do you also need the result array on
every process?

PetscInt n = PETSC_DECIDE;
PetscSplitOwnership(PETSC_COMM_WORLD,&n,&N);
MatCreateSeqDense(PETSC_COMM_SELF,M,n,PETSC_NULL,&B);

MatSetValues() //Set values to A and B
> MatCholeskyFactor()// Factorization
>

MatDuplicate(B,MAT_DO_NOT_COPY_VALUES,&X);


> MatMatSolve()
>


> The 3D array is generated before setting values to A and B. It comes from
> some known function evaluation, an i need the array in every process.
>

Okay, just do the same thing on every process, but only set the values into
B for the part that will be done locally.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110831/49e13c6c/attachment.htm>


More information about the petsc-users mailing list