Hello,

You are using a non-ghosted vector. You need to created a ghosted vector 
and they assign the non-ghosted vector to the ghosted one.

Best,

Bruno

On Thursday, April 20, 2023 at 7:07:09 AM UTC-4 Abbas wrote:

> I am trying to querry for the jump in  my solution with 
> "get_jump_in_function_values" 
>  . My solution vector is PETSc distributed. When I run a code that's like 
> the one below:
>
> template <int dim>
> void output_jumps<dim>::interface_jump()
> {
>
> QGauss<dim - 1> face_quadrature_formula(degree + 1);
>
> FEInterfaceValues<dim> fe_iv(fe,
> face_quadrature_formula,
> UpdateFlags(update_values |
> update_gradients |
> update_quadrature_points |
> update_normal_vectors |
> update_JxW_values));
>
> const unsigned int n_face_q_points = face_quadrature_formula.size();
>
> std::vector<Tensor<2, dim>> gradu(n_face_q_points);
>
> typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.
> begin_active(), endc = dof_handler.end();
>
>
> const FEValuesExtractors::Vector displacements(0);
>
>
> for (; cell != endc; ++cell)
> if (cell->is_locally_owned())
> for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++
> face)
> if (cell->face(face)->user_flag_set())
> {
> // I want to visit the face only once
> cell->face(face)->clear_user_flag();
>
> auto cellnb = cell->neighbor(face);
> int nface_number = cell->neighbor_face_no(face);
>
> fe_iv.reinit(cell, face, numbers::invalid_unsigned_int, cellnb, 
> nface_number, numbers::invalid_unsigned_int);
>
> // This line breaks running code in parallel
> fe_iv[displacements].get_jump_in_function_values(current_solution, jumpu);
> }
> }
>
> I get the error: 
>     "You tried to access element 512 of a distributed vector, but only
>     elements in range [0,511] are stored locally and can be accessed."
>
> How can I access the ghost entries to calculate the jump in my solution?
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6ec9e5c8-e8e8-4f03-8ff1-ce6a514a80fen%40googlegroups.com.

Reply via email to