-
Notifications
You must be signed in to change notification settings - Fork 252
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
[OptApp] Simp with the filtering factory #12149
[OptApp] Simp with the filtering factory #12149
Conversation
…g_factory' into optapp/simp_with_filtering_factory
…g_factory' into optapp/simp_with_filtering_factory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
…g_factory' into optapp/simp_with_filtering_factory
self.beta = min(self.beta * self.beta_increase_frac, self.beta_max) | ||
Kratos.Logger.PrintInfo(f"::{self.GetName()}::", f"Increased beta to {self.beta}.") | ||
|
||
def __ApplyDensityAndYoungsModulus(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are updating the density and you modulus i recommend to name the function UpdateDensityAndYoungModulus
if not IsSameContainerExpression(control_field, self.GetEmptyField()): | ||
raise RuntimeError(f"Updates for the required element container not found for control \"{self.GetName()}\". [ required model part name: {self.model_part.FullName()}, given model part name: {control_field.GetModelPart().FullName()} ]") | ||
|
||
if Kratos.Expression.Utils.NormL2(self.phi - control_field) > 1e-15: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is mistaken. Since phi is control field we are checking if it is updated or not and then we have to reset phi wi th the new control field and then filter phi/new control field and then project. but currently phi is reset with the filtered phi which is a mistake
raise RuntimeError(f"Updates for the required element container not found for control \"{self.GetName()}\". [ required model part name: {self.model_part.FullName()}, given model part name: {control_field.GetModelPart().FullName()} ]") | ||
|
||
if Kratos.Expression.Utils.NormL2(self.phi - control_field) > 1e-15: | ||
self.phi = self.filter.FilterField(control_field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.phi = self.filter.FilterField(control_field) | |
self.phi = control_field | |
filtered_phi = self.filter.FilterField(self.phi) |
Closing because this is moved to #12328 |
📝 Description
This PR introduces a SIMP control which uses the Filter::Factory for topologiy optimization.
🆕 Changelog