| 1336 | } |
| 1337 | |
| 1338 | void ASDConcrete3DMaterial::CrackPlanes::setCurrentNormal(const Vector3& ni) |
| 1339 | { |
| 1340 | // always reset to 0 |
| 1341 | m_closest_normal_loc = 0; |
| 1342 | // search only if necessary |
| 1343 | if (m_normals) { |
| 1344 | m_current_normal = ni; |
| 1345 | double max_dot = -1.0; |
| 1346 | const auto& normals = *m_normals; |
| 1347 | for (std::size_t i = 0; i < normals.size(); ++i) { |
| 1348 | double adot = std::abs(m_current_normal.dot(normals[i])); |
| 1349 | if (adot > max_dot) { |
| 1350 | max_dot = adot; |
| 1351 | m_closest_normal_loc = i; |
| 1352 | } |
| 1353 | } |
| 1354 | } |
| 1355 | } |
| 1356 | |
| 1357 | double ASDConcrete3DMaterial::CrackPlanes::getCurrentEquivalentStrain() const |
| 1358 | { |