DACreate2d() and DAGetMatrix()

Barry Smith bsmith at mcs.anl.gov
Thu Feb 12 11:52:04 CST 2009


    The dof argument to DACreate2d() is greater than 1. Thus the  
"dimension" that is associated with the matrix is 3 dimensions.  Is  
this causing a problem?


    Barry

Note: the "dimension" of the matrix affects the MatSetValuesStencil()  
but not much else I can think of;


On Feb 12, 2009, at 11:44 AM, (Rebecca) Xuefei YUAN wrote:

> Hi,
>
> I use the following set of codes to create the jacobian matrix,  
> however, the dimensions of jacobian becomes 3 (dim=3) although I use  
> DACreate2d to create this da. I wanna know where is wrong?
>
> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr);
> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5,  
> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr);
> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr);
> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr);
>
> Thanks very much!
>
> Rebecca



More information about the petsc-users mailing list