On using project_boundary_values_div_conforming for (RT-DG) in parallel case

44 views
Skip to first unread message

Charlie Z

unread,
Sep 11, 2019, 10:49:31 AM9/11/19
to deal.II User Group
Hi there,

I'm trying to make step-20 parallel through trilinos (by following step-40/55), but haven't succeeded. In setup_system() function, I set owned_partitioning, relevant_partitioning and constraints in the following way:

dof_handler.distribute_dofs (fe);

DoFRenumbering::component_wise(dof_handler);
std::vector<types::global_dof_index> dofs_per_component(dim + 1);
DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
const unsigned int n_u = dofs_per_component[0],
                   n_p = dofs_per_component[dim];
std::cout << "Number of active cells: " << triangulation.n_active_cells()
      << std::endl
      << "Total number of cells: " << triangulation.n_cells()
      << std::endl
      << "Number of degrees of freedom: " << dof_handler.n_dofs()
      << " (" << n_u << '+' << n_p << ')' << std::endl;

owned_partitioning.resize(2);
owned_partitioning[0] = dof_handler.locally_owned_dofs ().get_view(0, n_u);
owned_partitioning[1] = dof_handler.locally_owned_dofs ().get_view(n_u, n_u+n_p);

IndexSet locally_relevant_dofs;
DoFTools::extract_locally_relevant_dofs (dof_handler,
                                         locally_relevant_dofs);

relevant_partitioning.resize(2);
relevant_partitioning[0] = locally_relevant_dofs.get_view(0, n_u);
relevant_partitioning[1] = locally_relevant_dofs.get_view(n_u, n_u+n_p);


constraints.reinit (locally_relevant_dofs);
DoFTools::make_hanging_node_constraints (dof_handler, constraints);

VectorTools::project_boundary_values_div_conforming(dof_handler,
                                                    0,
                                                    ZeroFunction<dim>(dim),
                                                    0,
                                                    constraints);
constraints.close ();

The code runs fine in serial; In parallel, however, it gives the following error:

An error occurred in line <1721> of file <../include/deal.II/lac/constraint_matrix.h> in function
    dealii::types::global_dof_index dealii::ConstraintMatrix::calculate_line_index(dealii::ConstraintMatrix::size_type) const
The violated condition was: 
    local_lines.is_element(line)
Additional information: 
    The index set given to this constraint matrix indicates constraints for degree of freedom 4294967295 should not be stored by this object, but a constraint is being added.

The error comes from the call to project_boundary_values_div_conforming, but I'm not sure why. Could you please give me a hint?

Attached is a minimal, reproducible code.

Thanks,
Charlie

Charlie Z

unread,
Sep 11, 2019, 10:54:31 AM9/11/19
to deal.II User Group
The minimal code.
test.cc
CMakeLists.txt

Konrad

unread,
Sep 11, 2019, 1:43:45 PM9/11/19
to deal.II User Group
Hi Charlie, 

I can compile and run it. Could there be a problem with your deal.ii setup? I am using v9.1.1. 

Best,
Konrad

Charlie Z

unread,
Sep 12, 2019, 11:22:28 AM9/12/19
to deal.II User Group
Hi Konrad,

Thanks for your reminder. After upgrading to v9.1.1, everything goes well now. It seems an issue of the last version of dealii and has already been fixed: https://github.com/dealii/dealii/pull/7327 .

Regards,
Charlie
Reply all
Reply to author
Forward
0 new messages