Skip to content

Commit

Permalink
Merge pull request #13736 from drwells/gcc-12-warnings
Browse files Browse the repository at this point in the history
Fix some GCC-12 warnings.
  • Loading branch information
kronbichler committed May 15, 2022
2 parents c3a616a + f833852 commit f634c2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
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

0 comments on commit f634c2f

Please sign in to comment.