return std_cxx14::make_unique<Patterns::Bool>();
else if (std::is_integral<T>::value)
return std_cxx14::make_unique<Patterns::Integer>(
- std::numeric_limits<T>::min(), std::numeric_limits<T>::max());
+ static_cast<int>(std::numeric_limits<T>::min()),
+ static_cast<int>(std::numeric_limits<T>::max()));
else if (std::is_floating_point<T>::value)
return std_cxx14::make_unique<Patterns::Double>(
-std::numeric_limits<T>::max(), std::numeric_limits<T>::max());
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 auto solver_its = static_cast<unsigned 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();
SolverControl solver_control(solver_its, tol_sol, false, false);
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;
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 auto solver_its = static_cast<unsigned 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();
SolverControl solver_control(solver_its, tol_sol, false, false);
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 dealii::Point<dim> ¢er = cell->center();
const double x = center[0];
- const unsigned int id = std::floor((x - x0) / dL);
+ const auto id = static_cast<unsigned int>((x - x0) / dL);
cell->set_subdomain_id(id);
}
}
const Point<dim> ¢er = cell->center();
const double x = center[0];
- const unsigned int id = std::floor((x - x0) / dL);
+ const auto id = static_cast<unsigned int>((x - x0) / dL);
cell->set_subdomain_id(id);
}
}
const dealii::Point<dim> ¢er = cell->center();
const double x = center[0];
- const unsigned int id = std::floor((x - x0) / dL);
+ const auto id = static_cast<unsigned int>(std::floor((x - x0) / dL));
cell->set_subdomain_id(id);
}
}
const Point<dim> ¢er = cell->center();
const double x = center[0];
- const unsigned int id = std::floor((x - x0) / dL);
+ const auto id = static_cast<unsigned int>((x - x0) / dL);
cell->set_subdomain_id(id);
}
}
void
test()
{
- unsigned long long int i = std::pow(2, 33);
+ const auto i = static_cast<unsigned long long int>(std::pow(2, 33));
Assert(Utilities::to_string(i) == "8589934592", ExcInternalError());
Assert(Utilities::to_string(i, 11) == "08589934592", ExcInternalError());
- unsigned long long j = std::pow(2, 31);
+ const auto j = static_cast<unsigned long long int>(std::pow(2, 31));
Assert(Utilities::to_string(j) == "2147483648", ExcInternalError());
- int k = -std::pow(2, 30);
+ const int k = static_cast<int>(-std::pow(2, 30));
Assert(Utilities::to_string(k) == "-1073741824", ExcInternalError());
Assert(Utilities::to_string(k, 12) == "-01073741824", ExcInternalError());
- long long int l = -std::pow(2, 35);
+ const auto l = static_cast<long long int>(-std::pow(2, 35));
Assert(Utilities::to_string(l) == "-34359738368", ExcInternalError());
Assert(Utilities::to_string(l, 13) == "-034359738368", ExcInternalError());
const double & sigma,
const std::string &rhs_expr,
const std::string &boundary_expr,
- const double & refinement = 11);
+ const unsigned int refinement = 11);
EstimateEnrichmentFunction(const Point<1> & center,
const double & left_bound,
const double & right_bound,
const double & sigma,
const std::string &rhs_expr,
const std::string &boundary_expr,
- const double & refinement = 11);
+ const unsigned int refinement = 11);
~EstimateEnrichmentFunction();
void
run();
const double & sigma,
const std::string &rhs_expr,
const std::string &boundary_expr,
- const double & refinement)
+ const unsigned int refinement)
: center(center)
, domain_size(domain_size)
, sigma(sigma)
const double & sigma,
const std::string &rhs_expr,
const std::string &boundary_expr,
- const double & refinement)
+ const unsigned int refinement)
: center(center)
, left_bound(left_bound)
, right_bound(right_bound)
hp::FECollection<dim> fe_collection;
// prepare FECollection with arbitrary number of entries
- const unsigned int max_degree = 1 + std::pow(2, dim);
+ const unsigned int max_degree = 1 + Utilities::pow(2, dim);
for (unsigned int i = 0; i < max_degree; ++i)
fe_collection.push_back(FE_Q<dim>(max_degree - i));
AdvectionProblem<dim>::assemble_rhs(Vector<double> &solution,
Vector<double> &residual)
{
- const unsigned int n_gauss_points = std::ceil(((2.0 * fe.degree) + 1) / 2);
+ const auto n_gauss_points =
+ static_cast<unsigned int>(std::ceil(((2.0 * fe.degree) + 1) / 2));
MeshWorker::IntegrationInfoBox<dim> info_box;
deallog << "\tNumber of degrees of freedom: " << dof_handler.n_dofs()
<< std::endl;
- const double delta_t = 0.005;
- const double n_dt = 10;
+ const double delta_t = 0.005;
+ const unsigned int n_dt = 10;
double inv_cell_vol = 1.0 / std::pow(0.01, dim);
for (const auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
data.cell_vectorization_category[cell->active_cell_index()] =
- cell->center()[1] * 10.;
+ static_cast<unsigned int>(cell->center()[1] * 10.);
data.cell_vectorization_categories_strict = false;
mf_data.reinit(dof, constraints, QGauss<1>(2), data);
(cell->center()[0] < 1) && (cell->center()[1] < 1) &&
(dim == 3 ? (cell->center()[2] < 1) : true) ?
// one cell has more weight than all others together
- std::pow(16, dim) * 1000 :
+ Utilities::pow(16, dim) * 1000 :
0);
}
hp::FECollection<dim> fe_collection;
// prepare FECollection with arbitrary number of entries
- const unsigned int max_degree = 1 + std::pow(2, dim);
+ const unsigned int max_degree = 1 + Utilities::pow(2, dim);
for (unsigned int i = 0; i < max_degree; ++i)
fe_collection.push_back(FE_Q<dim>(max_degree - i));
hp::FECollection<dim> fe_collection;
// prepare FECollection with arbitrary number of entries
- const unsigned int max_degree = 1 + std::pow(2, dim);
+ const unsigned int max_degree = 1 + Utilities::pow(2, dim);
for (unsigned int i = 0; i < max_degree; ++i)
fe_collection.push_back(FE_Q<dim>(max_degree - i));
hp::FECollection<dim> fe_collection;
// prepare FECollection with arbitrary number of entries
- const unsigned int max_degree = 1 + std::pow(2, dim);
+ const unsigned int max_degree = 1 + Utilities::pow(2, dim);
for (unsigned int i = 0; i < max_degree; ++i)
fe_collection.push_back(FE_Q<dim>(max_degree - i));
hp::FECollection<dim> fe_collection;
// prepare FECollection with arbitrary number of entries
- const unsigned int max_degree = 1 + std::pow(2, dim);
+ const unsigned int max_degree = 1 + Utilities::pow(2, dim);
for (unsigned int i = 0; i < max_degree; ++i)
fe_collection.push_back(FE_Q<dim>(max_degree - i));
hp::FECollection<dim> fe_collection;
// prepare FECollection with arbitrary number of entries
- const unsigned int max_degree = 1 + std::pow(2, dim);
+ const unsigned int max_degree = 1 + Utilities::pow(2, dim);
for (unsigned int i = 0; i < max_degree; ++i)
fe_collection.push_back(FE_Q<dim>(max_degree - i));
}
}
- const unsigned int max_n_cell = max_n_cell_ratio * tr.n_global_active_cells();
+ const auto max_n_cell =
+ static_cast<unsigned int>(max_n_cell_ratio * tr.n_global_active_cells());
parallel::distributed::GridRefinement ::refine_and_coarsen_fixed_number(
tr, indicators, 0.2, 0.2, max_n_cell);
hp::FECollection<dim> fe_collection;
// prepare FECollection with arbitrary number of entries
- const unsigned int max_degree = 1 + std::pow(2, dim);
+ const unsigned int max_degree = 1 + Utilities::pow(2, dim);
for (unsigned int i = 0; i < max_degree; ++i)
fe_collection.push_back(FE_Q<dim>(max_degree - i));
// The values for eta, mu are chosen such that
// more strict convergence conditions are enforced.
- const double a1 = 1.0;
- const double eta = 0.5;
- const double mu = 0.49;
- const double a_max = 1.25;
- const double max_evals = 20;
- const bool debug_linesearch = false;
- const auto res = (use_ptrb ? LineMinimization::line_search<double>(
+ const double a1 = 1.0;
+ const double eta = 0.5;
+ const double mu = 0.49;
+ const double a_max = 1.25;
+ const unsigned int max_evals = 20;
+ const bool debug_linesearch = false;
+ const auto res = (use_ptrb ? LineMinimization::line_search<double>(
ls_minimization_function_ptrb,
res_0.first,
res_0.second,
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 auto solver_its = static_cast<unsigned 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();
SolverControl solver_control(solver_its, tol_sol, false, false);
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;
pcout << " 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 auto solver_its = static_cast<unsigned 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();
SolverControl solver_control(solver_its, tol_sol, false, false);
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;
pcout << " 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 auto solver_its = static_cast<unsigned 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();
SolverControl solver_control(solver_its, tol_sol, false, false);
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;
pcout << " 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 auto solver_its = static_cast<unsigned 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();
SolverControl solver_control(solver_its, tol_sol, false, false);
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;
if (cell->center()[0] < 0.5 && cell->center()[1] < 0.5)
cell->set_refine_flag();
if (dim == 3)
- if (cell->center()[0] < 0.5 && cell->center()[1] &&
+ if (cell->center()[0] < 0.5 && cell->center()[1] < 0.5 &&
cell->center()[2] < 0.5)
cell->set_refine_flag();
}
cell->set_refine_flag();
if (dim == 3)
if (cell->is_locally_owned() && cell->center()[0] < 0.5 &&
- cell->center()[1] && cell->center()[2] < 0.5)
+ cell->center()[1] < 0.5 && cell->center()[2] < 0.5)
cell->set_refine_flag();
}
distributed_tria.execute_coarsening_and_refinement();
const dealii::Point<dim> ¢er = cell->center();
const double x = center[0];
- const unsigned int id = std::floor((x - x0) / dL);
+ const auto id = static_cast<unsigned int>((x - x0) / dL);
cell->set_subdomain_id(id);
}
}
const dealii::Point<dim> ¢er = cell->center();
const double x = center[0];
- const unsigned int id = std::floor((x - x0) / dL);
+ const auto id = static_cast<unsigned int>((x - x0) / dL);
cell->set_subdomain_id(id);
}
}