Integrate Refactor solver sources and dual MSVC CMake builds

This commit is contained in:
KOKO\Mimi
2026-10-18 02:10:51 +09:00
parent 7ee32e5837
commit 12d51480de
218 changed files with 17842 additions and 9689 deletions
+13 -46
View File
@@ -12,10 +12,17 @@
#include "fesa/analysis/analysis_model.h"
#include "fesa/assembly/load_assembler.h"
#include "fesa/elements/finite_rotation.h"
#include "math/vector3_operations.h"
#include "elements/shell_kernel_values.h"
#include "math/dense_blas_internal.h"
namespace fesa {
namespace {
using shell_kernel_internal::FrameMatrix;
using math_internal::Multiply;
using math_internal::Skew;
constexpr std::size_t kDofsPerNode = 6U;
constexpr std::size_t kTranslationDofCount = 3U;
constexpr double kMomentAdmissibilityThreshold = 1.0e-12;
@@ -67,27 +74,6 @@ Result<Vector3> RotationVectorForNode(const Vector& trial,
return Result<Vector3>::Success(rotation);
}
/// @brief Builds a proper initial frame from its semantic nodal record.
Matrix InitialFrame(const ShellNodeInitialFrame& frame) {
Matrix result{3U, 3U};
for (std::size_t row = 0U; row < kTranslationDofCount; ++row) {
result(row, 0U) = frame.tangent_a[row];
result(row, 1U) = frame.tangent_b[row];
result(row, 2U) = frame.director[row];
}
return result;
}
/// @brief Multiplies a 3-by-3 matrix by a Vector3.
Vector3 Multiply(const Matrix& matrix, const Vector3& vector) {
return {matrix(0U, 0U) * vector.X() + matrix(0U, 1U) * vector.Y() +
matrix(0U, 2U) * vector.Z(),
matrix(1U, 0U) * vector.X() + matrix(1U, 1U) * vector.Y() +
matrix(1U, 2U) * vector.Z(),
matrix(2U, 0U) * vector.X() + matrix(2U, 1U) * vector.Y() +
matrix(2U, 2U) * vector.Z()};
}
/// @brief Multiplies a 3-by-3 matrix transpose by a Vector3.
Vector3 MultiplyTranspose(const Matrix& matrix, const Vector3& vector) {
return {matrix(0U, 0U) * vector.X() + matrix(1U, 0U) * vector.Y() +
@@ -98,37 +84,18 @@ Vector3 MultiplyTranspose(const Matrix& matrix, const Vector3& vector) {
matrix(2U, 2U) * vector.Z()};
}
/// @brief Forms the three-dimensional skew matrix of a global vector.
Matrix Skew(const Vector3& vector) {
Matrix result{3U, 3U};
result(0U, 1U) = -vector.Z();
result(0U, 2U) = vector.Y();
result(1U, 0U) = vector.Z();
result(1U, 2U) = -vector.X();
result(2U, 0U) = -vector.Y();
result(2U, 1U) = vector.X();
return result;
}
/// @brief Scales a small dense matrix without changing its shape.
Matrix Scale(const Matrix& matrix, const double scale) {
Matrix result{matrix.Rows(), matrix.Columns()};
for (std::size_t row = 0U; row < matrix.Rows(); ++row) {
for (std::size_t column = 0U; column < matrix.Columns(); ++column) {
result(row, column) = scale * matrix(row, column);
}
}
Matrix result{matrix};
result.Scale(scale);
return result;
}
/// @brief Adds matching small dense matrices.
Matrix Add(const Matrix& left, const Matrix& right) {
Matrix result{left.Rows(), left.Columns()};
for (std::size_t row = 0U; row < left.Rows(); ++row) {
for (std::size_t column = 0U; column < left.Columns(); ++column) {
result(row, column) = left(row, column) + right(row, column);
}
}
Matrix result{left};
dense_blas_internal::AxpyValues(1.0, right.Data(),
left.Rows() * left.Columns(), result.Data());
return result;
}
@@ -472,7 +439,7 @@ Result<GlobalFixedLoadContribution> AssembleGlobalFixedLoadContribution(
return Result<GlobalFixedLoadContribution>::Failure(phi.GetStatus());
}
auto rotation =
MakeFiniteRotationState(phi.Value(), InitialFrame(*frames[node]));
MakeFiniteRotationState(phi.Value(), FrameMatrix(*frames[node]));
if (!rotation.HasValue()) {
return Result<GlobalFixedLoadContribution>::Failure(rotation.GetStatus());
}