@@ -152,11 +152,12 @@ public:
152
152
*/
153
153
template <typename ScalarType, int strainDim, bool voigt = true >
154
154
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 {
156
158
decltype (auto ) matAD = mat_.template rebind <ScalarType>();
157
159
return matAD.template tangentModuli <strainType, voigt>(strain);
158
- } else
159
- return mat_.template tangentModuli <strainType, voigt>(strain);
160
+ }
160
161
}
161
162
162
163
/* *
@@ -169,11 +170,12 @@ public:
169
170
*/
170
171
template <typename ScalarType, int strainDim>
171
172
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 {
173
176
decltype (auto ) matAD = mat_.template rebind <ScalarType>();
174
177
return matAD.template storedEnergy <strainType>(strain);
175
- } else
176
- return mat_.template storedEnergy <strainType>(strain);
178
+ }
177
179
}
178
180
179
181
/* *
@@ -187,11 +189,12 @@ public:
187
189
*/
188
190
template <typename ScalarType, int strainDim, bool voigt = true >
189
191
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 {
191
195
decltype (auto ) matAD = mat_.template rebind <ScalarType>();
192
196
return matAD.template stresses <strainType, voigt>(strain);
193
- } else
194
- return mat_.template stresses <strainType, voigt>(strain);
197
+ }
195
198
}
196
199
197
200
const Geometry& geometry () const { return *geo_; }
0 commit comments