Skip to content

Commit

Permalink
Merge pull request #42 from fredroy/fix_compilation_2112
Browse files Browse the repository at this point in the history
Fix for compilation v21.12
  • Loading branch information
VannesteFelix authored Dec 15, 2021
2 parents 7cdfe83 + 0eac233 commit 280b0bb
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ class MORUnilateralInteractionConstraint : public UnilateralInteractionConstrain
// in position and stores it into resolution global vector
// ///
// /// @param v Global resolution vector
virtual void getPositionViolation(defaulttype::BaseVector *v) override;
virtual void getPositionViolation(linearalgebra::BaseVector *v) override;

// ///Computes constraint violation in velocity and stores it into resolution global vector
// ///
// /// @param v Global resolution vector
// virtual void getVelocityViolation(defaulttype::BaseVector *v);
// virtual void getVelocityViolation(linearalgebra::BaseVector *v);

public:

Expand All @@ -145,7 +145,7 @@ class MORUnilateralInteractionConstraint : public UnilateralInteractionConstrain
void buildConstraintMatrix(const core::ConstraintParams* cParams, DataMatrixDeriv &c1, DataMatrixDeriv &c2, unsigned int &cIndex
, const DataVecCoord &x1, const DataVecCoord &x2) override;

void getConstraintViolation(const core::ConstraintParams* cParams, defaulttype::BaseVector *v, const DataVecCoord &x1, const DataVecCoord &x2
void getConstraintViolation(const core::ConstraintParams* cParams, linearalgebra::BaseVector *v, const DataVecCoord &x1, const DataVecCoord &x2
, const DataVecDeriv &v1, const DataVecDeriv &v2) override;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include <SofaConstraint/UnilateralInteractionConstraint.inl>
#include <sofa/core/visual/VisualParams.h>
#include <sofa/type/Vec.h>
#include <sofa/defaulttype/RGBAColor.h>
#include <sofa/type/RGBAColor.h>
#include <sofa/linearalgebra/BaseVector.h>
#include "../loader/MatrixLoader.h"
#include "../loader/MatrixLoader.inl"

Expand Down Expand Up @@ -235,7 +236,7 @@ void MORUnilateralInteractionConstraint<DataTypes>::buildConstraintMatrix(const
}

template<class DataTypes>
void MORUnilateralInteractionConstraint<DataTypes>::getConstraintViolation(const core::ConstraintParams *cparams, defaulttype::BaseVector *v, const DataVecCoord &, const DataVecCoord &
void MORUnilateralInteractionConstraint<DataTypes>::getConstraintViolation(const core::ConstraintParams *cparams, linearalgebra::BaseVector *v, const DataVecCoord &, const DataVecCoord &
, const DataVecDeriv &, const DataVecDeriv &)
{
switch (cparams->constOrder())
Expand All @@ -257,7 +258,7 @@ void MORUnilateralInteractionConstraint<DataTypes>::getConstraintViolation(const
}

template<class DataTypes>
void MORUnilateralInteractionConstraint<DataTypes>::getPositionViolation(defaulttype::BaseVector *v)
void MORUnilateralInteractionConstraint<DataTypes>::getPositionViolation(linearalgebra::BaseVector *v)
{
const VecCoord &PfreeVec = this->getMState2()->read(core::ConstVecCoordId::freePosition())->getValue();
const VecCoord &QfreeVec = this->getMState1()->read(core::ConstVecCoordId::freePosition())->getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <sofa/helper/config.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>
#include <sofa/defaulttype/RGBAColor.h>
#include <sofa/type/RGBAColor.h>

#include <assert.h>
#include <iostream>
Expand All @@ -43,7 +43,7 @@ using helper::ReadAccessor;
using core::behavior::BaseMechanicalState;
using core::behavior::MultiMatrixAccessor;
using core::behavior::ForceField;
using defaulttype::BaseMatrix;
using linearalgebra::BaseMatrix;
using core::VecCoordId;
using core::MechanicalParams;
using type::Vector3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class HyperReducedTetrahedralCorotationalFEMForceField : public virtual Tetrahed
virtual void addForce(const core::MechanicalParams* mparams, DataVecDeriv& d_f, const DataVecCoord& d_x, const DataVecDeriv& d_v) override;
virtual void addDForce(const core::MechanicalParams* mparams, DataVecDeriv& d_df, const DataVecDeriv& d_dx) override;

virtual void addKToMatrix(sofa::defaulttype::BaseMatrix *m, SReal kFactor, unsigned int &offset) override;
virtual void addKToMatrix(sofa::linearalgebra::BaseMatrix *m, SReal kFactor, unsigned int &offset) override;

void draw(const core::visual::VisualParams* vparams) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ void HyperReducedTetrahedralCorotationalFEMForceField<DataTypes>::draw(const cor


template<class DataTypes>
void HyperReducedTetrahedralCorotationalFEMForceField<DataTypes>::addKToMatrix(sofa::defaulttype::BaseMatrix *mat, SReal k, unsigned int &offset)
void HyperReducedTetrahedralCorotationalFEMForceField<DataTypes>::addKToMatrix(sofa::linearalgebra::BaseMatrix *mat, SReal k, unsigned int &offset)
{
// Build Matrix Block for this ForceField
unsigned int i,j,n1, n2, row, column, ROW, COLUMN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class HyperReducedTetrahedronFEMForceField : public virtual TetrahedronFEMForceF
// Make other overloaded version of getPotentialEnergy() to show up in subclass.
using TetrahedronFEMForceField<DataTypes>::getPotentialEnergy;

virtual void addKToMatrix(sofa::defaulttype::BaseMatrix *m, SReal kFactor, unsigned int &offset) override;
virtual void addKToMatrix(sofa::linearalgebra::BaseMatrix *m, SReal kFactor, unsigned int &offset) override;
virtual void addKToMatrix(const core::MechanicalParams* /*mparams*/, const sofa::core::behavior::MultiMatrixAccessor* /*matrix*/ ) override;

void draw(const core::visual::VisualParams* vparams) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ void HyperReducedTetrahedronFEMForceField<DataTypes>::addKToMatrix(const core::M
}

template<class DataTypes>
void HyperReducedTetrahedronFEMForceField<DataTypes>::addKToMatrix(sofa::defaulttype::BaseMatrix *mat, SReal k, unsigned int &offset)
void HyperReducedTetrahedronFEMForceField<DataTypes>::addKToMatrix(sofa::linearalgebra::BaseMatrix *mat, SReal k, unsigned int &offset)
{
// Build Matrix Block for this ForceField
unsigned int i,j,n1, n2, row, column, ROW, COLUMN , IT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ namespace forcefield
{
using namespace std;
using namespace sofa::defaulttype;
using namespace sofa::component::topology;
using namespace sofa::core::topology;

//***************** Tetrahedron FEM code for several elastic models: TotalLagrangianForceField************************//
Expand Down Expand Up @@ -128,7 +127,7 @@ public :

virtual void addForce(const core::MechanicalParams* mparams /* PARAMS FIRST */, DataVecDeriv& d_f, const DataVecCoord& d_x, const DataVecDeriv& d_v) override;
virtual void addDForce(const core::MechanicalParams* mparams /* PARAMS FIRST */, DataVecDeriv& d_df, const DataVecDeriv& d_dx) override;
virtual void addKToMatrix(sofa::defaulttype::BaseMatrix *mat, SReal k, unsigned int &offset) override;
virtual void addKToMatrix(sofa::linearalgebra::BaseMatrix *mat, SReal k, unsigned int &offset) override;

void draw(const core::visual::VisualParams* vparams) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void HyperReducedTetrahedronHyperelasticityFEMForceField<DataTypes>::addDForce(c
}

template <class DataTypes>
void HyperReducedTetrahedronHyperelasticityFEMForceField<DataTypes>::addKToMatrix(sofa::defaulttype::BaseMatrix *mat, SReal k, unsigned int &offset)
void HyperReducedTetrahedronHyperelasticityFEMForceField<DataTypes>::addKToMatrix(sofa::linearalgebra::BaseMatrix *mat, SReal k, unsigned int &offset)
{

/// if the matrix needs to be updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected :
void applyStiffnessLarge( VecCoord& f, Real h, const VecCoord& x, const SReal &kFactor );

//// stiffness matrix assembly
void addKToMatrix(sofa::defaulttype::BaseMatrix *mat, SReal k, unsigned int &offset) override; // compute and add all the element stiffnesses to the global stiffness matrix
void addKToMatrix(sofa::linearalgebra::BaseMatrix *mat, SReal k, unsigned int &offset) override; // compute and add all the element stiffnesses to the global stiffness matrix

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ void HyperReducedTriangleFEMForceField<DataTypes>::draw(const core::visual::Visu


template<class DataTypes>
void HyperReducedTriangleFEMForceField<DataTypes>::addKToMatrix(sofa::defaulttype::BaseMatrix *mat, SReal k, unsigned int &offset)
void HyperReducedTriangleFEMForceField<DataTypes>::addKToMatrix(sofa::linearalgebra::BaseMatrix *mat, SReal k, unsigned int &offset)
{
if (d_performECSW.getValue())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void MechanicalMatrixMapperMOR<DataTypes1, DataTypes2>::addPrecomputedMassToSyst
typedef typename DataTypes1::Real Real1;

typedef typename CompressedRowSparseMatrix<Real1>::Range Range;
typedef sofa::defaulttype::BaseVector::Index Index;
typedef sofa::linearalgebra::BaseVector::Index Index;



Expand Down
4 changes: 2 additions & 2 deletions src/ModelOrderReduction/component/mapping/MORContactMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class MORContactMapping : public core::Mapping<TIn, TOut>

void applyJT(const core::ConstraintParams *cparams, Data<InMatrixDeriv>& out, const Data<MatrixDeriv>& in) override;

const sofa::defaulttype::BaseMatrix* getJ() override;
const sofa::linearalgebra::BaseMatrix* getJ() override;

void handleTopologyChange() override;

Expand All @@ -135,7 +135,7 @@ class MORContactMapping : public core::Mapping<TIn, TOut>
typedef linearsolver::EigenSparseMatrix<TIn, TOut> eigen_type;
eigen_type J;

typedef type::vector< defaulttype::BaseMatrix* > js_type;
typedef type::vector< linearalgebra::BaseMatrix* > js_type;
js_type Js;

Eigen::MatrixXd m_matrix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void MORContactMapping<TIn, TOut>::handleTopologyChange()
}

template <class TIn, class TOut>
const sofa::defaulttype::BaseMatrix* MORContactMapping<TIn, TOut>::getJ()
const sofa::linearalgebra::BaseMatrix* MORContactMapping<TIn, TOut>::getJ()
{
return &J;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ModelOrderReductionMapping : public core::Mapping<TIn, TOut>
typedef core::topology::BaseMeshTopology::SeqTetrahedra VecElement;

typedef linearsolver::EigenSparseMatrix<TIn, TOut> eigen_type;
typedef type::vector< defaulttype::BaseMatrix* > js_type;
typedef type::vector< linearalgebra::BaseMatrix* > js_type;


enum
Expand Down Expand Up @@ -144,7 +144,7 @@ class ModelOrderReductionMapping : public core::Mapping<TIn, TOut>

void applyJT(const core::ConstraintParams *cparams, Data<InMatrixDeriv>& out, const Data<MatrixDeriv>& in) override;

const sofa::defaulttype::BaseMatrix* getJ() override;
const sofa::linearalgebra::BaseMatrix* getJ() override;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void ModelOrderReductionMapping<TIn, TOut>::applyJT(const core::ConstraintParams


template <class TIn, class TOut>
const sofa::defaulttype::BaseMatrix* ModelOrderReductionMapping<TIn, TOut>::getJ()
const sofa::linearalgebra::BaseMatrix* ModelOrderReductionMapping<TIn, TOut>::getJ()
{
// updateJ();
return &m_J;
Expand Down

0 comments on commit 280b0bb

Please sign in to comment.