Re: [deal.II] Re: Getting number of hanging support points

2016-08-27 Thread Jean-Paul Pelteret
And for the record, attached is a corrected version of the MWE illustrating 
the correct and intended behaviour of constraint creation for pure 
p-refinement.

Number of cells: 2
Number of degrees of freedom: 11
Number of constraints: 1


On Saturday, August 27, 2016 at 9:41:41 AM UTC+2, Jean-Paul Pelteret wrote:
>
> Ha ha. Dammit, what a silly mistake :-) Thanks Wolfgang!
>
> On Friday, August 26, 2016 at 11:08:17 PM UTC+2, Wolfgang Bangerth wrote:
>>
>> On 08/25/2016 02:34 AM, Jean-Paul Pelteret wrote: 
>> > Hi Deepak, 
>> > 
>> > Ok, so I've created a minimal working example to demonstrate what 
>> you're 
>> > seeing here. I'm not sufficiently familiar with the p-refinement part 
>> of the 
>> > hp functionality/implementation to tell whether this is truly the 
>> expected 
>> > behaviour or not. I see that the examples and description 
>> > <
>> https://www.dealii.org/8.4.1/doxygen/deal.II/group__constraints.html#ga3eaa31a679484e80c193e74e8a967dc8>
>>  
>>
>> > in the documentation mix h- and p-refinement, so are _perhaps_ not 
>> > sufficiently clear to describe the expected outcome of this 
>> configuration. Or 
>> > maybe its a bug arising from the adjacent cells being on the same 
>> refinement 
>> > level (i.e. there are no actual hanging _nodes_). Perhaps someone else 
>> could 
>> > clarify this? 
>>
>> It's not a bug but a feature :-) In your code, you call 
>>
>>
>>// Build constraints 
>>ConstraintMatrix constraints; 
>>DoFTools::make_hanging_node_constraints (dof_handler, 
>> constraints); 
>>constraints.clear(); // * 
>>
>> I suspect what you really wanted to call in the last line is 
>> 'constraints.close()' -- because if you do so, the result is pretty much 
>> what 
>> I think you probably wanted ;-) 
>>
>> Cheers 
>>   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.

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 

using namespace dealii;

int main()
{
  const int dim = 2;
  Triangulation tria;
  const hp::FECollection fe_collection (FE_Q(1), FE_Q(2));
  hp::DoFHandler dof_handler(tria);

  // Two cell domain
  std::vector divisions (dim,1);
  divisions[0] = 2;
  Point pt_1, pt_2;
  for (unsigned int d=0; dset_active_fe_index(1);
  dof_handler.distribute_dofs(fe_collection);

  // Build constraints
  ConstraintMatrix constraints;
  DoFTools::make_hanging_node_constraints (dof_handler,
   constraints);
  constraints.close();

  // Print to screen
  std::cout
<< "Number of cells: " << tria.n_active_cells() << "\n"
<< "Number of degrees of freedom: " << dof_handler.n_dofs() << "\n"
<< "Number of constraints: " << constraints.n_constraints() << "\n";

  // Output p-refinement level
  Vector p_refinement (tria.n_active_cells());
  unsigned int cell_no = 0;
  for (typename hp::DoFHandler::active_cell_iterator
   cell = dof_handler.begin_active();
   cell != dof_handler.end(); ++cell, ++cell_no)
  {
p_refinement[cell_no] = cell->active_fe_index();
  }

  DataOut > data_out;
  data_out.attach_dof_handler (dof_handler);
  data_out.add_data_vector (p_refinement, "p_refinement_level");
  data_out.build_patches ();
  std::ostringstream filename;
  filename << "solution.vtk";
  std::ofstream output (filename.str().c_str());
  data_out.write_vtk (output);

  return 0;
}


Re: [deal.II] Re: Getting number of hanging support points

2016-08-27 Thread Jean-Paul Pelteret
Ha ha. Dammit, what a silly mistake :-) Thanks Wolfgang!

