Kratos icon indicating copy to clipboard operation
Kratos copied to clipboard

[Fluid] Skip replace elements&conditions if geometry-based input modeler is used

Open rubenzorrilla opened this issue 1 year ago • 1 comments

📝 Description With this PR we will skip the elements and conditions replace done by the ReplaceElementsAndConditionsProcess for the use_input_model_part option in the I/O.

Note that this is aligned with the geometry-based I/O we are targeting with the new modelers.

@KratosMultiphysics/altair as far as I understand this shouldn't break anything in your side. In any case, I'm pinging you to confirm that this doesn't break any specific thing in your custom multistage.

PD: The change of setting the echo level to the strategy after creating it sneaked in :sweat_smile:. I'd keep it there.

rubenzorrilla avatar Feb 19 '24 15:02 rubenzorrilla

Agreed with @ddiezrod, but I'm adding the API breaker tag

jcotela avatar Feb 20 '24 09:02 jcotela

Agreed with @ddiezrod, but I'm adding the API breaker tag

Well, I'm not sure we're breaking the API but changing the default behavior. Let me add the behavior change tag too.

rubenzorrilla avatar Feb 21 '24 11:02 rubenzorrilla

@marcnunezc @inigolcanalejo I think that the test crashing in here is yours. The point is that the primal solution solver in the optimizing is assuming the input model part to be the one from the previous iteration (makes perfect sense). The point is, as far as I understand, that it assumes replacing the elements & conditions (at each iteration!). This is even trickier as the ShapeOptimizationApplication is used, which doesn't follow the conventional AnalysisStage simulation pipeline.

To prevent the test crashing, I added a enforce_elements_and_conditions_replacement member var to the base solver. This is defaulted to False and overwritten in the derived potential solver to True, something that effectively results in the behavior previous to this PR. I make clear that this is IMO a temporary hack since specifying use_input_model_part means use input model part as it is, including elements and conditions. Expecting these to be changed would have been a use_input_geometry setting.

Also pinging @sunethwarna as this uses the ShapeOptimizationApplication, which as far as I know must be substituted by the new OptimizationApplication. Also pinging @Marco1410 as this directly related to his PhD.

rubenzorrilla avatar Feb 21 '24 13:02 rubenzorrilla