Skip to content

Commit

Permalink
Misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
landinjm committed Nov 11, 2024
1 parent d1a9ad4 commit 92ee810
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/matrixfree/setNonlinearEqInitialGuess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ MatrixFreePDE<dim, degree>::setNonlinearEqInitialGuess()
// log time
computing_timer.enter_subsection("matrixFreePDE: setNonlinearEqInitialGuess");
Timer time;
char buffer[200];
time.start();
char buffer[200];

for (unsigned int fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++)
{
Expand Down Expand Up @@ -114,8 +115,7 @@ MatrixFreePDE<dim, degree>::setNonlinearEqInitialGuess()
solver_control.tolerance(),
solutionSet[fieldIndex]->l2_norm(),
dU_norm);
pcout << buffer;
pcout << std::endl;
pcout << buffer << "\n";
}
}
}
Expand Down
26 changes: 13 additions & 13 deletions src/userInputParameters/loadVariableAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ userInputParameters<dim>::loadVariableAttributes(
varInfoListExplicitRHS.reserve(num_var_explicit_RHS);
for (unsigned int i = 0; i < number_of_variables; i++)
{
variable_info varInfo {
const variable_info varInfo {
var_type[i] == SCALAR,
i,
variable_attributes.equation_dependency_parser.eval_flags_explicit_RHS[i],
Expand All @@ -78,7 +78,7 @@ userInputParameters<dim>::loadVariableAttributes(
varInfoListNonexplicitRHS.reserve(num_var_nonexplicit_RHS);
for (unsigned int i = 0; i < number_of_variables; i++)
{
variable_info varInfo {
const variable_info varInfo {
var_type[i] == SCALAR,
i,
variable_attributes.equation_dependency_parser.eval_flags_nonexplicit_RHS[i],
Expand All @@ -104,7 +104,7 @@ userInputParameters<dim>::loadVariableAttributes(
varInfoListLHS.reserve(num_var_LHS);
for (unsigned int i = 0; i < number_of_variables; i++)
{
variable_info varInfo {
const variable_info varInfo {
var_type[i] == SCALAR,
i,
variable_attributes.equation_dependency_parser.eval_flags_nonexplicit_LHS[i],
Expand All @@ -118,14 +118,14 @@ userInputParameters<dim>::loadVariableAttributes(
varChangeInfoListLHS.reserve(num_var_LHS);
for (unsigned int i = 0; i < number_of_variables; i++)
{
variable_info varInfo {var_type[i] == SCALAR,
i,
variable_attributes.equation_dependency_parser
.eval_flags_change_nonexplicit_LHS[i],
variable_attributes.equation_dependency_parser
.eval_flags_residual_nonexplicit_LHS[i],
!static_cast<bool>(varInfo.evaluation_flags &
dealii::EvaluationFlags::nothing)};
const variable_info varInfo {var_type[i] == SCALAR,
i,
variable_attributes.equation_dependency_parser
.eval_flags_change_nonexplicit_LHS[i],
variable_attributes.equation_dependency_parser
.eval_flags_residual_nonexplicit_LHS[i],
!static_cast<bool>(varInfo.evaluation_flags &
dealii::EvaluationFlags::nothing)};

varChangeInfoListLHS.push_back(varInfo);
}
Expand All @@ -135,7 +135,7 @@ userInputParameters<dim>::loadVariableAttributes(
pp_baseVarInfoList.reserve(number_of_variables);
for (unsigned int i = 0; i < number_of_variables; i++)
{
variable_info varInfo {
const variable_info varInfo {
var_type[i] == SCALAR,
i,
variable_attributes.equation_dependency_parser.eval_flags_postprocess[i],
Expand Down Expand Up @@ -164,7 +164,7 @@ userInputParameters<dim>::loadVariableAttributes(
pp_varInfoList.reserve(pp_number_of_variables);
for (unsigned int i = 0; i < pp_number_of_variables; i++)
{
variable_info varInfo {
const variable_info varInfo {
pp_var_type[i] == SCALAR,
i,
dealii::EvaluationFlags::nothing,
Expand Down
9 changes: 4 additions & 5 deletions src/userInputParameters/load_BC_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <deal.II/base/exceptions.h>

#include "../../include/userInputParameters.h"
#include <cstddef>

template <int dim>
void
Expand All @@ -28,7 +29,7 @@ userInputParameters<dim>::load_BC_list(const std::vector<std::string> &list_of_B
// the same BC is applied for all boundaries
if (temp.size() == 1)
{
temp.resize(2 * dim, temp[0]);
temp.resize(static_cast<size_t>(2 * dim), temp[0]);
}

// Load the BC for each boundary into 'newBC'.
Expand Down Expand Up @@ -76,10 +77,8 @@ userInputParameters<dim>::load_BC_list(const std::vector<std::string> &list_of_B
// domain
if (j % 2 == 0)
{
AssertThrow(!((boost::iequals(temp[j], "PERIODIC") &&
!boost::iequals(temp[j + 1], "PERIODIC")) ||
(!boost::iequals(temp[j], "PERIODIC") &&
boost::iequals(temp[j + 1], "PERIODIC"))),
AssertThrow(boost::iequals(temp[j], "PERIODIC") ==
boost::iequals(temp[j + 1], "PERIODIC"),
dealii::ExcMessage(
std::string("Periodic boundary condition must be "
"specified on both sides of domain")));
Expand Down
2 changes: 1 addition & 1 deletion src/userInputParameters/load_user_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ userInputParameters<dim>::load_user_constants(inputFileReader &input_fi

const std::string elastic_const_symmetry =
model_constants_type_strings.at(0);
dealii::Tensor<2, 2 * dim - 1 + dim / 3> temp =
dealii::Tensor<2, 2 *dim - 1 + dim / 3> temp =
get_Cij_tensor(temp_elastic_constants, elastic_const_symmetry);
model_constants.push_back(temp);
}
Expand Down
5 changes: 3 additions & 2 deletions src/userInputParameters/setTimeStepList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ userInputParameters<dim>::setTimeStepList(
timeStepList.push_back(1);
for (unsigned int iter = 2; iter <= totalIncrements; iter++)
{
const unsigned int decade = std::ceil(std::log10(iter));
const unsigned int step_size = std::pow(10, decade) / numberOfOutputs;
const unsigned int decade = std::ceil(std::log10(iter));
const auto step_size =
static_cast<unsigned int>(std::pow(10, decade) / numberOfOutputs);
if (iter % step_size == 0)
{
timeStepList.push_back(iter);
Expand Down
7 changes: 4 additions & 3 deletions src/userInputParameters/userInputParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ userInputParameters<dim>::userInputParameters(inputFileReader &input_fi
}

// Time stepping parameters
dtValue = parameter_handler.get_double("Time step");
const int totalIncrements_temp = parameter_handler.get_integer("Number of time steps");
finalTime = parameter_handler.get_double("Simulation end time");
dtValue = parameter_handler.get_double("Time step");
const int totalIncrements_temp =
static_cast<int>(parameter_handler.get_integer("Number of time steps"));
finalTime = parameter_handler.get_double("Simulation end time");

// Linear solver parameters
for (unsigned int i = 0; i < number_of_variables; i++)
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/vectorBCFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ vectorBCFunction<dim>::vectorBCFunction(std::vector<double> input_values)

template <int dim>
void
vectorBCFunction<dim>::vector_value(const dealii::Point<dim> &p,
dealii::Vector<double> &values) const
vectorBCFunction<dim>::vector_value([[maybe_unused]] const dealii::Point<dim> &p,
dealii::Vector<double> &values) const
{
for (unsigned int i = 0; i < dim; i++)
{
Expand Down

0 comments on commit 92ee810

Please sign in to comment.