Skip to content

Commit 8ee9668

Browse files
committed
Revert "fix nonlinear"
This reverts commit 9e48676.
1 parent c4e5046 commit 8ee9668

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

ikarus/finiteelements/mechanics/nonlinearelastic.hh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ public:
152152
*/
153153
template <typename ScalarType, int strainDim, bool voigt = true>
154154
auto materialTangent(const Eigen::Vector<ScalarType, strainDim>& strain) const {
155-
if constexpr (Concepts::AutodiffScalar<ScalarType>) {
155+
if constexpr (std::is_same_v<ScalarType, double>)
156+
return mat_.template tangentModuli<strainType, voigt>(strain);
157+
else {
156158
decltype(auto) matAD = mat_.template rebind<ScalarType>();
157159
return matAD.template tangentModuli<strainType, voigt>(strain);
158-
} else
159-
return mat_.template tangentModuli<strainType, voigt>(strain);
160+
}
160161
}
161162

162163
/**
@@ -169,11 +170,12 @@ public:
169170
*/
170171
template <typename ScalarType, int strainDim>
171172
auto getInternalEnergy(const Eigen::Vector<ScalarType, strainDim>& strain) const {
172-
if constexpr (Concepts::AutodiffScalar<ScalarType>) {
173+
if constexpr (std::is_same_v<ScalarType, double>)
174+
return mat_.template storedEnergy<strainType>(strain);
175+
else {
173176
decltype(auto) matAD = mat_.template rebind<ScalarType>();
174177
return matAD.template storedEnergy<strainType>(strain);
175-
} else
176-
return mat_.template storedEnergy<strainType>(strain);
178+
}
177179
}
178180

179181
/**
@@ -187,11 +189,12 @@ public:
187189
*/
188190
template <typename ScalarType, int strainDim, bool voigt = true>
189191
auto getStress(const Eigen::Vector<ScalarType, strainDim>& strain) const {
190-
if constexpr (Concepts::AutodiffScalar<ScalarType>) {
192+
if constexpr (std::is_same_v<ScalarType, double>)
193+
return mat_.template stresses<strainType, voigt>(strain);
194+
else {
191195
decltype(auto) matAD = mat_.template rebind<ScalarType>();
192196
return matAD.template stresses<strainType, voigt>(strain);
193-
} else
194-
return mat_.template stresses<strainType, voigt>(strain);
197+
}
195198
}
196199

197200
const Geometry& geometry() const { return *geo_; }

0 commit comments

Comments
 (0)