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<int dim>
FEM<dim>::FEM(
        Triangulation<dim> &obj_triangulation,
        hp::DoFHandler<dim> &dof_handler,
        DefineMesh<dim> &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<dim>(FE_Q<dim>(degree), dim));
        }

    }
    //Quadrature collection for FE
for (unsigned int qrule = 1; qrule <= mesh->max_el_order + 11; ++qrule){
quadrature_collection.push_back(QGauss<dim>(qrule));
    }
**//initializing the type of element for each cell of analysis mesh*
for (typename hp::DoFHandler<dim>::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 <int dim>
void FEM<dim>::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 : "<<hanging_node_constraints.n_constraints()<<std::endl;*
    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 <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
   <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
   <mailto:dealii+unsubscr...@googlegroups.com>.
   For more options, visit https://groups.google.com/d/optout
   <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.

Reply via email to