[OptApp] Simp with the filtering factory#12149
Closed
sunethwarna wants to merge 8 commits intooptapp/filtering/create_filtering_factoryfrom
Closed
[OptApp] Simp with the filtering factory#12149sunethwarna wants to merge 8 commits intooptapp/filtering/create_filtering_factoryfrom
sunethwarna wants to merge 8 commits intooptapp/filtering/create_filtering_factoryfrom
Conversation
…g_factory' into optapp/simp_with_filtering_factory
…g_factory' into optapp/simp_with_filtering_factory
…g_factory' into optapp/simp_with_filtering_factory
RezaNajian
requested changes
Mar 7, 2024
| 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: |
Contributor
There was a problem hiding this comment.
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: |
Contributor
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
Suggested change
| self.phi = self.filter.FilterField(control_field) | |
| self.phi = control_field | |
| filtered_phi = self.filter.FilterField(self.phi) |
Member
Author
|
Closing because this is moved to #12328 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📝 Description
This PR introduces a SIMP control which uses the Filter::Factory for topologiy optimization.
🆕 Changelog