On Friday, August 26, 2016 at 11:08:17 PM UTC+2, Wolfgang Bangerth wrote:
>
> On 08/25/2016 02:34 AM, Jean-Paul Pelteret wrote: 
> > Hi Deepak, 
> > 
> > Ok, so I've created a minimal working example to demonstrate what you're 
> > seeing here. I'm not sufficiently familiar with the p-refinement part of 
> the 
> > hp functionality/implementation to tell whether this is truly the 
> expected 
> > behaviour or not. I see that the examples and description 
> > <
> https://www.dealii.org/8.4.1/doxygen/deal.II/group__constraints.html#ga3eaa31a679484e80c193e74e8a967dc8>
>  
>
> > in the documentation mix h- and p-refinement, so are _perhaps_ not 
> > sufficiently clear to describe the expected outcome of this 
> configuration. Or 
> > maybe its a bug arising from the adjacent cells being on the same 
> refinement 
> > level (i.e. there are no actual hanging _nodes_). Perhaps someone else 
> could 
> > clarify this? 
>
> It's not a bug but a feature :-) In your code, you call 
>
>
>// Build constraints 
>ConstraintMatrix constraints; 
>DoFTools::make_hanging_node_constraints (dof_handler, 
> constraints); 
>constraints.clear(); // * 
>
> I suspect what you really wanted to call in the last line is 
> 'constraints.close()' -- because if you do so, the result is pretty much 
> what 
> I think you probably wanted ;-) 
>
> Cheers 
>   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] Re: Getting number of hanging support points

2016-08-26 Thread Deepak GUpta

Hi Wolfgang,

Thanks, I figured it out finally. I was assigning a different boundary 
indicator on one boundary of the domain. This was executed before the 
code reached the part of calculating the hanging constraints. When I 
remove that part, the number of constraints shown is non-zero (which is 
correct). However, now I have to figure out why set_boundary_indicator 
affects the number of constraints.


Anyways have a nice weekend.

Best

Deepak


On 27-08-16 03:57, Wolfgang Bangerth wrote:

On 08/26/2016 03:49 PM, Deepak GUpta wrote:

Indeed Wolfgang is right.


Can't help but respond with a smiley ;-)

I'll count that as a win ahead of my weekend!
Cheers
 W.



--
Deepak K. Gupta

PhD Candidate/Researcher
Structural Optimization & Mechanics
TU Delft / Precision & Microsystems Engineering
Faculty of Mechanical, Maritime & Materials Engineering (3mE)
Mekelweg 2, 2628 CD  Delft, The Netherlands

T +31 (0)15 27 86818
d.k.gu...@tudelft.nl

Room 3mE.G.1.150

--
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] Re: Getting number of hanging support points

2016-08-26 Thread Wolfgang Bangerth

On 08/26/2016 03:49 PM, Deepak GUpta wrote:

Indeed Wolfgang is right.


Can't help but respond with a smiley ;-)

I'll count that as a win ahead of my weekend!
Cheers
 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] Re: Getting number of hanging support points

2016-08-26 Thread Deepak GUpta
Indeed Wolfgang is right. With the stated change, the example code of JP 
works now. So I need to relate the error in mine.


Thanks Wolfgang and Jean-Paul for the help.

Best

Deepak

On 26-08-16 23:08, Wolfgang Bangerth wrote:

On 08/25/2016 02:34 AM, Jean-Paul Pelteret wrote:

Hi Deepak,

Ok, so I've created a minimal working example to demonstrate what you're
seeing here. I'm not sufficiently familiar with the p-refinement part 
of the
hp functionality/implementation to tell whether this is truly the 
expected

behaviour or not. I see that the examples and description
 


in the documentation mix h- and p-refinement, so are _perhaps_ not
sufficiently clear to describe the expected outcome of this 
configuration. Or
maybe its a bug arising from the adjacent cells being on the same 
refinement
level (i.e. there are no actual hanging _nodes_). Perhaps someone 
else could

clarify this?


It's not a bug but a feature :-) In your code, you call


  // Build constraints
  ConstraintMatrix constraints;
  DoFTools::make_hanging_node_constraints (dof_handler,
   constraints);
  constraints.clear(); // *

I suspect what you really wanted to call in the last line is 
'constraints.close()' -- because if you do so, the result is pretty 
much what I think you probably wanted ;-)


Cheers
 W.



--
Deepak K. Gupta

PhD Candidate/Researcher
Structural Optimization & Mechanics
TU Delft / Precision & Microsystems Engineering
Faculty of Mechanical, Maritime & Materials Engineering (3mE)
Mekelweg 2, 2628 CD  Delft, The Netherlands

T +31 (0)15 27 86818
d.k.gu...@tudelft.nl

Room 3mE.G.1.150

--
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] Re: Getting number of hanging support points

