Skip to content

Commit

Permalink
Introduce is_cell_neighbor flag to select correct code path
Browse files Browse the repository at this point in the history
  • Loading branch information
bergbauer committed Nov 18, 2021
1 parent 7dedee9 commit 1d5fb27
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions include/deal.II/matrix_free/fe_evaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,9 @@ class FEEvaluationBaseData

/**
* Flag holding information whether a face is an interior or exterior face
* according to the defined direction of the normal. Not used for cells.
* according to the defined direction of the normal. For cells it defines if
* the dof values should be read from the actual cell corresponding to the
* interior face or the neighboring cell corresponding to the exterior face
*/
bool is_interior_face;

Expand Down Expand Up @@ -3964,10 +3966,13 @@ FEEvaluationBaseData<dim, Number, is_face, VectorizedArrayType>::
for (unsigned int i = 0; i < v_len; ++i)
cells[i] = numbers::invalid_unsigned_int;

if (is_face &&
this->dof_access_index ==
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell &&
this->is_interior_face == false)
const bool is_cell_neighbor = !is_face && !this->is_interior_face;

if ((is_face &&
this->dof_access_index ==
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell &&
this->is_interior_face == false) ||
is_cell_neighbor)
{
// cell-based face-loop: plus face
for (unsigned int i = 0; i < v_len; ++i)
Expand Down Expand Up @@ -4920,6 +4925,8 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
const std::vector<unsigned int> &dof_indices_cont =
this->dof_info->dof_indices_contiguous[ind];

const bool is_cell_neighbor = !is_face && !this->is_interior_face;

// Simple case: We have contiguous storage, so we can simply copy out the
// data
if ((this->dof_info->index_storage_variants[ind][this->cell] ==
Expand All @@ -4929,7 +4936,8 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
!(is_face &&
this->dof_access_index ==
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell &&
this->is_interior_face == false))
this->is_interior_face == false) &&
(is_cell_neighbor == false))
{
const unsigned int dof_index =
dof_indices_cont[this->cell * VectorizedArrayType::size()] +
Expand Down Expand Up @@ -4963,9 +4971,10 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
this->dof_info->n_vectorization_lanes_filled[ind][this->cell];

const bool is_ecl =
this->dof_access_index ==
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell &&
this->is_interior_face == false;
(this->dof_access_index ==
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell &&
this->is_interior_face == false) ||
is_cell_neighbor;

if (vectors_sm[0] != nullptr)
{
Expand Down

0 comments on commit 1d5fb27

Please sign in to comment.