[petsc-users] Question about DMDA BOUNDARY_CONDITION set

Matthew Knepley knepley at gmail.com
Tue Mar 21 09:31:42 CDT 2017


On Tue, Mar 21, 2017 at 1:46 PM, Wenbo Zhao <zhaowenbo.npic at gmail.com>
wrote:

> Matt,
>
> Thanks.
>
> I want to solve neutron diffusion equations using finite difference method
> and PETSc.
> This rotation boundary condition is very common in my cases.
> Though the mesh consists of  ~ 10 Miliion structured hexahedron cells, the
> mesh is simple and could be discribed by three vectors about x, y and z
> axis.
> It is appropriate for DMDA except boundary condition.
>
> I wanted to make mesh partition like DMDA by hand. Then I need to create
> matrix and vector and assemble matrix, and et al. I thought it was an easy
> work.
> As you say, it's not.
>
> As a newer, I can use DACreate2d to begin. It's OK.
> But finally, it does need this optimization.
>
> Though I read the manual about the vector and matrix, I am not clear about
> the basic idea behind the code.
> How can I create a matrix and vector as my mesh partition
>

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMCreateGlobalVector.html


> and create the map between the nature ordering and the PETSc ordering in
> global vector?
>

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDAGlobalToNaturalBegin.html#DMDAGlobalToNaturalBegin


> How does vector communicate in the operation of matrix multi vector?
>

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMult.html


> Does it achieved automatically?
>

Yes.

  Thanks,

    Matt


> BETS,
>
> Wenbo
>
>
>
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170321/d104a557/attachment.html>


More information about the petsc-users mailing list