Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix computation of volume of agglomerate: just use BBox #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/agglomeration_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,9 @@ class AgglomerationHandler : public Subscriptor

/**
*
* Compute the volume of an agglomerate. This @p cell argument takes the
* deal.II cell that identifies an agglomerate. If it's a standard cell,
* Compute the volume of an agglomerate by computing the volume of the
* bounding box enclosing the agglomerate. This @p cell argument takes
* the deal.II cell that identifies an agglomerate. If it's a standard cell,
* than the this function is equivalent to cell->volume(). An exception is
* thrown is the given cell is a slave cell.
*/
Expand Down
28 changes: 4 additions & 24 deletions src/agglomeration_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,7 @@ AgglomerationHandler<dim, spacedim>::reinit_master(

agglo_isv_ptr =
std::make_unique<NonMatching::FEImmersedSurfaceValues<spacedim>>(
*euler_mapping,
*fe,
surface_quad,
agglomeration_face_flags);
*euler_mapping, *fe, surface_quad, agglomeration_face_flags);

agglo_isv_ptr->reinit(cell);

Expand Down Expand Up @@ -693,27 +690,10 @@ AgglomerationHandler<dim, spacedim>::volume(
ExcMessage("The present function cannot be called for slave cells."));

if (is_master_cell(cell))
{
// Get the agglomerate
std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>
agglo_cells = get_slaves_of_idx(cell->active_cell_index());
// Push back master cell
agglo_cells.push_back(cell);

Quadrature<dim> quad =
agglomerated_quadrature(agglo_cells,
QGauss<dim>{2 * fe->degree + 1},
cell);

return std::accumulate(quad.get_weights().begin(),
quad.get_weights().end(),
0.);
}
return bboxes[cell->active_cell_index()].volume();
else
{
// Standard deal.II way to get the measure of a cell.
return cell->measure();
}
// Standard deal.II way to get the measure of a cell.
return cell->measure();
}


Expand Down
Loading