[petsc-users] [Fortran] VTK viewer error

Dharmendar Reddy dharmareddy84 at gmail.com
Thu Apr 18 20:17:14 CDT 2013


Sorry Again. I always use to use reply and the mail went to petsc-users.
Only since last few days it is not going to petsc-users. I will make sure i
reply-all from now on.

On Thu, Apr 18, 2013 at 7:43 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Please always use "reply-all" so that your messages go to the list.
> This is standard mailing list etiquette.  It is important to preserve
> threading for people who find this discussion later and so that we do
> not waste our time re-answering the same questions that have already
> been answered in private side-conversations.  You'll likely get an
> answer faster that way too.
>
> Dharmendar Reddy <dharmareddy84 at gmail.com> writes:
>
> > Thanks. It works now. And i like the binary-appended XML. Few questions
> > though.
> >
> > I see that the data in vtu has Field Names liek this :
> > Vec_0xyyyyyyyy_0Point0
> >
> > It would be nice to have the data with Field Names set in then default
> > section of DMPlex.
>
> call PetscObjectSetName(U, 'myfield', ierr)
>
>    This procedure may not work if U has multiple fields per mesh node
right ? The field names are already set into Default section of the dm.

  I set the field layout and boundary points using DMPlexCreateSection and
DMSetDefualtSection
  Now, my test problem has 567 nodes. Node 1 and 567 have Dirichlet BC.
When i do DMGetGlobalVector it has size 565, the solution vector of the
snes  also has size 565.  The solution vector written vtu file has 567
values with zero value at the boundary nodes. Am i missing a step here?

Usgin Vecsetvaluessection i apply bc  inside the subroutines passed to
dmsnessetfunction/jacobain. The bc values are propagated to the solver.



> > Also, I do not see the Boundary values, How do I get that data in to the
> > vector before viewing?
>
> Did you remove the boundary nodes when setting DMPlex's section?
>
> > I need to added to the viewer some auxiliary data which depends on the
> > solution of the snes problem, If do the following will that do ?
>
> If the 'auxdm' is different from the original DM, you currently have to
> write it to a different file or have a single big "visualization DM"
> that contains all the fields you ever want to look at (including
> boundary values as appropriate).  This may be the simplest solution for
> you and for us.
>
>     auxdm is the clone of actual dm. I think i got how to handle this.


> > DMGetGlobalVector(dm,u,ierr)
> >
> > DMGetGlobalVector(auxdm,v,ierr)
> >
> >  <Some how update boundary data in u>
> >
> > v = f(u)  ! compute the aux data...
> >
> > PetscViewerCreate(PETSC_COMM_WORLD, viewer, ierr); CHKERRQ(ierr)
> >  PetscViewerSetType(viewer, PETSCVIEWERVTK, ierr); CHKERRQ(ierr)
> > PetscViewerFileSetName(viewer, 'sol.vtu', ierr)
> >
> > VecView(u,viewer,ierr)
> > VecView(v,viewer,ierr)
> >
> >
> >
> >
> > On Thu, Apr 18, 2013 at 11:37 AM, Jed Brown <jedbrown at mcs.anl.gov>
> wrote:
> >
> >> Matthew Knepley <knepley at gmail.com> writes:
> >>
> >> > On Thu, Apr 18, 2013 at 9:25 AM, Jed Brown <jedbrown at mcs.anl.gov>
> wrote:
> >> >
> >> >> Dharmendar Reddy <dharmareddy84 at gmail.com> writes:
> >> >>
> >> >> > ! This line gives a compile error, as PETSCVIEWERVTK is not defined
> >> for
> >> >> > FORTRAN
> >> >> > !  !call PetscViewerSetType(viewer, PETSCVIEWERVTK)
> >> >>
> >> >
> >> > I have pushed a Fortran example of this now:
> >> >
> >> >   src/dm/impls/plex/example/tutorials/ex1f90
> >>
> >> Relative to Matt's example, you can use the following for
> >> binary-appended XML, which is fast and works in parallel.
> >>
> >> diff --git i/src/dm/impls/plex/examples/tutorials/ex1f90.F
> >> w/src/dm/impls/plex/examples/tutorials/ex1f90.F
> >> index d6954e6..570ad9f 100644
> >> --- i/src/dm/impls/plex/examples/tutorials/ex1f90.F
> >> +++ w/src/dm/impls/plex/examples/tutorials/ex1f90.F
> >> @@ -82,9 +82,7 @@
> >>        CHKERRQ(ierr)
> >>        call PetscViewerSetType(viewer, PETSCVIEWERVTK, ierr)
> >>        CHKERRQ(ierr)
> >> -      call PetscViewerSetFormat(viewer, PETSC_VIEWER_ASCII_VTK, ierr)
> >> -      CHKERRQ(ierr)
> >> -      call PetscViewerFileSetName(viewer, 'sol.vtk', ierr)
> >> +      call PetscViewerFileSetName(viewer, 'sol.vtu', ierr)
> >>        CHKERRQ(ierr)
> >>        call VecView(u, viewer, ierr)
> >>        CHKERRQ(ierr)
> >>
> >>
> >> The example also leaks memory.  (Matt is fixing that.)
> >>
> >
> >
> >
> > --
> > -----------------------------------------------------
> > Dharmendar Reddy Palle
> > Graduate Student
> > Microelectronics Research center,
> > University of Texas at Austin,
> > 10100 Burnet Road, Bldg. 160
> > MER 2.608F, TX 78758-4445
> > e-mail: dharmareddy84 at gmail.com
> > Phone: +1-512-350-9082
> > United States of America.
> > Homepage: https://webspace.utexas.edu/~dpr342
>



-- 
-----------------------------------------------------
Dharmendar Reddy Palle
Graduate Student
Microelectronics Research center,
University of Texas at Austin,
10100 Burnet Road, Bldg. 160
MER 2.608F, TX 78758-4445
e-mail: dharmareddy84 at gmail.com
Phone: +1-512-350-9082
United States of America.
Homepage: https://webspace.utexas.edu/~dpr342
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130418/2a74b5ee/attachment-0001.html>


More information about the petsc-users mailing list