fix(hht): preserve metric association and complete MKL actions
This commit is contained in:
@@ -495,20 +495,8 @@ Result<Regularity> CheckRegularity(const Domain& domain,
|
||||
for (std::size_t i = 0; i < nodes.size(); ++i) {
|
||||
node_null[nodes[i]] = i;
|
||||
const auto& n = assembly.rotations[nodes[i]].drill_null;
|
||||
Matrix metric{3U, 3U};
|
||||
Vector direction{3U};
|
||||
for (std::size_t a = 0; a < 3; ++a) {
|
||||
direction[a] = n[a];
|
||||
for (std::size_t b = 0; b < 3; ++b) {
|
||||
metric(a, b) = Entry(assembly.drilling_metric, 6U * nodes[i] + 3U + a,
|
||||
6U * nodes[i] + 3U + b);
|
||||
}
|
||||
}
|
||||
double stiffness = 0.0;
|
||||
{
|
||||
const dense_blas_internal::ScopedLocalDenseThreads local_threads{};
|
||||
stiffness = direction.Dot(metric.Multiply(direction));
|
||||
}
|
||||
const double stiffness = OrderedNullMetric(
|
||||
assembly.drilling_metric, nodes[i], n);
|
||||
if (!std::isfinite(stiffness) || !(stiffness > 0.0)) {
|
||||
return Result<Regularity>::Failure(
|
||||
Failure(domain, "dynamic-algebraic-regularity",
|
||||
@@ -674,6 +662,33 @@ Status HiddenEvidence(const Domain& domain, const DynamicAssembly& assembly,
|
||||
|
||||
} // namespace
|
||||
|
||||
double OrderedNullMetric(const SparseMatrix& metric, const std::size_t node,
|
||||
const Vector3& direction) {
|
||||
Vector left{9U};
|
||||
Vector entries{9U};
|
||||
Vector right{9U};
|
||||
for (std::size_t i = 0U; i < 3U; ++i)
|
||||
for (std::size_t j = 0U; j < 3U; ++j) {
|
||||
const auto index = 3U * i + j;
|
||||
left[index] = direction[i];
|
||||
entries[index] = Entry(metric, 6U * node + 3U + i,
|
||||
6U * node + 3U + j);
|
||||
right[index] = direction[j];
|
||||
if (!std::isfinite(left[index]) || !std::isfinite(entries[index]) ||
|
||||
!std::isfinite(right[index]))
|
||||
return std::numeric_limits<double>::quiet_NaN();
|
||||
}
|
||||
const dense_blas_internal::ScopedLocalDenseThreads local_threads{};
|
||||
const Vector first = dense_blas_internal::MultiplyDiagonal(left, entries);
|
||||
for (std::size_t i = 0U; i < first.Size(); ++i)
|
||||
if (!std::isfinite(first[i]))
|
||||
return std::numeric_limits<double>::quiet_NaN();
|
||||
const Vector products = dense_blas_internal::MultiplyDiagonal(first, right);
|
||||
double value = 0.0;
|
||||
for (std::size_t i = 0U; i < products.Size(); ++i) value += products[i];
|
||||
return value;
|
||||
}
|
||||
|
||||
std::vector<std::size_t> NullNodes(
|
||||
const DofManager& dofs,
|
||||
const std::vector<DynamicRotationKinematics>& rotations) {
|
||||
|
||||
Reference in New Issue
Block a user