Skip to content
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
7 changes: 4 additions & 3 deletions BeamAdapter_test/BeamInterpolation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ struct BeamInterpolationTest : public sofa::testing::BaseSimulationTest,
return root;
}

void checkDataInitialization(const Data<type::vector<SReal>>& data,
const SReal& defaultValue,
template<class Real>
void checkDataInitialization(const Data<type::vector<Real>>& data,
const Real& defaultValue,
const sofa::Size& nbBeam,
const SReal& value)
const Real& value)
{
const auto& vector = helper::getReadAccessor(data);
ASSERT_EQ(vector.size(), nbBeam);
Expand Down
6 changes: 3 additions & 3 deletions BeamAdapter_test/component/mapping/BeamLengthMappingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct BeamLengthMappingTest : public sofa::mapping_test::Mapping_test<_BeamLeng
this->deltaRange.first= 1;
this->deltaRange.second= 1000;

MechanicalObject<defaulttype::Rigid3dTypes>* FromModel = nullptr;
MechanicalObject<defaulttype::Rigid3Types>* FromModel = nullptr;
this->root->getTreeObject(FromModel);
this->inDofs = FromModel;

Expand Down Expand Up @@ -215,7 +215,7 @@ struct BeamLengthMappingTest : public sofa::mapping_test::Mapping_test<_BeamLeng
this->deltaRange.second= 100000;


MechanicalObject<defaulttype::Rigid3dTypes>* FromModel = nullptr;
MechanicalObject<defaulttype::Rigid3Types>* FromModel = nullptr;
this->root->getTreeObject(FromModel);
this->inDofs = FromModel;

Expand Down Expand Up @@ -259,7 +259,7 @@ struct BeamLengthMappingTest : public sofa::mapping_test::Mapping_test<_BeamLeng
// Define the list of types to instanciate. We do not necessarily need to test all combinations.
using ::testing::Types;
typedef Types<
BeamLengthMapping<defaulttype::Rigid3dTypes,defaulttype::Vec1dTypes>
BeamLengthMapping<defaulttype::Rigid3Types,defaulttype::Vec1Types>
//,mapping::_beamlengthmapping_::BeamLengthMapping<defaulttype::Rigid3fTypes,defaulttype::Vec1fTypes>
> DataTypes; // the types to instanciate.

Expand Down
2 changes: 1 addition & 1 deletion src/BeamAdapter/component/BaseBeamInterpolation.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class BaseBeamInterpolation : public sofa::core::behavior::SingleStateAccessor<D
Data< VecEdgeID > d_edgeList;

///2. Vector of length of each beam. Same size as @sa d_edgeList
Data< type::vector< Real > > d_lengthList;
Data< type::vector< SReal > > d_lengthList;

///3. (optional) apply a rigid Transform between the degree of Freedom and the first node of the beam. Indexation based on the num of Edge
Data< type::vector< Transform > > d_DOF0TransformNode0;
Expand Down
2 changes: 1 addition & 1 deletion src/BeamAdapter/component/BeamInterpolation.inl
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ template <class DataTypes>
typename BeamInterpolation<DataTypes>::Real BeamInterpolation<DataTypes>::getRestTotalLength()
{
Real le(0.0);
const type::vector< double > &lengthList = this->d_lengthList.getValue();
const type::vector< SReal > &lengthList = this->d_lengthList.getValue();

for (unsigned int i = 0; i < lengthList.size(); i++)
le += lengthList[i];
Expand Down
Loading