-
Notifications
You must be signed in to change notification settings - Fork 249
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] Unify filtering mechanisms using FilterFactory #12201
Merged
sunethwarna
merged 92 commits into
master
from
optapp/filters/unify_filters_with_factory
Apr 2, 2024
Merged
[OptApp] Unify filtering mechanisms using FilterFactory #12201
sunethwarna
merged 92 commits into
master
from
optapp/filters/unify_filters_with_factory
Apr 2, 2024
Conversation
This file contains 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
… into optapp/filters/unify_filters_with_factory
… into optapp/filters/unify_filters_with_factory
… into optapp/filters/unify_filters_with_factory
… into optapp/filters/unify_filters_with_factory
… into optapp/filters/unify_filters_with_factory
…y_filters_with_factory
Hi @RezaNajian , @Igarizza , could you have a look at this? |
RezaNajian
approved these changes
Apr 2, 2024
@sunethwarna thanks, very good ! |
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 unifies the filters used in
OptApp
to one factory, and updates the controls to use the filtering. Following major changes were made:Explicit Filtering
There is no need to have seperate DampingFunction anymore because, I unified all the filter functions including sigmoidal function. Now all of them can be used either as filter or damping. Following figure shows the filter functions: (May be in future, we can have seperate settings for these functions, so we can tweak some of the coeffs used in these filter functions).
![image](https://private-user-images.githubusercontent.com/7856520/313687796-f4284615-6db7-45b9-9372-81cc74ed5a8d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5ODQwNTIsIm5iZiI6MTczODk4Mzc1MiwicGF0aCI6Ii83ODU2NTIwLzMxMzY4Nzc5Ni1mNDI4NDYxNS02ZGI3LTQ1YjktOTM3Mi04MWNjNzRlZDVhOGQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMDMwMjMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzliY2YxZjcwMDI4OTE3MGIyM2MyNTA0YzZhMzkzODQ1Nzk0OWJhMjllMTc2MjRlMmE3Yjg0NTY4MTRkMTEyMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.z2FEVbGLE0lbp40ifR8LW1J222YkucQ-YJstCUYUiR4)
Now damping diagonal matrix is specified externally as an
Expression
. So this allows creating damping matrices with different mechanisms. Hence, the signature to theComputeWeightForAllNeighbors
changed. This does not have additional performance impact. Because, earlier also we used twoKDTree
s, one for fitlering, one for damping. This is still the same.VertexMorphinShapeControl
Now uses the
Filter::FilterFactory
to get the filter. It allows following combinations:ShellThicknessControl
physical_phi_field
is kept and updated to support filtering based on the deltas.control_phi_field
is computed from theUnfilter
method as in the vm_shape_control.Followings are the test cases which I ran (can be found in https://github.com/KratosMultiphysics/Examples/tree/master/optimization_application/use_cases):
![comparison_shape_only](https://private-user-images.githubusercontent.com/7856520/313702692-cfa661cc-13b0-4d8e-afac-84f77c4fd226.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5ODQwNTIsIm5iZiI6MTczODk4Mzc1MiwicGF0aCI6Ii83ODU2NTIwLzMxMzcwMjY5Mi1jZmE2NjFjYy0xM2IwLTRkOGUtYWZhYy04NGY3N2M0ZmQyMjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMDMwMjMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODY1N2QyYzIwYTI2ZjIzZmRkNTA4ODE1NDQ0Njg1N2ViOTc0YWQwZjQ0NWJlNDkxZmZlMGNlYjRhNjI4NjFjMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.g8ImnBWPhs6nzpelEUOmTwhUWZgZe4sE4IFZmGc0ufs)
![comparison_shape_thickness](https://private-user-images.githubusercontent.com/7856520/313703539-de596603-5e99-4e8a-bf9c-39cbbd266344.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5ODQwNTIsIm5iZiI6MTczODk4Mzc1MiwicGF0aCI6Ii83ODU2NTIwLzMxMzcwMzUzOS1kZTU5NjYwMy01ZTk5LTRlOGEtYmY5Yy0zOWNiYmQyNjYzNDQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMDMwMjMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmQ0M2I0ODljZWEzYzlmODQwZGZjN2U1NDIzNjVmMWMyZjZmY2YxNTY5ZDg2YjQxMWRhODYzMjIwZjU2MDk2YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.37430uszSKAO6sJcTobzLwPEbX3o5AuQ5gfllPjlk9c)
![shape_only_comparison](https://private-user-images.githubusercontent.com/7856520/313705891-75dfdb0c-58d2-4398-89e2-7fa308a17137.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5ODQwNTIsIm5iZiI6MTczODk4Mzc1MiwicGF0aCI6Ii83ODU2NTIwLzMxMzcwNTg5MS03NWRmZGIwYy01OGQyLTQzOTgtODllMi03ZmEzMDhhMTcxMzcuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMDMwMjMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGFlM2ZjMTZkZjAzZmVkNWQ2NDJmZWNmN2IxY2JkNzNhYjUzYjI3NGQwOTVjZDI0NzMxZjgxMTY4ZjA1MWFhYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.fJkGycRukNyMr56pAVne-qCtGY_YvcguL_BFem_3Pio)
Damping comparison:
![damping_comparison](https://private-user-images.githubusercontent.com/7856520/316165318-c1788918-58bc-450f-8883-64559f0aec07.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5ODQwNTIsIm5iZiI6MTczODk4Mzc1MiwicGF0aCI6Ii83ODU2NTIwLzMxNjE2NTMxOC1jMTc4ODkxOC01OGJjLTQ1MGYtODg4My02NDU1OWYwYWVjMDcuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMDMwMjMyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MzUyOTQ3NDA0MGYzMzg5OWExYjYzMDRkODA2YjJmYWViYjNhMmU4OWQ4OGZjMTYzOTEyNTg0NjM1OTg5MjU0YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.WbZsBa2_GpIzbxJ4ukIHAx45Nca3uKNru-kjGULiCgE)
🆕 Changelog
ContainerExpressionUtils::ExtractData
to extract data from an expression with a given model part where the model part from expression and the given model part differ.OptimizationUtils::GetComponentWiseModelParts
to extract model parts from parameters on which the boundary conditions are appliedVertexMorphingShapeControl
to use the newFilter::Factory
ShellThicknessControl
to use the newFilter::Factory
Filter::GetBoundaryConditions
to get the boundary conditions used in the filterExplicitFilter
ImplicitFilter