2016-08-26 Thread Wolfgang Bangerth

On 08/25/2016 02:34 AM, Jean-Paul Pelteret wrote:

Hi Deepak,

Ok, so I've created a minimal working example to demonstrate what you're
seeing here. I'm not sufficiently familiar with the p-refinement part of the
hp functionality/implementation to tell whether this is truly the expected
behaviour or not. I see that the examples and description

in the documentation mix h- and p-refinement, so are _perhaps_ not
sufficiently clear to describe the expected outcome of this configuration. Or
maybe its a bug arising from the adjacent cells being on the same refinement
level (i.e. there are no actual hanging _nodes_). Perhaps someone else could
clarify this?


It's not a bug but a feature :-) In your code, you call


  // Build constraints
  ConstraintMatrix constraints;
  DoFTools::make_hanging_node_constraints (dof_handler,
   constraints);
  constraints.clear(); // *

I suspect what you really wanted to call in the last line is 
'constraints.close()' -- because if you do so, the result is pretty much what 
I think you probably wanted ;-)


Cheers
 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] Re: Getting number of hanging support points

2016-08-25 Thread Deepak GUpta
Thanks Jean-Paul for creating the simple example. I ran the code and 
indeed see that it does say zero constraints for the chosen example, 
although I too do not know much about the hanging support points in 
p-refinement.


Best,

Deepak

On 25-08-16 10:34, Jean-Paul Pelteret wrote:

Hi Deepak,

Ok, so I've created a minimal working example to demonstrate what 
you're seeing here. I'm not sufficiently familiar with the 
p-refinement part of the hp functionality/implementation to tell 
whether this is truly the expected behaviour or not. I see that the 
examples and description 
 
in the documentation mix h- and p-refinement, so are _perhaps_ not 
sufficiently clear to describe the expected outcome of this 
configuration. Or maybe its a bug arising from the adjacent cells 
being on the same refinement level (i.e. there are no actual hanging 
_nodes_). Perhaps someone else could clarify this?


J-P

On Tuesday, August 23, 2016 at 9:45:41 AM UTC+2, Deepak Gupta wrote:

Dear Daniel and others,

Below is the part of my code that might explain better:

*//Below is the constructor for FEM class (a part of my own
library). The part of the code below in BOLD states that I assign
different order shape functions alternatively.*
template
FEM::FEM(
Triangulation &obj_triangulation,
hp::DoFHandler &dof_handler,
DefineMesh &obj_mesh){
this->mesh = &obj_mesh;
this->dof_handler = &dof_handler; // for the state field on
the analysis
this->triangulation = &obj_triangulation;//for the state
field on the analysis

//For Lagrange element
if (mesh->elementType == "FE_Q"){
for (unsigned int degree = 1; degree <=
mesh->max_el_order; ++degree){
   
fe_collection.push_back(FESystem(FE_Q(degree), dim));

}

}
//Quadrature collection for FE
for (unsigned int qrule = 1; qrule <= mesh->max_el_order + 11;
++qrule){
quadrature_collection.push_back(QGauss(qrule));
}
**//initializing the type of element for each cell of analysis mesh*
for (typename hp::DoFHandler::active_cell_iterator cell =
dof_handler.begin_active();
cell != dof_handler.end(); ++cell){
cell->set_active_fe_index(p_index);
++cell;
cell->set_active_fe_index(p_index+2);
}*
}

