#
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wall")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wextra")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wfloat-conversion")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Woverloaded-virtual")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wpointer-arith")
-ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wwrite-strings")
-ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wsynth")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wsign-compare")
-ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wswitch")
-ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Woverloaded-virtual")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wsuggest-override")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wswitch")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wsynth")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wwrite-strings")
#
# Disable Wplacement-new that will trigger a lot of warnings
std::cout << " SLV " << std::flush;
if (parameters.type_lin == "CG")
{
- const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
- parameters.max_iterations_lin;
+ const int solver_its =
+ static_cast<int>(tangent_matrix.block(u_dof, u_dof).m() *
+ parameters.max_iterations_lin);
const double tol_sol =
parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
preconditioner_K_Jp_inv.use_matrix(
tangent_matrix.block(J_dof, p_dof));
ReductionControl solver_control_K_Jp_inv(
- tangent_matrix.block(J_dof, p_dof).m() *
- parameters.max_iterations_lin,
+ static_cast<unsigned int>(tangent_matrix.block(J_dof, p_dof).m() *
+ parameters.max_iterations_lin),
1.0e-30,
parameters.tol_lin);
SolverSelector<Vector<double>> solver_K_Jp_inv;
preconditioner_K_con_inv.use_matrix(
tangent_matrix.block(u_dof, u_dof));
ReductionControl solver_control_K_con_inv(
- tangent_matrix.block(u_dof, u_dof).m() *
- parameters.max_iterations_lin,
+ static_cast<unsigned int>(tangent_matrix.block(u_dof, u_dof).m() *
+ parameters.max_iterations_lin),
1.0e-30,
parameters.tol_lin);
SolverSelector<Vector<double>> solver_K_con_inv;
const_cast<
PreconditionChebyshev<MatrixType, VectorType, PreconditionerType> *>(
this)
- ->data.degree = 1 + std::log(1. / eps + std::sqrt(1. / eps / eps - 1)) /
- std::log(1. / sigma);
+ ->data.degree =
+ 1 + static_cast<unsigned int>(
+ std::log(1. / eps + std::sqrt(1. / eps / eps - 1)) /
+ std::log(1. / sigma));
}
const_cast<
norm2, 0, vec_size, norm_square, thread_loop_partitioner);
if (numbers::is_finite(norm_square) &&
norm_square >= std::numeric_limits<real_type>::min())
- return std::sqrt(norm_square);
+ return static_cast<typename Vector<Number>::real_type>(
+ std::sqrt(norm_square));
else
{
real_type scale = 0.;
numbers::NumberTraits<Number>::abs(values[i]);
if (scale < abs_x)
{
- sum = 1. + sum * (scale / abs_x) * (scale / abs_x);
+ sum = 1 + sum * (scale / abs_x) * (scale / abs_x);
scale = abs_x;
}
else
}
}
AssertIsFinite(scale * std::sqrt(sum));
- return scale * std::sqrt(sum);
+ return static_cast<typename Vector<Number>::real_type>(scale *
+ std::sqrt(sum));
}
}
// compress out very small values
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int e = 0; e < dim; ++e)
- if (std::fabs(jac_0[d][e]))
+ if (std::fabs(jac_0[d][e]) != 0.)
cell_data.const_jac[d][e][j] = jac_0[d][e];
continue;
}
// steps may not be sufficient, since roundoff errors may accumulate for
// badly conditioned matrices. This behavior can be observed, e.g. for
// FE_Q_Hierarchical for degree higher than three.
- ReductionControl control(6. * rhs.size(), 0., 1e-12, false, false);
+ ReductionControl control(6 * rhs.size(), 0., 1e-12, false, false);
SolverCG<LinearAlgebra::distributed::Vector<Number>> cg(control);
PreconditionJacobi<MatrixType> preconditioner;
preconditioner.initialize(mass_matrix, 1.);
// steps may not be sufficient, since roundoff errors may accumulate for
// badly conditioned matrices. This behavior can be observed, e.g. for
// FE_Q_Hierarchical for degree higher than three.
- ReductionControl control(5. * rhs.size(), 0., 1e-12, false, false);
+ ReductionControl control(5 * rhs.size(), 0., 1e-12, false, false);
SolverCG<LinearAlgebra::distributed::Vector<Number>> cg(control);
typename PreconditionJacobi<MatrixType>::AdditionalData data(0.8);
PreconditionJacobi<MatrixType> preconditioner;
// steps may not be sufficient, since roundoff errors may accumulate for
// badly conditioned matrices. This behavior can be observed, e.g. for
// FE_Q_Hierarchical for degree higher than three.
- ReductionControl control(5. * rhs.size(), 0., 1e-12, false, false);
+ ReductionControl control(5 * rhs.size(), 0., 1e-12, false, false);
SolverCG<LinearAlgebra::distributed::Vector<Number>> cg(control);
typename PreconditionJacobi<MatrixType>::AdditionalData data(0.8);
PreconditionJacobi<MatrixType> preconditioner;
// steps may not be sufficient, since roundoff errors may accumulate for
// badly conditioned matrices. This behavior can be observed, e.g. for
// FE_Q_Hierarchical for degree higher than three.
- ReductionControl control(5. * rhs.size(), 0., 1.e-12, false, false);
+ ReductionControl control(5 * rhs.size(), 0., 1.e-12, false, false);
GrowingVectorMemory<Vector<number>> memory;
SolverCG<Vector<number>> cg(control, memory);
else if (p[d] >= interval_endpoints[d].second - delta_x)
ix[d] = n_subintervals[d] - 1;
else
- ix[d] = (p[d] - interval_endpoints[d].first) / delta_x;
+ ix[d] = static_cast<unsigned int>(
+ (p[d] - interval_endpoints[d].first) / delta_x);
}
// now compute the relative point within the interval/rectangle/box
std::vector<Tensor<3, dim>> bubble_third_derivatives;
std::vector<Tensor<4, dim>> bubble_fourth_derivatives;
- int n_bubbles = std::pow(3, dim); // size for create_polynomials_bubble
- int n_q = 1 << dim; // size for create_polynomials_q
+ constexpr int n_bubbles =
+ Utilities::pow(3, dim); // size for create_polynomials_bubble
+ constexpr int n_q = 1 << dim; // size for create_polynomials_q
// don't resize if the provided vector has 0 length
Q_values.resize((values.size() == 0) ? 0 : n_q);
// Np = Pc * Pc / ratio
// for quadratic matrices the ratio equals 1
const double ratio = double(n) / m;
- int Pc = std::floor(std::sqrt(ratio * Np));
+ int Pc = static_cast<int>(std::sqrt(ratio * Np));
// one could rounds up Pc to the number which has zero remainder from the
// division of Np while ( Np % Pc != 0 )
const double h) -> void {
// use std::round instead of std::ceil to improve aspect ratio
// in case padding is only slightly larger than h.
- const unsigned int rounded = std::round(padding / h);
+ const auto rounded = static_cast<unsigned int>(std::round(padding / h));
// in case padding is much smaller than h, make sure we
// have at least 1 element
const unsigned int num = (padding > 0. && rounded == 0) ? 1 : rounded;
// the order used in the following blocks makes sense
for (unsigned int i = 0; i < cells.size(); i++)
{
- double id;
+ types::manifold_id id;
in >> id;
if (set == "MaterialID")
cells[i].material_id = id;
i < subcelldata.boundary_quads.size();
i++)
{
- double id;
+ types::manifold_id id;
in >> id;
if (set == "MaterialID")
subcelldata.boundary_quads[i].material_id = id;
i < subcelldata.boundary_lines.size();
i++)
{
- double id;
+ types::manifold_id id;
in >> id;
if (set == "MaterialID")
subcelldata.boundary_lines[i].material_id = id;
i < subcelldata.boundary_lines.size();
i++)
{
- double id;
+ types::manifold_id id;
in >> id;
if (set == "MaterialID")
subcelldata.boundary_lines[i].material_id = id;
in >> version >> file_type >> data_size;
Assert((version >= 2.0) && (version <= 4.0), ExcNotImplemented());
- gmsh_file_format = version;
+ gmsh_file_format = static_cast<unsigned int>(version);
Assert(file_type == 0, ExcNotImplemented());
Assert(data_size == sizeof(double), ExcNotImplemented());
camera_horizontal,
camera_focus);
- const unsigned int font_size_this_cell =
- .5 + cell_label_font_size *
- std::pow(.5, cell->level() - 4. + 3.5 * distance_factor);
+ const auto font_size_this_cell = static_cast<unsigned int>(
+ .5 +
+ cell_label_font_size *
+ std::pow(.5, cell->level() - 4. + 3.5 * distance_factor));
out << " <text"
<< " x=\""
AssertThrow(info == 0,
LAPACKSupport::ExcErrorCode("pgetri", info));
- lwork = work[0];
+ lwork = static_cast<int>(work[0]);
liwork = iwork[0];
work.resize(lwork);
iwork.resize(liwork);
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("psyevx", info));
}
- lwork = work[0];
+ lwork = static_cast<int>(work[0]);
work.resize(lwork);
if (all_eigenpairs)
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("psyevr", info));
- lwork = work[0];
+ lwork = static_cast<int>(work[0]);
work.resize(lwork);
liwork = iwork[0];
iwork.resize(liwork);
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pgesvd", info));
- lwork = work[0];
+ lwork = static_cast<int>(work[0]);
work.resize(lwork);
pgesvd(&jobu,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pgels", info));
- lwork = work[0];
+ lwork = static_cast<int>(work[0]);
work.resize(lwork);
pgels(&trans,
&liwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pdpocon", info));
- lwork = std::ceil(work[0]);
+ lwork = static_cast<int>(std::ceil(work[0]));
work.resize(lwork);
// now the actual run:
* the minimum value for NB yields that only ceil(400/32)=13 processes will be
* writing the matrix to disk.
*/
- const int NB = std::max((int)std::ceil((double)n_columns / n_mpi_processes),
+ const int NB = std::max(static_cast<int>(std::ceil(
+ static_cast<double>(n_columns) / n_mpi_processes)),
column_block_size);
ScaLAPACKMatrix<NumberType> tmp(n_rows, n_columns, column_grid, MB, NB);
const int MB = n_rows;
// for the choice of NB see explanation in save_parallel()
- const int NB = std::max((int)std::ceil((double)n_columns / n_mpi_processes),
+ const int NB = std::max(static_cast<int>(std::ceil(
+ static_cast<double>(n_columns) / n_mpi_processes)),
column_block_size);
+
ScaLAPACKMatrix<NumberType> tmp(n_rows, n_columns, column_grid, MB, NB);
// get pointer to data held by the process