On Thu, Feb 17, 2011 at 9:00 AM, Pierre Navaro <span dir="ltr"><<a href="mailto:elhombrefr@hotmail.fr">elhombrefr@hotmail.fr</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
Hi<br>
I add these lines on line 54<br>
call DMMGGetDA(dmmg,db,ierr)<br>
call
DAGetInfo(db,PETSC_NULL_INTEGER,mx,my,mz,
&<br>
&
PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &<br>
&
PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &<br>
&
PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &<br>
& PETSC_NULL_INTEGER,ierr)<br>
print"('mx,my,mz =',3i4,X,i6)",mx,my,mz, mx*my*mz<br></div></blockquote><div><br></div><div>Fortran is always so easy:</div><div><br></div><div><div> DMMG dmmg, dmmgLevel</div>
</div><div><div> DM da, db</div></div><div><div> PetscInt mx,my,mz</div></div><div><br></div><div><div> call DMMGArrayGetDMMG(dmmg,dmmgLevel,ierr)</div><div> call DMMGGetDM(dmmgLevel,db,ierr)</div>
<div> call DMDAGetInfo(db,PETSC_NULL_INTEGER,mx,my,mz, &</div><div> & PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &</div><div> & PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &</div>
<div> & PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &</div><div> & PETSC_NULL_INTEGER,ierr)</div><div> print"('mx,my,mz =',3i4,X,i6)",mx,my,mz, mx*my*mz</div>
</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#ffffff" text="#000000">
and i get these errors<br>
[0]PETSC ERROR: --------------------- Error Message
------------------------------------<br>
[0]PETSC ERROR: Invalid argument!<div class="im"><br>
[0]PETSC ERROR: Wrong type of object: Parameter # 1!<br></div>
[0]PETSC ERROR:
------------------------------------------------------------------------<br>
[0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20
14:26:37 CST 2010<br>
[0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
[0]PETSC ERROR: See docs/index.html for manual pages.<br>
[0]PETSC ERROR:
------------------------------------------------------------------------<br>
[0]PETSC ERROR: ./ex22 on a arch-osx- named <a href="http://m-navaro.u-strasbg.fr" target="_blank">m-navaro.u-strasbg.fr</a> by
navaro Thu Feb 17 15:59:43 2011<br>
[0]PETSC ERROR: Libraries linked from
/opt/petsc-3.1-p7/arch-osx-10.6/lib<br>
[0]PETSC ERROR: Configure run at Tue Jan 25 09:41:36 2011<br>
[0]PETSC ERROR: Configure options --with-cc=gcc --with-fc="gfortran
-m64" --with-cxx=g++ --download-mpich=1 PETSC_ARCH=arch-osx-10.6<br>
[0]PETSC ERROR:
------------------------------------------------------------------------<br>
[0]PETSC ERROR: DAGetInfo() line 309 in src/dm/da/src/daview.c<br>
mx,my,mz = 0 0 0 0<br>
<br>
Best regards<br>
Pierre<div><div></div><div class="h5"><br>
<br>
On 17/02/11 15:19, Matthew Knepley wrote:
<blockquote type="cite">On Thu, Feb 17, 2011 at 8:01 AM, El Hombre Frances <span dir="ltr"><<a href="mailto:elhombrefr@hotmail.fr" target="_blank">elhombrefr@hotmail.fr</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi,<br>
I'm looking for how to get information about the DA of a DMMG
finest grid.<br>
I saw that you can access them with<br>
call DMMGGetDA(...<br>
call DAGetInfo(...<br>
but it doesn't work in the main program, i get this error<br>
0]PETSC ERROR: Invalid argument!<br>
[0]PETSC ERROR: Wrong type of object: Parameter # 1!<br>
</blockquote>
<div><br>
</div>
<div>1) Always send the COMPLETE error message</div>
<div><br>
</div>
<div>2) That should work. Notice that we use that on line 75</div>
<div>
<br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
I tried with this example<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/ksp/ksp/examples/tutorials/ex22f.F.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/ksp/ksp/examples/tutorials/ex22f.F.html</a><br>
<br>
I don't know how to get DA infos outside the subroutines
ComputeRHS and ComputeJacobian<br>
<br>
I want grid size of the DA 3D in order to plot the field. I
noticed that it's possible with PetscObjectQuery in C
language.<br>
<br>
Thanks for your help<br>
<br>
Pierre Navaro<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>
</blockquote>
<br>
<br>
</div></div><pre cols="72">--
Pierre NAVARO
IRMA - UMR 7501 CNRS/Universite de Strasbourg - Bureau i101
7 rue Rene Descartes F-67084 Strasbourg Cedex, FRANCE.
tel : (33) [0]3 68 85 01 73, fax : (33) [0]3 68 85 01 05
<a href="http://www-irma.u-strasbg.fr/~navaro" target="_blank">http://www-irma.u-strasbg.fr/~navaro</a>
</pre>
</div>
</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>