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 some GCC-12 warnings. #13736

Merged
merged 2 commits into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions include/deal.II/base/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-private-field\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
_Pragma("GCC diagnostic ignored \"-Wuse-after-free\"") \
_Pragma("GCC diagnostic warning \"-Wpragmas\"") /*!*/

# define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS \
Expand Down
19 changes: 7 additions & 12 deletions source/distributed/fully_distributed_tria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,34 +256,29 @@ namespace parallel
const dealii::Triangulation<dim, spacedim> *other_tria_ptr = &other_tria;

// temporary serial triangulation (since the input triangulation is const
// and we might modify its subdomain_ids
// and level_subdomain_ids during partitioning); this pointer only points
// to anything if the source triangulation is serial, and ensures that our
// copy is eventually deleted
std::unique_ptr<dealii::Triangulation<dim, spacedim>> serial_tria;
// and we might modify its subdomain_ids and level_subdomain_ids during
// partitioning)
dealii::Triangulation<dim, spacedim> serial_tria;

// check if other triangulation is not a parallel one, which needs to be
// partitioned
if (dynamic_cast<const dealii::parallel::TriangulationBase<dim, spacedim>
*>(&other_tria) == nullptr)
{
serial_tria =
std::make_unique<dealii::Triangulation<dim, spacedim>>();

// actually copy the serial triangulation
serial_tria->copy_triangulation(other_tria);
serial_tria.copy_triangulation(other_tria);

// partition triangulation
this->partitioner(*serial_tria,
this->partitioner(serial_tria,
dealii::Utilities::MPI::n_mpi_processes(
this->mpi_communicator));

// partition multigrid levels
if (this->is_multilevel_hierarchy_constructed())
GridTools::partition_multigrid_levels(*serial_tria);
GridTools::partition_multigrid_levels(serial_tria);

// use the new serial triangulation to create the construction data
other_tria_ptr = serial_tria.get();
other_tria_ptr = &serial_tria;
}

// create construction data
Expand Down
7 changes: 5 additions & 2 deletions source/fe/fe_rt_bubbles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,11 @@ FE_RT_Bubbles<dim>::initialize_support_points(const unsigned int deg)
// one for each direction
QGaussLobatto<1> high(deg + 1);
std::vector<Point<1>> pts = high.get_points();
pts.erase(pts.begin());
pts.erase(pts.end() - 1);
if (pts.size() > 2)
{
pts.erase(pts.begin());
pts.erase(pts.end() - 1);
}

std::vector<double> wts(pts.size(), 1);
Quadrature<1> low(pts, wts);
Expand Down