Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrum committed Apr 27, 2024
1 parent 44bff5b commit dd90e19
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 30 deletions.
8 changes: 4 additions & 4 deletions include/deal.II/non_matching/fe_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ namespace NonMatching
*/
void
reinit(const TriaIterator<CellAccessor<dim, dim>> &cell,
const unsigned int q_index = numbers::invalid_unsigned_int,
const unsigned int mapping_index = numbers::invalid_unsigned_int,
const unsigned int active_fe_index = numbers::invalid_unsigned_int);
const unsigned int q_index = numbers::invalid_unsigned_int,
const unsigned int mapping_index = numbers::invalid_unsigned_int,
const unsigned int fe_index = numbers::invalid_unsigned_int);

/**
* Return an dealii::FEValues object reinitialized with a quadrature for the
Expand Down Expand Up @@ -286,7 +286,7 @@ namespace NonMatching
reinit_internal(const CellIteratorType &cell,
const unsigned int q_index,
const unsigned int mapping_index,
const unsigned int active_fe_index);
const unsigned int fe_index);

/**
* Do work common to the constructors. The incoming QCollection should be
Expand Down
62 changes: 36 additions & 26 deletions source/non_matching/fe_values.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ namespace NonMatching
FEValues<dim>::reinit(const TriaIterator<CellAccessor<dim, dim>> &cell,
const unsigned int q_index,
const unsigned int mapping_index,
const unsigned int active_fe_index)
const unsigned int fe_index)
{
this->reinit_internal(cell, q_index, mapping_index, active_fe_index);
this->reinit_internal(cell, q_index, mapping_index, fe_index);
}


Expand All @@ -178,28 +178,38 @@ namespace NonMatching
FEValues<dim>::reinit_internal(const CellIteratorType &cell,
const unsigned int q_index_in,
const unsigned int mapping_index_in,
const unsigned int active_fe_index_in)
const unsigned int fe_index_in)
{
current_cell_location = mesh_classifier->location_to_level_set(cell);
this->active_fe_index = active_fe_index_in;

const unsigned int mapping_index =
mapping_collection->size() > 1 ?
(mapping_index_in != numbers::invalid_unsigned_int ? mapping_index_in :
active_fe_index) :
0;

const unsigned int q_index =
fe_values_inside_full_quadrature.size() > 1 ?
(q_index_in != numbers::invalid_unsigned_int ? q_index_in :
active_fe_index) :
0;

const unsigned int q_index_1D =
q_collection_1D.size() > 1 ?
(q_index_in != numbers::invalid_unsigned_int ? q_index_in :
active_fe_index) :
0;
this->active_fe_index = fe_index_in;

unsigned int mapping_index = mapping_index_in;
unsigned int q_index = q_index_in;
unsigned int q_index_1D = q_index_in;

if (mapping_index == numbers::invalid_unsigned_int)
{
if (mapping_collection->size() > 1)
mapping_index = active_fe_index;
else
mapping_index = 0;
}

if (q_index == numbers::invalid_unsigned_int)
{
if (fe_values_inside_full_quadrature.size() > 1)
q_index = active_fe_index;
else
q_index = 0;
}

if (q_index_1D == numbers::invalid_unsigned_int)
{
if (q_collection_1D.size() > 1)
q_index_1D = active_fe_index;
else
q_index_1D = 0;
}

// These objects were created with a quadrature based on the previous cell
// and are thus no longer valid.
Expand All @@ -211,16 +221,16 @@ namespace NonMatching
{
case LocationToLevelSet::inside:
{
AssertDimension(active_fe_index, mapping_index);
AssertDimension(active_fe_index, q_index);
Assert(active_fe_index == mapping_index, ExcNotImplemented());
Assert(active_fe_index == q_index, ExcNotImplemented());

fe_values_inside_full_quadrature.at(q_index)->reinit(cell);
break;
}
case LocationToLevelSet::outside:
{
AssertDimension(active_fe_index, mapping_index);
AssertDimension(active_fe_index, q_index);
Assert(active_fe_index == mapping_index, ExcNotImplemented());
Assert(active_fe_index == q_index, ExcNotImplemented());

fe_values_outside_full_quadrature.at(q_index)->reinit(cell);
break;
Expand Down

0 comments on commit dd90e19

Please sign in to comment.