Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MatrixAccumulator] adds 6x6 matrix handling #4247

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sofa/framework/Core/src/sofa/core/DerivativeMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class DerivativeMatrix : public MechanicalStatesMatrixAccumulators<c>
void operator+=(const sofa::type::Mat<2, 2, double>& value) const { mat->add(row, col, value); }
void operator+=(const sofa::type::Mat<3, 3, float> & value) const { mat->add(row, col, value); }
void operator+=(const sofa::type::Mat<3, 3, double>& value) const { mat->add(row, col, value); }
void operator+=(const sofa::type::Mat<6, 6, float> & value) const { mat->add(row, col, value); }
void operator+=(const sofa::type::Mat<6, 6, double>& value) const { mat->add(row, col, value); }

[[nodiscard]] bool isValid() const { return mat != nullptr; }
operator bool() const { return isValid(); }
Expand Down
12 changes: 12 additions & 0 deletions Sofa/framework/Core/src/sofa/core/MatrixAccumulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ void MatrixAccumulatorInterface::add(sofa::SignedIndex row, sofa::SignedIndex co
matAdd(row, col, value);
}

void MatrixAccumulatorInterface::add(sofa::SignedIndex row, sofa::SignedIndex col,
const sofa::type::Mat<6, 6, float>& value)
{
matAdd(row, col, value);
}

void MatrixAccumulatorInterface::add(sofa::SignedIndex row, sofa::SignedIndex col,
const sofa::type::Mat<6, 6, double>& value)
{
matAdd(row, col, value);
}

helper::logging::MessageDispatcher::LoggerStream matrixaccumulator::RangeVerification::
logger() const
{
Expand Down
2 changes: 2 additions & 0 deletions Sofa/framework/Core/src/sofa/core/MatrixAccumulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class SOFA_CORE_API MatrixAccumulatorInterface
virtual void add(sofa::SignedIndex row, sofa::SignedIndex col, const sofa::type::Mat<2, 2, double>& value);
virtual void add(sofa::SignedIndex row, sofa::SignedIndex col, const sofa::type::Mat<3, 3, float> & value);
virtual void add(sofa::SignedIndex row, sofa::SignedIndex col, const sofa::type::Mat<3, 3, double>& value);
virtual void add(sofa::SignedIndex row, sofa::SignedIndex col, const sofa::type::Mat<6, 6, float> & value);
virtual void add(sofa::SignedIndex row, sofa::SignedIndex col, const sofa::type::Mat<6, 6, double>& value);

virtual void clear() {}

Expand Down
Loading