*//The setup() function is as follows, The line that prints the
no. of constraints is put in BOLD in the code
*template 
void FEM::setup_system(){
//FE mesh
dof_handler->distribute_dofs(fe_collection);
solution.reinit(dof_handler->n_dofs());
system_rhs.reinit(dof_handler->n_dofs());
analysis_density_handler->distribute_dofs(fe_analysis_density_collection);
//Used to add density on every node
hanging_node_constraints.clear();
DoFTools::make_hanging_node_constraints(*dof_handler,
hanging_node_constraints);
hanging_node_constraints.close();

*std::cout<<"No. of hanging node constraints :
"> wrote:

Deepak,

I am aware of the fact that
ConstraintMatrix.n_constraints() gives the number of
hanging nodes for h-refinement, but if I only use
p-refinement, can it give the number of hanging support
points occurring due to the difference in the order of
bases between two adjacent elements? I am expecting this
based on the description of the hp-refinement document.

I have been trying this but always get 0 hanging support
points, although I know that the some elements of the mesh
use Q1, others Q2.

That sounds definitely strange. step-27 uses a hp::DoFHandler
and make_hanging_node_constraints. Do you see that constraints
are created there?
If you can't find a solution looking at that example program,
can you reduce your code to a minimal example showing that no
constraints are created for p-refinement?

Best,
Daniel
-- 
The deal.II project is located at http://www.dealii.org/

For mailing lis

Re: [deal.II] Re: Getting number of hanging support points

2016-08-25 Thread Jean-Paul Pelteret
Hi Deepak,

Ok, so I've created a minimal working example to demonstrate what you're 
seeing here. I'm not sufficiently familiar with the p-refinement part of 
the hp functionality/implementation to tell whether this is truly the 
expected behaviour or not. I see that the examples and description 

 
in the documentation mix h- and p-refinement, so are *perhaps* not 
sufficiently clear to describe the expected outcome of this configuration. 
Or maybe its a bug arising from the adjacent cells being on the same 
refinement level (i.e. there are no actual hanging *nodes*). Perhaps 
someone else could clarify this?

J-P

On Tuesday, August 23, 2016 at 9:45:41 AM UTC+2, Deepak Gupta wrote:
>
> Dear Daniel and others,
>
> Below is the part of my code that might explain better:
>
> *//Below is the constructor for FEM class (a part of my own library). The 
> part of the code below in BOLD states that I assign different order shape 
> functions alternatively.*
> template
> FEM::FEM(
> Triangulation &obj_triangulation,
> hp::DoFHandler &dof_handler,
> DefineMesh &obj_mesh){
> this->mesh = &obj_mesh;
> this->dof_handler = &dof_handler;// for the state field on the 
> analysis
> this->triangulation = &obj_triangulation;//for the state field on 
> the analysis
>
> //For Lagrange element
> if (mesh->elementType == "FE_Q"){
> for (unsigned int degree = 1; degree <= mesh->max_el_order; 
> ++degree){
> fe_collection.push_back(FESystem(FE_Q(degree), dim));
> }
>
> }
> //Quadrature collection for FE
> for (unsigned int qrule = 1; qrule <= mesh->max_el_order + 11; 
> ++qrule){
> quadrature_collection.push_back(QGauss(qrule));
> }
> //initializing the type of element for each cell of analysis mesh
>
>
>
>
>
> * for (typename hp::DoFHandler::active_cell_iterator cell = 
> dof_handler.begin_active(); cell != dof_handler.end(); ++cell){ 
> cell->set_active_fe_index(p_index); ++cell; 
> cell->set_active_fe_index(p_index+2); }*
> }
>
>
> *//The setup() function is as follows, The line that prints the no. of 
> constraints is put in BOLD in the code *template 
> void FEM::setup_system(){
> //FE mesh
> dof_handler->distribute_dofs(fe_collection);
> solution.reinit(dof_handler->n_dofs());
> system_rhs.reinit(dof_handler->n_dofs());
> 
> analysis_density_handler->distribute_dofs(fe_analysis_density_collection);
> //Used to add density on every node
> hanging_node_constraints.clear();
> DoFTools::make_hanging_node_constraints(*dof_handler,
> hanging_node_constraints);
> hanging_node_constraints.close();
>
> *std::cout<<"No. of hanging node constraints : 
> "< DynamicSparsityPattern dsp (dof_handler->n_dofs());
> DoFTools::make_sparsity_pattern (*dof_handler,
>  dsp,
>  hanging_node_constraints,
>  true);
> sparsity_pattern.copy_from(dsp);
> system_matrix.reinit(sparsity_pattern);
> }
>
>
> *OUTPUT: *No. of hanging node constraints : 0
>
>
> * - 
> *Could 
> someone let me know why the no. of constraints is zero. Since the p-order 
> of neighboring elements differ, I would expect constraints here.
>
> Best regards
> Deepak
>
> On Fri, Aug 19, 2016 at 10:51 AM, Daniel Arndt <
> d.ar...@math.uni-goettingen.de> wrote:
>
>> Deepak,
>>
>> I am aware of the fact that ConstraintMatrix.n_constraints() gives the 
>>> number of hanging nodes for h-refinement, but if I only use p-refinement, 
>>> can it give the number of hanging support points occurring due to the 
>>> difference in the order of bases between two adjacent elements? I am 
>>> expecting this based on the description of the hp-refinement document.
>>>
>>> I have been trying this but always get 0 hanging support points, 
>>> although I know that the some elements of the mesh use Q1, others Q2.
>>>
>> That sounds definitely strange. step-27 uses a hp::DoFHandler and 
>> make_hanging_node_constraints. Do you see that constraints are created 
>> there?
>> If you can't find a solution looking at that example program, can you 
>> reduce your code to a minimal example showing that no constraints are 
>> created for p-refinement?
>>
>> Best,
>> Daniel
>> -- 
>> 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/o

Re: [deal.II] Re: Getting number of hanging support points

2016-08-23 Thread deepauck

Dear Daniel and others,

Below is the part of my code that might explain better:

*//Below is the constructor for FEM class (a part of my own library). 
The part of the code below in BOLD states that I assign different order 
shape functions alternatively.*

template
FEM::FEM(
Triangulation &obj_triangulation,
hp::DoFHandler &dof_handler,
DefineMesh &obj_mesh){
this->mesh = &obj_mesh;
this->dof_handler = &dof_handler;// for the state field on the 
analysis
this->triangulation = &obj_triangulation; //for the state field on 
the analysis


//For Lagrange element
if (mesh->elementType == "FE_Q"){
for (unsigned int degree = 1; degree <= mesh->max_el_order; 
++degree){

fe_collection.push_back(FESystem(FE_Q(degree), dim));
}

}
//Quadrature collection for FE
for (unsigned int qrule = 1; qrule <= mesh->max_el_order + 11; 
++qrule){

quadrature_collection.push_back(QGauss(qrule));
}
**//initializing the type of element for each cell of analysis mesh*
for (typename hp::DoFHandler::active_cell_iterator cell = 
dof_handler.begin_active();

cell != dof_handler.end(); ++cell){
cell->set_active_fe_index(p_index);
++cell;
cell->set_active_fe_index(p_index+2);
}*
}

*//The setup() function is as follows, The line that prints the no. of 
constraints is put in BOLD in the code

*template 
void FEM::setup_system(){
//FE mesh
dof_handler->distribute_dofs(fe_collection);
solution.reinit(dof_handler->n_dofs());
system_rhs.reinit(dof_handler->n_dofs());
analysis_density_handler->distribute_dofs(fe_analysis_density_collection); 
//Used to add density on every node

hanging_node_constraints.clear();
DoFTools::make_hanging_node_constraints(*dof_handler,
hanging_node_constraints);
hanging_node_constraints.close();

*std::cout<<"No. of hanging node constraints : 
"<
DynamicSparsityPattern dsp (dof_handler->n_dofs());
DoFTools::make_sparsity_pattern (*dof_handler,
 dsp,
hanging_node_constraints,
 true);
sparsity_pattern.copy_from(dsp);
system_matrix.reinit(sparsity_pattern);
}*
*
*OUTPUT:
*No. of hanging node constraints : 0*
-

*Could someone let me know why the no. of constraints is zero. Since the 
p-order of neighboring elements differ, I would expect constraints here.


Best regards
Deepak

On Fri, Aug 19, 2016 at 10:51 AM, Daniel Arndt 
mailto:d.ar...@math.uni-goettingen.de>> 
wrote:


   Deepak,

   I am aware of the fact that ConstraintMatrix.n_constraints()
   gives the number of hanging nodes for h-refinement, but if I
   only use p-refinement, can it give the number of hanging support
   points occurring due to the difference in the order of bases
   between two adjacent elements? I am expecting this based on the
   description of the hp-refinement document.

   I have been trying this but always get 0 hanging support points,
   although I know that the some elements of the mesh use Q1,
   others Q2.

   That sounds definitely strange. step-27 uses a hp::DoFHandler and
   make_hanging_node_constraints. Do you see that constraints are
   created there?
   If you can't find a solution looking at that example program, can
   you reduce your code to a minimal example showing that no
   constraints are created for p-refinement?

   Best,
   Daniel
   -- 
   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
   .


--
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] Re: Getting number of hanging support points

