[petsc-users] Question about DMDA BOUNDARY_CONDITION set

Wenbo Zhao zhaowenbo.npic at gmail.com
Tue Apr 4 01:24:53 CDT 2017


Barry,

Thanks.

It is my fault. I should not mix the VecScatter and MatSetValues.

1. Matrix assemble
There are only two options matrix for case with rotation boundary.
The first is using
"MatSetoption(A,MAT_NEW_NONZERO_LOCATION_ERR,PETSC_FALSE)".
The second is to create matrix by hand.
Is it correct?

2. VecScatter
It will be used to get the values on ghosted cell.
My case is neutron diffusion equation which is like below:
\( -\nabla \cdot D_g \nabla \phi_g + \Sigma_{r,g}\phi_g - \sum_{g' \neq g}
\Sigma_{s,g'\to g} \phi_{g'} = \frac{1}{Keff} \chi_g \sum_{g' = 1, G}
\nu\Sigma_{f,g'}\phi_{g'}  \)
where g denotes energy group, G is the number of energy groups, \(D_g\) is
the diffusion coefficient of group g, \(\Sigma_{r,g}\) is the removal cross
section of group g,
\(\Sigma_{s,g'\to g}\) is the scatter cross section from group g' to group
g, \(chi_g\) is the fission spectral of group g, \(\nu\Sigma_{f,g'}\) is
the fission production cross section,
\(\phi_g\) is neutron flux and eigenvector, Keff is the eigenvalue.
The diffusion coefficients and other cross sections varied in the region
and are distributed on procs.
If I use mesh-centerd seven point finite difference method for 3D, the
degree of freedom is G and \(D_g\) need comunication.

I get the \(D_g\) of the ghost cell through VecScatter and insert values to
matrix.
Is it correct?

BEST,

Wenbo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170404/005d6549/attachment.html>


More information about the petsc-users mailing list