← Back to team overview

dolfin team mailing list archive

Re: Dirichlet Boundary conditions revisited

 

Is it the code in DofMap that is not understandable ? 

The idea behind the code is that the dof_map provides a numbering
of the unknowns ie. the global dofs are  D = [0, 1, .....N-1]. 
In the restricted function space we need a corresponding numbering
R = [0, 1, .... M-1] where M < N. 

The code in restriction is such that it runs through all dofs in the
restricted mesh (as it is now by runing through the whole mesh except 
for the ones marked by the meshfunction). I run through all the dofs
and for each dof I check the dof in the global mesh, If I already have
seen this dof I use the same dof_number as last time (stored in
R[dofs[k]]). If the dof is new I update the dof_counter and add
the new dof to R. By doing this I get a new dof_map where each 
node is numbered in an increasing sequence. 

Check also the demo under dolfin/demo/function/restriction. You can eg. 
probably begin by changing demo.


Kent 
 

On ma., 2009-02-09 at 11:20 +0200, Evan Lezar wrote:
> Kent
> 
> Thanks for the reply.  I have started to have a look at the code to
> make the changes that you suggested, but must admit that I am a little
> lost.
> 
> I will continue to work on it, but any other tips would be greatly
> appreciated.
> 
> Thanks
> Evan
> 
> On Wed, Feb 4, 2009 at 10:50 PM, <kent-and@xxxxxxxxx> wrote:
>         
>         Hi,
>         
>         Here are my rough thoughts on it.
>         
>         In FunctionSpace there is a function restriction which creates
>         a
>         (restricted) DofMap based
>         on a mesh, a ufc:.dofmap and a MeshFunction. The way I have
>         implemented,
>         this function is such that the MeshFunction contains booleans
>         that
>         indicates which cells
>         that should be used in the DofMap. It could equally well be
>         vertices or other
>         mesh entities, but the way restriction is implemented now, it
>         has to be
>         cells.
>         It should however be relatively easy to change it to other
>         entities (I
>         think).
>         Changing this would give a loc2glob array which contains -1
>         for the entries
>         that should not be used. As I understand, petsc will then
>         avoid these entries
>         so it might work, at least for petsc, with only this
>         alteration in the
>         function restriction.
>         
>         Kent
>         
>         
>         > Hi
>         >
>         > Since I last rasied this issue there have been a lot of
>         changes (great
>         > ones
>         > I must add) to the fenics codebase, so I thought I would ask
>         again.
>         >
>         > I am interested in removing the rows and columns of the
>         finite element
>         > matrices (for vector electromagnetic problems) associated
>         with zero valued
>         > Dirichlet boundary conditions.  It is important that the
>         original degrees
>         > of
>         > freedom (or a mapping between the two sets) be available so
>         that the
>         > solution of a system of equations or an eigenvalue problem
>         can be used to
>         > visualize the solution, for example.
>         >
>         > The removal of the degrees of freedom has two advantages
>         that I can think
>         > of
>         > (for my applications at any rate).  The first is that the
>         systems being
>         > solved will be smaller.  The second is of particular concern
>         to me as I am
>         > often solving eigenvalue problems and the unity eigenvalues
>         that are
>         > introduce when applying the Dirichlet BCs in their current
>         form
>         > contaminate
>         > the spectrum in many of my examples.
>         >
>         > Any thoughts or assistance would be greatly appreciated.
>         >
>         > Thanks
>         > Evan
>         
>         > _______________________________________________
>         > DOLFIN-dev mailing list
>         > DOLFIN-dev@xxxxxxxxxx
>         > http://www.fenics.org/mailman/listinfo/dolfin-dev
>         >
>         
>         
> 



Follow ups

References