2016-08-19 Thread Daniel Arndt
Deepak,

I am aware of the fact that ConstraintMatrix.n_constraints() gives the 
> number of hanging nodes for h-refinement, but if I only use p-refinement, 
> can it give the number of hanging support points occurring due to the 
> difference in the order of bases between two adjacent elements? I am 
> expecting this based on the description of the hp-refinement document.
>
> I have been trying this but always get 0 hanging support points, although 
> I know that the some elements of the mesh use Q1, others Q2.
>
That sounds definitely strange. step-27 uses a hp::DoFHandler and 
make_hanging_node_constraints. Do you see that constraints are created 
there?
If you can't find a solution looking at that example program, can you 
reduce your code to a minimal example showing that no constraints are 
created for p-refinement?

Best,
Daniel

-- 
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] Re: Getting number of hanging support points

2016-08-18 Thread Deepak Gupta
Dear All,

I am aware of the fact that ConstraintMatrix.n_constraints() gives the 
number of hanging nodes for h-refinement, but if I only use p-refinement, 
can it give the number of hanging support points occurring due to the 
difference in the order of bases between two adjacent elements? I am 
expecting this based on the description of the hp-refinement document.

I have been trying this but always get 0 hanging support points, although I 
know that the some elements of the mesh use Q1, others Q2.

