Skip to content

Commit

Permalink
more misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
landinjm committed Nov 11, 2024
1 parent 92ee810 commit 8c005cd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions include/vectorBCFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ template <int dim>
class vectorBCFunction : public dealii::Function<dim, double>
{
public:
vectorBCFunction(const std::vector<double> BC_values);
vectorBCFunction(const std::vector<double> &BC_values);
virtual void
vector_value(const dealii::Point<dim> &p,
dealii::Vector<double> &values) const override;
Expand All @@ -29,4 +29,4 @@ class vectorBCFunction : public dealii::Function<dim, double>
const std::vector<double> BC_values;
};

#endif /* INCLUDE_VECTORBCFUNCTION_H_ */
#endif
11 changes: 6 additions & 5 deletions src/userInputParameters/load_user_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,14 @@ userInputParameters<dim>::getCIJMatrix(const elasticityModel model,
}
// print CIJ to terminal
pcout << "Elasticity matrix (Voigt notation):\n";
char buffer[100];
for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++)
constexpr unsigned int voight_matrix_size = 2 * dim - 1 + dim / 3;
std::array<char, 100> buffer;
for (unsigned int i = 0; i < voight_matrix_size; i++)
{
for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++)
for (unsigned int j = 0; j < voight_matrix_size; j++)
{
snprintf(buffer, sizeof(buffer), "%8.3e ", CIJ[i][j]);
pcout << buffer;
snprintf(buffer.data(), buffer.size(), "%8.3e ", CIJ[i][j]);
pcout << buffer.data();
}
pcout << "\n";
}
Expand Down
5 changes: 1 addition & 4 deletions src/userInputParameters/setTimeStepList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ userInputParameters<dim>::setTimeStepList(
std::vector<unsigned int> timeStepList;

// The number of outputs cannot be greater than the number increments
if (numberOfOutputs > totalIncrements)
{
numberOfOutputs = totalIncrements;
}
numberOfOutputs = std::min(numberOfOutputs, totalIncrements);

// Prevent divide by zero in subsequent output types by returning the a vector where the
// only entry is one greater than the number of increments. This way, we effectively
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/vectorBCFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <deal.II/lac/vector.h>

template <int dim>
vectorBCFunction<dim>::vectorBCFunction(std::vector<double> input_values)
vectorBCFunction<dim>::vectorBCFunction(const std::vector<double> &BC_values)
: dealii::Function<dim>(dim)
, BC_values(std::move(input_values))
, BC_values(BC_values)
{}

template <int dim>
Expand Down

0 comments on commit 8c005cd

Please sign in to comment.