Skip to content

Commit

Permalink
Follow SOFA changes (#77)
Browse files Browse the repository at this point in the history
* Follow SOFA changes

* Fix compilation
  • Loading branch information
alxbilger authored Oct 12, 2023
1 parent f1421dd commit 91d9367
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 412 deletions.
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

0 comments on commit 91d9367

Please sign in to comment.