[petsc-users] Boundary conditions using DMComplex
Matthew Knepley
knepley at gmail.com
Mon Sep 24 07:51:07 CDT 2012
On Mon, Sep 24, 2012 at 12:32 AM, Subramanya G <subramanya.g at gmail.com>wrote:
> Hi Matt,
> I got what you were saying about the boundary conditions. But I am
> unable to figure out which routines to use for selecting only a
> section of the mesh while setting up a Petsc Section. The
> DMComplexCreateSection does not seem to offer anyway of restricting
> the mesh.
>
Take a look at the source for DMComplexCreateMesh():
http://petsc.cs.iit.edu/petsc/petsc-dev/annotate/5b880935157f/src/dm/impls/complex/complex.c#l5069
It just loops over ever point in the domain (DMComplexGetChart()) and sets
a number of unknowns
on it using PetscSectionSetDof(). After that is finished, it calls
PetscSectionSetUp(). Its a little more
complicated with boundary conditions, but you can check this function for
the specifics.
If you want just part of the domain, only call PetscSectionSetDof() on part
of the points.
Matt
> Thanks,
>
>
> Subramanya G Sadasiva,
>
> Graduate Research Assistant,
> Hierarchical Design and Characterization Laboratory,
> School of Mechanical Engineering,
> Purdue University.
>
> "The art of structure is where to put the holes"
> Robert Le Ricolais, 1894-1977
>
>
> On Fri, Sep 21, 2012 at 3:42 PM, Matthew Knepley <knepley at gmail.com>
> wrote:
> > On Fri, Sep 21, 2012 at 2:20 PM, Subramanya G <subramanya.g at gmail.com>
> > wrote:
> >>
> >> I have a small question about using DMComplex.
> >> How does one keep track of external boundaries. I found no methods to
> >> check if a particular node/face belonged to a particular external
> >> edge set.
> >
> >
> > First you want to distinguish between
> >
> > a) Topological boundaries
> >
> > For this you use Labels, so you can mark parts of the mesh using
> > DMCcomplexSetLabelValue()
> >
> > b) Algebraic Boundary Conditions
> >
> > These are specified in the PetscSection using
> PetscSectionSetConstraintDof()
> > and
> > PetscSectionSetConstraintIndices(). To construct these, you typically use
> > the information
> > in the mesh labels.
> >
> >>
> >> Also, Is it possible to set up a problem over a part of the mesh
> >> instead of the entire mesh?
> >
> >
> > This is very easy. Just create a PetscSection that only has unknowns over
> > part of the mesh.
> >
> > Matt
> >
> >>
> >> Thanks
> >>
> >>
> >> Subramanya G Sadasiva,
> >>
> >> Graduate Research Assistant,
> >> Hierarchical Design and Characterization Laboratory,
> >> School of Mechanical Engineering,
> >> Purdue University.
> >>
> >> "The art of structure is where to put the holes"
> >> Robert Le Ricolais, 1894-1977
> >
> >
> >
> >
> > --
> > 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
>
--
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/20120924/9355d4a4/attachment.html>
More information about the petsc-users
mailing list