Skip to content

Commit

Permalink
Bugfix: Sig and Eps were not properly overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Oct 21, 2020
1 parent ceecbdb commit 1f49bde
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions include/FrictionQPotFEM/UniformSingleLayer2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class System {
auto quad() const;

// Extract stress and strain tensors.
auto Sig() const;
auto Eps() const;
virtual xt::xtensor<double, 4> Sig();
virtual xt::xtensor<double, 4> Eps();

// Extract for the plastic elements only (per integration point).
virtual xt::xtensor<double, 4> plastic_Sig() const; // stress tensor
Expand Down Expand Up @@ -288,8 +288,8 @@ class HybridSystem : public System {
// Extract stress and strain.
// Note: involves re-evaluating the stress and strain,
// as they are only known in the plastic elements.
auto Sig();
auto Eps();
xt::xtensor<double, 4> Sig() override;
xt::xtensor<double, 4> Eps() override;

// Extract for the plastic elements only.
xt::xtensor<double, 4> plastic_Sig() const override; // stress tensor
Expand Down
10 changes: 5 additions & 5 deletions include/FrictionQPotFEM/UniformSingleLayer2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ inline auto System::quad() const
return m_quad;
}

inline auto System::Sig() const
inline xt::xtensor<double, 4> System::Sig()
{
return m_Sig;
}

inline auto System::Eps() const
inline xt::xtensor<double, 4> System::Eps()
{
return m_Eps;
}
Expand Down Expand Up @@ -562,8 +562,8 @@ inline void System::addSimpleShearToFixedStress(double target_stress)

auto idx_new = this->plastic_CurrentIndex();

FRICTIONQPOTFEM_REQUIRE(std::abs(target_stress - sig) / sig < 1e-4);
FRICTIONQPOTFEM_REQUIRE(xt::all(xt::equal(idx, idx_new)));
FRICTIONQPOTFEM_REQUIRE(std::abs(target_stress - sig) / sig < 1e-4);
}

inline auto System::triggerElementWithLocalSimpleShear(double deps_kick, size_t plastic_element)
Expand Down Expand Up @@ -689,7 +689,7 @@ inline void HybridSystem::setPlastic(
m_material_plas.setStrain(m_Eps_plas);
}

inline auto HybridSystem::Sig()
inline xt::xtensor<double, 4> HybridSystem::Sig()
{
if (m_eval_full) {
this->computeStress();
Expand All @@ -699,7 +699,7 @@ inline auto HybridSystem::Sig()
return m_Sig;
}

inline auto HybridSystem::Eps()
inline xt::xtensor<double, 4> HybridSystem::Eps()
{
if (m_eval_full) {
this->computeStress();
Expand Down
2 changes: 1 addition & 1 deletion include/FrictionQPotFEM/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#define FRICTIONQPOTFEM_VERSION_MAJOR 0
#define FRICTIONQPOTFEM_VERSION_MINOR 5
#define FRICTIONQPOTFEM_VERSION_PATCH 0
#define FRICTIONQPOTFEM_VERSION_PATCH 1

#define FRICTIONQPOTFEM_VERSION_AT_LEAST(x, y, z) \
(FRICTIONQPOTFEM_VERSION_MAJOR > x || (FRICTIONQPOTFEM_VERSION_MAJOR >= x && \
Expand Down

0 comments on commit 1f49bde

Please sign in to comment.