Skip to content

Commit

Permalink
remove updateStateImpl from all skills and have default in mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
tarun-mitruka committed Jan 10, 2025
1 parent 50c4763 commit 452edb6
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ikarus/finiteelements/feresulttypes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public:
} else
return value_;
}
explicit ResultWrapper() { value_.setZero(); }
explicit ResultWrapper() = default;
explicit ResultWrapper(StoredType&& value) { this->value_ = std::move(value); }
explicit ResultWrapper(const StoredType& value) { this->value_ = value; }
ResultWrapper& operator=(const StoredType& value) {
Expand All @@ -216,7 +216,7 @@ public:
}

private:
StoredType value_{};
StoredType value_{StoredType::Zero()};
};

namespace Impl {
Expand Down
3 changes: 0 additions & 3 deletions ikarus/finiteelements/mechanics/kirchhoffloveshell.hh
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ protected:
return kin;
}

void updateStateImpl(const Requirement& /* par */,
const std::remove_reference_t<typename Traits::template VectorType<>>& /* correction */) const {}

template <typename ST>
void calculateMatrixImpl(
const Requirement& par, const MatrixAffordance& affordance, typename Traits::template MatrixType<ST> K,
Expand Down
3 changes: 0 additions & 3 deletions ikarus/finiteelements/mechanics/linearelastic.hh
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ public:
}

protected:
void updateStateImpl(const Requirement& /* par */,
const std::remove_reference_t<typename Traits::template VectorType<>>& /* correction */) const {}

template <typename ScalarType>
void calculateMatrixImpl(const Requirement& par, const MatrixAffordance& affordance,
typename Traits::template MatrixType<> K,
Expand Down
3 changes: 0 additions & 3 deletions ikarus/finiteelements/mechanics/loads/traction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ protected:
const Requirement&, MatrixAffordance, typename Traits::template MatrixType<>,
const std::optional<std::reference_wrapper<const Eigen::VectorX<ST>>>& = std::nullopt) const {}

void updateStateImpl(const Requirement& /* par */,
const std::remove_reference_t<typename Traits::template VectorType<>>& /* correction */) const {}

private:
std::function<Eigen::Vector<double, worldDim>(const Dune::FieldVector<double, worldDim>&, const double&)>
neumannBoundaryLoad_;
Expand Down
3 changes: 0 additions & 3 deletions ikarus/finiteelements/mechanics/loads/volume.hh
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ protected:
const Requirement& par, MatrixAffordance, typename Traits::template MatrixType<> K,
const std::optional<std::reference_wrapper<const Eigen::VectorX<ST>>>& dx = std::nullopt) const {}

void updateStateImpl(const Requirement& /* par */,
const std::remove_reference_t<typename Traits::template VectorType<>>& /* correction */) const {}

private:
std::function<Eigen::Vector<double, worldDim>(const Dune::FieldVector<double, worldDim>&, const double&)> volumeLoad_;
//> CRTP
Expand Down
3 changes: 0 additions & 3 deletions ikarus/finiteelements/mechanics/truss.hh
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ protected:
const auto [L, l, Elin, Egl, dEdu, ddEddu] = computeStrain(par, dx);
force += E * A * Egl * L * dEdu;
}

void updateStateImpl(const Requirement& /* par */,
const std::remove_reference_t<typename Traits::template VectorType<>>& /* correction */) const {}
};

/**
Expand Down
5 changes: 5 additions & 0 deletions ikarus/finiteelements/mixin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ public:
(Skills<PreFE, typename PreFE::template FE<Skills...>>::updateStateImpl(par, correction), ...);
}

template <typename ScalarType>
requires(not implementsUpdateStateImpl)
void updateStateImpl(const Requirement& par,
const std::remove_reference_t<typename Traits::template VectorType<>>& correction) const {}

protected:
/**
* @brief Get a reference to the underlying finite element object.
Expand Down

0 comments on commit 452edb6

Please sign in to comment.