Skip to content

Commit 6e56cbd

Browse files
authored
Remove warnings out of a few tests (chaos-polymtl#1601)
Description There were still some warnings in some of the unit tests. I found them while compiling with warning as error. Solution Eliminates a bunch of warnings in the tests. Nothing special Testing All tests still pass, nothing has changed. Documentation Nothing to change here
1 parent d839c2f commit 6e56cbd

File tree

10 files changed

+23
-16
lines changed

10 files changed

+23
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
99

1010
- MINOR Add "max refinement level" parameter to "uniform" mesh adaptation method. Before, transient simulations would have meshes being refined indefinitely. This PR fixes this, adds an application test, and adds an assertion to avoid the use of uniform mesh adaptation with simplex meshes. [#1599](https://github.com/chaos-polymtl/lethe/pull/1599)
1111

12+
### Fixed
13+
14+
- MINOR Remove some compilation warning in some of the unit tests for mortar and core. [#1601](https://github.com/chaos-polymtl/lethe/pull/1601)
15+
1216
### [Master] - 2025-07-25
1317

1418
### Added

tests/core/lethe_grid_tool_mesh_cut_by_flat_2.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright (c) 2021-2022, 2024 The Lethe Authors
1+
// SPDX-FileCopyrightText: Copyright (c) 2021-2025 The Lethe Authors
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
33

44
// Deal.II includes
@@ -40,7 +40,7 @@ test()
4040
DoFHandler<2> dof_handler;
4141
DoFHandler<1, 2> flat_dof_handler;
4242

43-
FlatManifold<1, 2> flat_manifold();
43+
FlatManifold<1, 2> flat_manifold;
4444

4545

4646
// Mesh

tests/mortar/manager_03.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ main(int argc, char **argv)
217217
TrilinosWrappers::SparsityPattern dsp;
218218

219219
dsp.reinit(dof_handler.locally_owned_dofs(),
220-
dof_handler.get_communicator());
220+
dof_handler.get_mpi_communicator());
221221

222222
DoFTools::make_flux_sparsity_pattern(dof_handler, dsp, constraints);
223223

@@ -367,7 +367,7 @@ main(int argc, char **argv)
367367
TrilinosWrappers::SparsityPattern dsp;
368368

369369
dsp.reinit(dof_handler.locally_owned_dofs(),
370-
dof_handler.get_communicator());
370+
dof_handler.get_mpi_communicator());
371371

372372
DoFTools::make_flux_sparsity_pattern(dof_handler, dsp, constraints);
373373
coupling_operator.add_sparsity_pattern_entries(dsp);

tests/mortar/manager_04.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ main(int argc, char **argv)
190190
TrilinosWrappers::SparsityPattern dsp;
191191

192192
dsp.reinit(dof_handler.locally_owned_dofs(),
193-
dof_handler.get_communicator());
193+
dof_handler.get_mpi_communicator());
194194

195195
DoFTools::make_flux_sparsity_pattern(dof_handler, dsp, constraints);
196196

@@ -326,7 +326,7 @@ main(int argc, char **argv)
326326
TrilinosWrappers::SparsityPattern dsp;
327327

328328
dsp.reinit(dof_handler.locally_owned_dofs(),
329-
dof_handler.get_communicator());
329+
dof_handler.get_mpi_communicator());
330330

331331
DoFTools::make_flux_sparsity_pattern(dof_handler, dsp, constraints);
332332
coupling_operator.add_sparsity_pattern_entries(dsp);

tests/mortar/plot_01.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ output_mesh(const Triangulation<dim, spacedim> &tria,
4747
data_out.attach_triangulation(tria);
4848

4949
Vector<double> vector(tria.n_active_cells());
50-
vector = Utilities::MPI::this_mpi_process(tria.get_communicator());
50+
vector = Utilities::MPI::this_mpi_process(tria.get_mpi_communicator());
5151
data_out.add_data_vector(vector, "ranks");
5252

5353
data_out.build_patches(
5454
mapping,
5555
mapping_degree + 1,
5656
DataOut<dim, spacedim>::CurvedCellRegion::curved_inner_cells);
5757

58-
data_out.write_vtu_in_parallel(file_name, tria.get_communicator());
58+
data_out.write_vtu_in_parallel(file_name, tria.get_mpi_communicator());
5959
}
6060

6161
template <int dim, int spacedim>

tests/mortar/tests.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ class OperatorBase : public Subscriptor
610610
TrilinosWrappers::SparsityPattern dsp;
611611

612612
dsp.reinit(dof_handler.locally_owned_dofs(),
613-
dof_handler.get_communicator());
613+
dof_handler.get_mpi_communicator());
614614

615615
DoFTools::make_sparsity_pattern(dof_handler, dsp, *constraints);
616616

@@ -1022,7 +1022,7 @@ class GeneralStokesOperator : public Subscriptor
10221022
TrilinosWrappers::SparsityPattern dsp;
10231023

10241024
dsp.reinit(dof_handler.locally_owned_dofs(),
1025-
dof_handler.get_communicator());
1025+
dof_handler.get_mpi_communicator());
10261026

10271027
DoFTools::make_sparsity_pattern(dof_handler, dsp, *constraints);
10281028

@@ -1390,7 +1390,7 @@ class PoissonOperatorDG : public Subscriptor
13901390
TrilinosWrappers::SparsityPattern dsp;
13911391

13921392
dsp.reinit(dof_handler.locally_owned_dofs(),
1393-
dof_handler.get_communicator());
1393+
dof_handler.get_mpi_communicator());
13941394

13951395
DoFTools::make_flux_sparsity_pattern(dof_handler, dsp, *constraints);
13961396

@@ -1823,7 +1823,7 @@ class GeneralStokesOperatorDG : public Subscriptor
18231823
TrilinosWrappers::SparsityPattern dsp;
18241824

18251825
dsp.reinit(dof_handler.locally_owned_dofs(),
1826-
dof_handler.get_communicator());
1826+
dof_handler.get_mpi_communicator());
18271827

18281828
DoFTools::make_flux_sparsity_pattern(dof_handler, dsp, *constraints);
18291829

tests/solvers/physical_properties_manager_01.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright (c) 2022-2023 The Lethe Authors
1+
// SPDX-FileCopyrightText: Copyright (c) 2022-2025 The Lethe Authors
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
33

44
/**
@@ -23,6 +23,7 @@ test()
2323
physical_properties.number_of_fluids = 1;
2424
physical_properties.number_of_solids = 0;
2525
physical_properties.number_of_material_interactions = 0;
26+
physical_properties.reference_temperature = 0;
2627
physical_properties.fluids.resize(1);
2728
physical_properties.fluids[0].density_model =
2829
Parameters::Material::DensityModel::constant;

tests/solvers/physical_properties_manager_02.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright (c) 2023 The Lethe Authors
1+
// SPDX-FileCopyrightText: Copyright (c) 2023-2025 The Lethe Authors
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
33

44
/**
@@ -24,6 +24,7 @@ test()
2424
physical_properties.number_of_fluids = 1;
2525
physical_properties.number_of_solids = 1;
2626
physical_properties.number_of_material_interactions = 1;
27+
physical_properties.reference_temperature = 0;
2728

2829

2930
// Generate fluid properties

tests/solvers/physical_properties_manager_03.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright (c) 2023 The Lethe Authors
1+
// SPDX-FileCopyrightText: Copyright (c) 2023-2025 The Lethe Authors
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
33

44
/**
@@ -25,6 +25,7 @@ test()
2525
physical_properties.number_of_fluids = 2;
2626
physical_properties.number_of_solids = 2;
2727
physical_properties.number_of_material_interactions = 5;
28+
physical_properties.reference_temperature = 0;
2829

2930
physical_properties.fluids.resize(2);
3031
physical_properties.solids.resize(2);

tests/solvers/restart_01.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ RestartNavierStokes<dim>::run()
104104
this->exact_solution = new ExactSolutionMMS<dim>;
105105
this->forcing_function = std::make_shared<MMSSineForcingFunction<dim>>();
106106
Parameters::PhysicalProperties physical_properties;
107-
physical_properties.fluids.emplace_back(Parameters::Material());
107+
physical_properties.fluids.resize(1);
108108
physical_properties.number_of_fluids = 1;
109109
physical_properties.fluids[0].rheological_model =
110110
Parameters::Material::RheologicalModel::newtonian;

0 commit comments

Comments
 (0)