Re: [deal.II] numbering of degrees of freedom

2018-04-26 Thread Wolfgang Bangerth

On 04/26/2018 06:40 AM, Phani Motamarri wrote:
Thank you Prof Wolfgang for the reply. Yes I meant DoF indices. Since 
get the level 1 mesh globally refined from level 0 (hyper_cube), if I 
make both of these levels active at the same time, does dealii default 
numbering scheme gets the dofs on the lowest level numbered first 
followed by the numbering of the remaining dofs on level 1?
Hence my query is that "Is there anyway I can make both these levels 
active at the same time and obtain the default numbering of dofs like 
above?"


No. A cell is either active (=has no children) or it is not (=has 
children). It is not something you can choose or set.



I just want to avoid writing my my own algorithm to get the required 
numbering to avoid any bugs which might be tricky when you have 
non-uniform mesh.


I'm afraid you'll have to write your own algorithm. You may want to look 
at the implementation of some of the other renumbering schemes in 
source/dofs/dof_renumbering.cc to see how this is done!


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] numbering of degrees of freedom

2018-04-26 Thread Phani Motamarri
Thank you Prof Wolfgang for the reply. Yes I meant DoF indices. Since get
the level 1 mesh globally refined from level 0 (hyper_cube), if I make both
of these levels active at the same time, does dealii default numbering
scheme gets the dofs on the lowest level numbered first followed by the
numbering of the remaining dofs on level 1?
Hence my query is that "Is there anyway I can make both these levels active
at the same time and obtain the default numbering of dofs like above?"
I just want to avoid writing my my own algorithm to get the required
numbering to avoid any bugs which might be tricky when you have non-uniform
mesh.

Many thanks for your reply!

On Wed, Apr 25, 2018 at 1:06 PM, Wolfgang Bangerth 
wrote:

>
> Phani,
>
> Regarding the distribution of indices for degrees of freedom it says in
>> the manual " Since the triangulation is traversed starting with the cells
>> of the coarsest active level and going to more refined levels, the lowest
>> numbers for dofs are given to the largest cells as well as their bounding
>> lines and vertices, with the dofs of more refined cells getting higher
>> numbers."
>>
>> Now I generated one cell using GridGenerator::hyper_cube(triangulation)
>> and then did a global refinement to generate 8 cells using
>> triangulation.refine_global(1). After attaching the dofHandler object to
>> the triangulation and I printed the global indices and coordinates of
>> support points. *I expected that the new vertices which are created after
>> the global refinement will have higher numbers than the numbers
>> corresponding to corner vertices which are originally there in the coarsest
>> cell. But I noticed the numbering of vertices is different. *
>>
>
> You say "vertices...will have higher numbers", by which I assume you refer
> to the DoF indices located on these vertices, not the vertex indices,
> correct? (The latter is a property of the triangulation, the former of the
> DoFHandler.)
>
>
> Am I missing anything here? Is there anyway to get the new vertices of the
>> refined mesh numbered so that they have the higher numbers than the
>> vertices of the coarsest cell. I need this particular numbering to be
>> continued for further global refinements.
>>
>
> You cannot change the vertex indices. But assuming I am right with my
> statement above, you *can* of course change the DoF indices.
>
> The numbering you observe results from the fact that "the lowest numbers
> for dofs are given to the largest cells as well as their bounding lines and
> vertices, with the dofs of more refined cells getting higher numbers." In
> your case, *all* cells are at the same level, so numbering of DoFs happens
> by just walking through all active cells, which are the ones on level 1 in
> your case.
>
> If you want to change DoF indices, you can always use
> DoFHandler::renumber_dofs() and just provide whatever ordering you want.
>
> Best
>  W.
>
>
> --
> 
> Wolfgang Bangerth  email: bange...@colostate.edu
>www: http://www.math.colostate.edu/~bangerth/
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/fo
> rum/dealii?hl=en
> --- You received this message because you are subscribed to the Google
> Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] numbering of degrees of freedom

2018-04-25 Thread Wolfgang Bangerth


Phani,

Regarding the distribution of indices for degrees of freedom it says in 
the manual " Since the triangulation is traversed starting with the 
cells of the coarsest active level and going to more refined levels, the 
lowest numbers for dofs are given to the largest cells as well as their 
bounding lines and vertices, with the dofs of more refined cells getting 
higher numbers."


Now I generated one cell using GridGenerator::hyper_cube(triangulation) 
and then did a global refinement to generate 8 cells using 
triangulation.refine_global(1). After attaching the dofHandler object to 
the triangulation and I printed the global indices and coordinates of 
support points. *I expected that the new vertices which are created 
after the global refinement will have higher numbers than the numbers 
corresponding to corner vertices which are originally there in the 
coarsest cell. But I noticed the numbering of vertices is different. *


You say "vertices...will have higher numbers", by which I assume you 
refer to the DoF indices located on these vertices, not the vertex 
indices, correct? (The latter is a property of the triangulation, the 
former of the DoFHandler.)



Am I missing anything here? Is there anyway to get the new vertices of 
the refined mesh numbered so that they have the higher numbers than the 
vertices of the coarsest cell. I need this particular numbering to be 
continued for further global refinements.


You cannot change the vertex indices. But assuming I am right with my 
statement above, you *can* of course change the DoF indices.


The numbering you observe results from the fact that "the lowest numbers 
for dofs are given to the largest cells as well as their bounding lines 
and vertices, with the dofs of more refined cells getting higher 
numbers." In your case, *all* cells are at the same level, so numbering 
of DoFs happens by just walking through all active cells, which are the 
ones on level 1 in your case.


If you want to change DoF indices, you can always use 
DoFHandler::renumber_dofs() and just provide whatever ordering you want.


Best
 W.


--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] numbering of degrees of freedom

2018-04-22 Thread Phani Motamarri
Hi,

Regarding the distribution of indices for degrees of freedom it says in the
manual " Since the triangulation is traversed starting with the cells of
the coarsest active level and going to more refined levels, the lowest
numbers for dofs are given to the largest cells as well as their bounding
lines and vertices, with the dofs of more refined cells getting higher
numbers."

Now I generated one cell using GridGenerator::hyper_cube(triangulation) and
then did a global refinement to generate 8 cells using
triangulation.refine_global(1). After attaching the dofHandler object to
the triangulation and I printed the global indices and coordinates of
support points. *I expected that the new vertices which are created after
the global refinement will have higher numbers than the numbers
corresponding to corner vertices which are originally there in the coarsest
cell. But I noticed the numbering of vertices is different. *

Am I missing anything here? Is there anyway to get the new vertices of the
refined mesh numbered so that they have the higher numbers than the
vertices of the coarsest cell. I need this particular numbering to be
continued for further global refinements.

This particular numbering of vertices is useful for some internal research
we are doing.

Regards
Phani

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.