Commit b1339a85 authored by Lasse Hinrichsen's avatar Lasse Hinrichsen
Browse files

Use CamelCase over snake_case

parent 8d862c5c
Pipeline #37056 failed with stage
in 4 minutes and 34 seconds
......@@ -50,7 +50,7 @@ determineTruncation(const NV& x, NBV&& truncationFlags, const F& function)
{
namespace H = Dune::Hybrid;
if constexpr (IsNumber<NV>()) {
truncationFlags = function.should_truncate(x);
truncationFlags = function.shouldTruncate(x);
} else {
assert(x.size() == truncationFlags.size());
H::forEach(H::integralRange(H::size(x)), [&](auto&& i) {
......@@ -123,18 +123,27 @@ public:
, ignore_(ignore)
{}
/** \brief Constructor that allows to supply a matrix which serves as a
* template for the Hessian. */
template<typename MM>
SemilinearFunctionalConstrainedLinearization(const F& functional,
const BitVector& ignore,
MM&& matrixDummy)
: f_(functional)
, ignore_(ignore)
{
initializeMatrix(std::forward<MM>(matrixDummy));
}
/** \brief Set a matrix that serves as a template for the Hessian.
*
* This needs to be a matrix of correct size and sparsity pattern (including
* at least the diagonal entries).
* TODO: I don't like neither the name nor the fact of having a setter
* function at all. This should rather be done in the constructor.
*/
template<typename MM>
void setMatrixDummy(const MM& dummy)
void initializeMatrix(MM&& dummy)
{
// mat_ = std::forward<MM>(dummy);
mat_ = dummy;
mat_ = std::forward<MM>(dummy);
}
void bind(const Vector& x)
......
......@@ -171,7 +171,7 @@ public:
auto domain() const { return domain_; }
bool should_truncate(double x) const
bool shouldTruncate(double x) const
{
if (domain_[0] + eps >= x or x >= domain_[1] - eps) // safety guards on
return true;
......@@ -225,7 +225,7 @@ solveSystem(V const& u_old, M const& matrix, Grid const& grid)
M,
V,
BV>(nonlinear, ignore);
semi_lin.setMatrixDummy(matrix);
semi_lin.initializeMatrix(matrix);
using Linearization =
TNNMG::SumFunctionalConstrainedLinearization<decltype(functional),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment