Skip to content

Commit

Permalink
Fix additional warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hugtalbot committed Feb 28, 2024
1 parent 2f54e06 commit 1510488
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ struct AdaptiveBeamForceFieldAndMassTest : public sofa::testing::BaseSimulationT
EXPECT_NEAR(positions[id][2], 0, 1e-4);

// run some simulation steps
auto simulation = sofa::simulation::getSimulation();
for (int i = 0; i < nbrStep; i++)
{
sofa::simulation::node::animate(root.get(), 0.01);
Expand Down
2 changes: 1 addition & 1 deletion BeamAdapter_test/component/model/WireRestShape_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void WireRestShape_test::testParameterInit()
EXPECT_EQ(nbP_density.size(), 2);
EXPECT_EQ(nbP_density, nbP_density_ref);

Real dx1, dx2, dx3, nbEdgesCol_ref = 20;
Real dx1, dx2, dx3;
wire->getCollisionSampling(dx1, 0.0);
wire->getCollisionSampling(dx2, fullLength);
wire->getCollisionSampling(dx3, 90.0);
Expand Down
8 changes: 4 additions & 4 deletions src/BeamAdapter/component/engine/WireRestShape.inl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool WireRestShape<DataTypes>::initTopology()
Real prev_length = 0.0;
int prev_edges = 0;
int startPtId = 0;
for (auto i = 0; i < l_sectionMaterials.size(); ++i)
for (sofa::Size i = 0; i < l_sectionMaterials.size(); ++i)
{
// Add topology of the material
int nbrVisuEdges = l_sectionMaterials.get(i)->getNbVisualEdges();
Expand Down Expand Up @@ -212,7 +212,7 @@ void WireRestShape<DataTypes>::getCollisionSampling(Real &dx, const Real &x_curv
}

// Check in which section x_used belongs to and get access to this section material
for (auto i = 1; i< keyPts.size(); ++i)
for (sofa::Size i = 1; i< keyPts.size(); ++i)
{
if (x_used <= keyPts[i])
{
Expand Down Expand Up @@ -264,7 +264,7 @@ void WireRestShape<DataTypes>::getYoungModulusAtX(const Real& x_curv, Real& youn
const type::vector<Real>& keyPts = d_keyPoints.getValue();

// Depending on the position of the beam, determine the corresponding section material and returning its Young modulus
for (auto i = 1; i < keyPts.size(); ++i)
for (sofa::Size i = 1; i < keyPts.size(); ++i)
{
if (x_used <= keyPts[i])
{
Expand All @@ -283,7 +283,7 @@ void WireRestShape<DataTypes>::getInterpolationParam(const Real& x_curv, Real &_
const type::vector<Real>& keyPts = d_keyPoints.getValue();

// Check in which section x_used belongs to and get access to this section material
for (auto i = 1; i < keyPts.size(); ++i)
for (sofa::Size i = 1; i < keyPts.size(); ++i)
{
if (x_used <= keyPts[i])
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ void AdaptiveBeamForceFieldAndMass<DataTypes>::computeStiffness(int beamId, Beam
template<class DataTypes>
void AdaptiveBeamForceFieldAndMass<DataTypes>::computeMass(int beamId, BeamLocalMatrices& beamLocalMatrix)
{
SOFA_UNUSED(beamId);
Real L2 = (Real) (beamLocalMatrix._L * beamLocalMatrix._L);
beamLocalMatrix.m_M00.clear(); beamLocalMatrix.m_M01.clear(); beamLocalMatrix.m_M10.clear(); beamLocalMatrix.m_M11.clear();

Expand Down
1 change: 0 additions & 1 deletion src/BeamAdapter/component/mapping/AdaptiveBeamMapping.inl
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ void AdaptiveBeamMapping< TIn, TOut>::computeDistribution()
else
{
m_pointBeamDistribution.reserve(points.size());
const bool printLog = this->f_printLog.getValue();
for (unsigned int i=0; i<points.size(); i++)
{
const unsigned int beamId = (int)floor(points[i][0]);
Expand Down
2 changes: 2 additions & 0 deletions src/BeamAdapter/component/mapping/BeamLengthMapping.inl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ void BeamLengthMapping< TIn, TOut>::reset()
template <class TIn, class TOut>
void BeamLengthMapping< TIn, TOut>::apply(const MechanicalParams* mparams, Data<VecCoord>& dOut, const Data<InVecCoord>& dIn)
{
SOFA_UNUSED(mparams);
SCOPED_TIMER("AdaptiveBeamMappingApply");

VecCoord& out = *dOut.beginEdit();
Expand Down Expand Up @@ -591,6 +592,7 @@ void BeamLengthMapping< TIn, TOut>::applyDJT(const MechanicalParams* mparams, co
template <class TIn, class TOut>
void BeamLengthMapping<TIn, TOut>::updateK(const core::MechanicalParams* mparams, core::ConstMultiVecDerivId childForceId )
{
SOFA_UNUSED(mparams);
const unsigned& geometricStiffness = d_geometricStiffness.getValue();
if( !geometricStiffness ) { K_geom.resize(0,0); return; }
//helper::ReadAccessor<Data<VecDeriv> > childForce( *childForceId[(const core::State<TOut>*)this->getToModels()[0]].read() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void BeamProjectionDifferenceMultiMapping<TIn1, TIn2, TOut>::computeProjection(c
Real distMin = std::numeric_limits<Real>::max();

// find the min distance between P and its projection on each edge of xTo
for (int e=0; e<edges.size(); e++)
for (sofa::Size e=0; e<edges.size(); e++)
{
const auto& edge = edges[e];
In2Coord Q1 = xTo[edge[0]];
Expand Down

0 comments on commit 1510488

Please sign in to comment.