[src] Fix AdaptiveBeamMapping mapping at init with none deployed beam #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the case of visual mapping:
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.