Thanks,
Deepak


On Tuesday, July 19, 2016 at 9:52:44 AM UTC+2, Matthias Maier wrote:
>
>
> On Tue, Jul 19, 2016, at 02:33 CDT, Jean-Paul Pelteret  > wrote: 
>
> > Dear Deepak, 
> > 
> > To the best of my knowledge, such functionality is not available in the 
> > library because, well, its not the normal type of information that one 
> > would be interested in. So you'll have to write the functionality 
> yourself. 
> > 
> > What have you tried so far? How I would do it is by computing some 
> > information up-front, namely for each FE type (i.e. different 
> combination 
> > of bases), determine the number of support points on a cell face. The 
> > FE::has_support_on_face 
> > <
> https://www.dealii.org/developer/doxygen/deal.II/classFiniteElement.html#af1043fc052fed945f579317f029ad00a>
>  
>
> > function could be of use here, or you could locate the physical position 
> of 
> > the support points on the face and count the number of unique entries. 
> You 
> > could then loop over all cells and their faces, and the number of 
> "hanging" 
> > support points on a single face would be the difference between the 
> values 
> > you've computed *a priori* for the face between the two cells. You'd 
> have 
> > to be careful not to do any double accounting, of course. The tutorials 
> on 
> > hp-refinement as well as DG methods may shed some further light on what 
> > other tools you may require. 
>
> What about creating a ConstraintMatrix object and simply calling 
> make_hanging_node_constraints? After that 
> ConstraintMatrix::n_constraints() returns the total number of 
> constrained DoFs. 
>
> Best, 
> Matthias 
>

-- 
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] Re: Getting number of hanging support points

2016-07-20 Thread Deepak Gupta
Dear All,

Thanks for your replies. Indeed I had thought of the same as suggested by 
Jean and am implementing it. Thanks for helping out.

Best regards
Deepak

On Friday, July 15, 2016 at 2:02:43 PM UTC+2, Deepak Gupta wrote:
>
> Dear All,
>
> I am currently dealing with hanging support points in my problem and I 
> have a couple of questions. These are:
>
> 1. For my case, different elements of the mesh have different polynomial 
> orders of the basis. Due to support points at the element edges, I believe 
> there will be hanging support points. How can I know the total number of 
> these hanging points for the whole mesh?
>
> 2. How can I know the number of hanging support points per element? Since 
> I need to know how many dofs per element are included in the system matrix, 
> I need this number as well.
>
> I hope my questions are clear and looking forward for a suggestion on 
> solving it.
>
> Best regards
> -- 
> *Deepak K. Gupta*
>
>

-- 
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] Re: Getting number of hanging support points

2016-07-19 Thread Matthias Maier

> This was what I initially thought Deepak wanted, but he's doing 
> p-refinement, so these aren't actually hanging nodes that he's querying.

Ah, IC.

-- 
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] Re: Getting number of hanging support points

2016-07-19 Thread Jean-Paul Pelteret
Hi Matthias,

This was what I initially thought Deepak wanted, but he's doing 
p-refinement, so these aren't actually hanging nodes that he's querying.

J-P

