Skip to content

Commit

Permalink
[src] Fix AdaptiveBeamMapping mapping at init with none deployed beam
Browse files Browse the repository at this point in the history
  • Loading branch information
epernod committed Jul 17, 2024
1 parent 9e2dbec commit 5ae17a9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/BeamAdapter/component/mapping/AdaptiveBeamMapping.inl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void AdaptiveBeamMapping< TIn, TOut>::init()
{
simulation::MainTaskSchedulerFactory::createInRegistry()->init();
}

this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid);
}


Expand Down Expand Up @@ -273,6 +275,14 @@ void AdaptiveBeamMapping< TIn, TOut>::apply(const MechanicalParams* mparams, Dat

};


// HACK for init: In case the number of output points is bigger to the number of distribution, set all points to 0
for (int i = m_pointBeamDistribution.size(); i < d_points.getValue().size(); i++)
{
out[i] = Vec<3, InReal>(0.0, 0.0, 0.0);
}


const bool multithreading = d_parallelMapping.getValue();

const simulation::ForEachExecutionPolicy execution = multithreading ?
Expand Down

0 comments on commit 5ae17a9

Please sign in to comment.