On Thu, Feb 12, 2009 at 4:08 PM, (Rebecca) Xuefei YUAN <span dir="ltr"><<a href="mailto:xy2102@columbia.edu">xy2102@columbia.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,all,<br>
<br>
Where could I see the source code of PetscValidIntPointer()?</blockquote><div><br>include/private/petscimpl.h<br><br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks,<br>
<br>
Rebecca<br>
<br>
<br>
Quoting "(Rebecca) Xuefei YUAN" <<a href="mailto:xy2102@columbia.edu" target="_blank">xy2102@columbia.edu</a>>:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I check the matrix.c and find that the x,y,z direction has been<br>
reversed as in line 1249-1252 in MatSetStencil(), can I get to know why<br>
we do this?<br>
<br>
Thanks.<br>
<br>
<br>
1249: for (i=0; i<dim; i++) {<br>
1250: mat->stencil.dims[i] = dims[dim-i-1]; /* copy the<br>
values in backwards */<br>
1251: mat->stencil.starts[i] = starts[dim-i-1];<br>
1252: }<br>
<br>
Quoting "(Rebecca) Xuefei YUAN" <<a href="mailto:xy2102@columbia.edu" target="_blank">xy2102@columbia.edu</a>>:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think the dims should be {9,5,4,0} if it is Xperiodic, and should be<br>
{5,9,4,0} if it is Yperiodic. Am I right?<br>
<br>
Thanks,<br>
<br>
Rebecca<br>
<br>
<br>
Quoting "(Rebecca) Xuefei YUAN" <<a href="mailto:xy2102@columbia.edu" target="_blank">xy2102@columbia.edu</a>>:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If I have -da_grid_x 5 -da_grid_y 5 -dmmg_nlevels 1 and the DA and<br>
jacobian like:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr);<br>
ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr);<br>
ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr);<br>
ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr);<br>
</blockquote></blockquote>
<br>
will that be right if I have jacobian->stencil.dims ={5, 9, 4, 0}?<br>
<br>
Thanks,<br>
<br>
Rebecca<br>
<br>
<br>
<br>
Quoting Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>>:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
The dof argument to DACreate2d() is greater than 1. Thus the<br>
"dimension" that is associated with the matrix is 3 dimensions. Is<br>
this causing a problem?<br>
<br>
<br>
Barry<br>
<br>
Note: the "dimension" of the matrix affects the MatSetValuesStencil()<br>
but not much else I can think of;<br>
<br>
<br>
On Feb 12, 2009, at 11:44 AM, (Rebecca) Xuefei YUAN wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
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?<br>
<br>
ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr);<br>
ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr);<br>
ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr);<br>
ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr);<br>
<br>
Thanks very much!<br>
<br>
Rebecca<br>
</blockquote></blockquote>
<br>
<br>
<br>
-- <br>
(Rebecca) Xuefei YUAN<br>
Department of Applied Physics and Applied Mathematics<br>
Columbia University<br>
Tel:917-399-8032<br>
<a href="http://www.columbia.edu/%7Exy2102" target="_blank">www.columbia.edu/~xy2102</a><br>
</blockquote>
<br>
<br>
<br>
-- <br>
(Rebecca) Xuefei YUAN<br>
Department of Applied Physics and Applied Mathematics<br>
Columbia University<br>
Tel:917-399-8032<br>
<a href="http://www.columbia.edu/%7Exy2102" target="_blank">www.columbia.edu/~xy2102</a><br>
</blockquote>
<br>
<br>
<br>
-- <br>
(Rebecca) Xuefei YUAN<br>
Department of Applied Physics and Applied Mathematics<br>
Columbia University<br>
Tel:917-399-8032<br>
<a href="http://www.columbia.edu/%7Exy2102" target="_blank">www.columbia.edu/~xy2102</a><br>
</blockquote>
<br>
<br>
<br>
-- <br>
(Rebecca) Xuefei YUAN<br>
Department of Applied Physics and Applied Mathematics<br>
Columbia University<br>
Tel:917-399-8032<br>
<a href="http://www.columbia.edu/%7Exy2102" target="_blank">www.columbia.edu/~xy2102</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>