Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[src] Fix AdaptiveBeamMapping mapping at init with none deployed beam #154

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

epernod
Copy link
Contributor

@epernod epernod commented Jul 17, 2024

In the case of visual mapping:

    <Node name='VisuGuideCatheter'>
        <MechanicalObject name='dof_visual_GC' />
        <QuadSetTopologyContainer  name='ContainerGC' />
        <QuadSetTopologyModifier />
        <QuadSetGeometryAlgorithms template='Vec3d' />
        <Edge2QuadTopologicalMapping nbPointsOnEachCircle='10' radius='2.06' input='@../../GuideCatheter/GC_mesh' output='@ContainerGC' flipNormals='true'/>

        <AdaptiveBeamMapping  name='VisuMapGuideCath' useCurvAbs='1' printLog='0' interpolation='@../Interpol_GCatheter' input='@../Instrument_DOFs' output='@dof_visual_GC' isMechanical='false'  />

The Edge2QuadTopologicalMapping is creating the tubular topology and dofs. But on the other hand, the AdaptiveBeamMapping is looking for the number of beam in the WireBeamInterpolation which is now returning 0, because the beam is not deployed yet.
So at init the interpolation is not performed in the AdaptiveBeamMapping, therfor the default value computed from Edge2QuadTopologicalMapping are used.

Then, at first simulation step:
WireBeamInterpolation return 1 beam, then AdaptiveBeamMapping is interpolating all points and edges around the beam points. All the points that are not linked to the only beam deployed are set to 0.

*Note: In AdaptiveBeamMapping::computeDistribution if only one beam is found, all the other points are associated with beamId =0. Therefore in Apply and ApplyJ we interpolate all points being at X =0 on the beamId = 0 using, projection etc... Which is quite costly to interpolate 0 on 0.
Moreover at init if we want to use the "normal behavior" with no Beam is define the component crash.

So this fix is not perfect... but the default behavior is not neither.

@epernod epernod added pr: fix pr: status to review To notify reviewers to review this pull-request labels Jul 17, 2024
@bakpaul bakpaul added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Jul 26, 2024
@bakpaul bakpaul merged commit 930781f into sofa-framework:master Jul 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants