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

Follow SOFA changes #77

Merged
merged 3 commits into from
Oct 12, 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
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ set(HEADER_FILES
${MOR_SRC}/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.inl
${MOR_SRC}/component/forcefield/HyperReducedTriangleFEMForceField.h
${MOR_SRC}/component/forcefield/HyperReducedTriangleFEMForceField.inl
# ${MOR_SRC}/component/forcefield/MechanicalMatrixMapperMOR.h
# ${MOR_SRC}/component/forcefield/MechanicalMatrixMapperMOR.inl

${MOR_SRC}/component/loader/MatrixLoader.h
${MOR_SRC}/component/loader/MatrixLoader.inl
Expand All @@ -65,7 +63,6 @@ set(SOURCE_FILES
${MOR_SRC}/component/forcefield/HyperReducedTetrahedronFEMForceField.cpp
${MOR_SRC}/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.cpp
${MOR_SRC}/component/forcefield/HyperReducedTriangleFEMForceField.cpp
# ${MOR_SRC}/component/forcefield/MechanicalMatrixMapperMOR.cpp

${MOR_SRC}/component/loader/MatrixLoader.cpp

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,6 @@
* Contact information: https://project.inria.fr/modelorderreduction/contact *
******************************************************************************/
#pragma once
#include <ModelOrderReduction/config.h>
#include <sofa/config.h>

#include <sofa/component/mapping/mappedmatrix/MechanicalMatrixMapper.h>

namespace sofa::component::interactionforcefield
{

template<typename TDataTypes1, typename TDataTypes2>
class MechanicalMatrixMapperMOR : public sofa::component::mapping::mappedmatrix::MechanicalMatrixMapper<TDataTypes1, TDataTypes2>
{
public:
SOFA_CLASS(SOFA_TEMPLATE2(MechanicalMatrixMapperMOR, TDataTypes1, TDataTypes2), SOFA_TEMPLATE2(sofa::component::mapping::mappedmatrix::MechanicalMatrixMapper, TDataTypes1, TDataTypes2));
typedef sofa::component::mapping::mappedmatrix::MechanicalMatrixMapper<TDataTypes1, TDataTypes2> Inherit;


protected:
MechanicalMatrixMapperMOR();
size_t m_nbInteractionForceFieldsMOR;
bool m_mouseInteraction;

public:
Data< bool > performECSW;
sofa::core::objectmodel::DataFileName listActiveNodesPath;
Data <sofa::type::vector<unsigned int>> listActiveNodes;
int nbActiveNodesAtStart;
Data< bool > timeInvariantMapping1;
Data< bool > timeInvariantMapping2;
Eigen::SparseMatrix<double> constantJ1;
Eigen::SparseMatrix<double> constantJ2;

Data< bool > saveReducedMass;
Data< bool > usePrecomputedMass;
sofa::core::objectmodel::DataFileName precomputedMassPath;
Eigen::SparseMatrix<double> JtMJ;


public:

virtual void init() override;

protected:
virtual void accumulateJacobiansOptimized(const core::MechanicalParams* mparams) override;
virtual void addMassToSystem(const core::MechanicalParams* mparams, const core::behavior::DefaultMultiMatrixAccessor* KAccessor) override;
virtual void addPrecomputedMassToSystem(const core::MechanicalParams* mparams, const unsigned int mstateSize, const Eigen::SparseMatrix<double>& Jeig, Eigen::SparseMatrix<double>& JtKJeig) override;
virtual void buildIdentityBlocksInJacobian(core::behavior::BaseMechanicalState* mstate, sofa::core::MatrixDerivId Id) override;
virtual void optimizeAndCopyMappingJacobianToEigenFormat1(const typename TDataTypes1::MatrixDeriv& J, Eigen::SparseMatrix<double>& Jeig) override;
virtual void optimizeAndCopyMappingJacobianToEigenFormat2(const typename TDataTypes2::MatrixDeriv& J, Eigen::SparseMatrix<double>& Jeig) override;



};

#if !defined(SOFA_COMPONENT_FORCEFIELD_MECHANICALMATRIXMAPPERMOR_CPP)
extern template class SOFA_MODELORDERREDUCTION_API MechanicalMatrixMapperMOR<sofa::defaulttype::Vec3Types, sofa::defaulttype::Rigid3Types>;
extern template class SOFA_MODELORDERREDUCTION_API MechanicalMatrixMapperMOR<sofa::defaulttype::Vec3Types, sofa::defaulttype::Vec3Types>;
extern template class SOFA_MODELORDERREDUCTION_API MechanicalMatrixMapperMOR<sofa::defaulttype::Vec1Types, sofa::defaulttype::Rigid3Types>;
extern template class SOFA_MODELORDERREDUCTION_API MechanicalMatrixMapperMOR<sofa::defaulttype::Vec1Types, sofa::defaulttype::Vec1Types>;
#endif // !defined(SOFA_COMPONENT_FORCEFIELD_MECHANICALMATRIXMAPPERMOR_CPP)
} // namespace sofa::component::interactionforcefield
SOFA_DISABLED_HEADER_NOT_REPLACED("v23.06", "v23.12")
Loading
Loading