On Tuesday, July 19, 2016 at 9:52:44 AM UTC+2, Matthias Maier wrote:
>
>
> On Tue, Jul 19, 2016, at 02:33 CDT, Jean-Paul Pelteret <> wrote: 
>
> > Dear Deepak, 
> > 
> > To the best of my knowledge, such functionality is not available in the 
> > library because, well, its not the normal type of information that one 
> > would be interested in. So you'll have to write the functionality 
> yourself. 
> > 
> > What have you tried so far? How I would do it is by computing some 
> > information up-front, namely for each FE type (i.e. different 
> combination 
> > of bases), determine the number of support points on a cell face. The 
> > FE::has_support_on_face 
> > <
> https://www.dealii.org/developer/doxygen/deal.II/classFiniteElement.html#af1043fc052fed945f579317f029ad00a>
>  
>
> > function could be of use here, or you could locate the physical position 
> of 
> > the support points on the face and count the number of unique entries. 
> You 
> > could then loop over all cells and their faces, and the number of 
> "hanging" 
> > support points on a single face would be the difference between the 
> values 
> > you've computed *a priori* for the face between the two cells. You'd 
> have 
> > to be careful not to do any double accounting, of course. The tutorials 
> on 
> > hp-refinement as well as DG methods may shed some further light on what 
> > other tools you may require. 
>
> What about creating a ConstraintMatrix object and simply calling 
> make_hanging_node_constraints? After that 
> ConstraintMatrix::n_constraints() returns the total number of 
> constrained DoFs. 
>
> Best, 
> Matthias 
>

-- 
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] Re: Getting number of hanging support points

2016-07-19 Thread Matthias Maier

On Tue, Jul 19, 2016, at 02:33 CDT, Jean-Paul Pelteret  
wrote:

> Dear Deepak,
>
> To the best of my knowledge, such functionality is not available in the 
> library because, well, its not the normal type of information that one 
> would be interested in. So you'll have to write the functionality yourself. 
>
> What have you tried so far? How I would do it is by computing some 
> information up-front, namely for each FE type (i.e. different combination 
> of bases), determine the number of support points on a cell face. The 
> FE::has_support_on_face 
> 
> function could be of use here, or you could locate the physical position of 
> the support points on the face and count the number of unique entries. You 
> could then loop over all cells and their faces, and the number of "hanging" 
> support points on a single face would be the difference between the values 
> you've computed *a priori* for the face between the two cells. You'd have 
> to be careful not to do any double accounting, of course. The tutorials on 
> hp-refinement as well as DG methods may shed some further light on what 
> other tools you may require.

What about creating a ConstraintMatrix object and simply calling
make_hanging_node_constraints? After that
ConstraintMatrix::n_constraints() returns the total number of
constrained DoFs.

Best,
Matthias

-- 
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] Re: Getting number of hanging support points

2016-07-19 Thread Jean-Paul Pelteret
Dear Deepak,

To the best of my knowledge, such functionality is not available in the 
library because, well, its not the normal type of information that one 
would be interested in. So you'll have to write the functionality yourself. 

What have you tried so far? How I would do it is by computing some 
information up-front, namely for each FE type (i.e. different combination 
of bases), determine the number of support points on a cell face. The 
FE::has_support_on_face 

 
function could be of use here, or you could locate the physical position of 
the support points on the face and count the number of unique entries. You 
could then loop over all cells and their faces, and the number of "hanging" 
support points on a single face would be the difference between the values 
you've computed *a priori* for the face between the two cells. You'd have 
to be careful not to do any double accounting, of course. The tutorials on 
hp-refinement as well as DG methods may shed some further light on what 
other tools you may require.

I hope that this helps get you started.
J-P

On Sunday, July 17, 2016 at 3:31:07 PM UTC+2, Deepak Gupta wrote:
>
>
> Dear All,
>
> Since I didn't receive any response to my question, I thought of raising 
> it up as a reminder if someone can help.
>
> Best
> Deepak 
>
> On Friday, July 15, 2016 at 2:02:43 PM UTC+2, Deepak Gupta wrote:
>>
>> Dear All,
>>
>> I am currently dealing with hanging support points in my problem and I 
>> have a couple of questions. These are:
>>
>> 1. For my case, different elements of the mesh have different polynomial 
>> orders of the basis. Due to support points at the element edges, I believe 
>> there will be hanging support points. How can I know the total number of 
>> these hanging points for the whole mesh?
>>
>> 2. How can I know the number of hanging support points per element? Since 
>> I need to know how many dofs per element are included in the system matrix, 
>> I need this number as well.
>>
>> I hope my questions are clear and looking forward for a suggestion on 
>> solving it.
>>
>> Best regards
>> -- 
>> *Deepak K. Gupta*
>>
>>

-- 
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.