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

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<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 <mailto:dealii+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

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

Reply via email to