Skip to content
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 Control Allow not removing materials #12460

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def __init__(self, parameters: 'list[Kratos.Parameters]') -> None:
"young_modulus": 1.0
}""")

self.__list_of_densities: 'list[float]' = [0.0]
self.__list_of_young_modulus: 'list[float]' = [0.0]
self.__phi: 'list[float]' = [0.0]
self.__list_of_densities: 'list[float]' = []
self.__list_of_young_modulus: 'list[float]' = []
self.__phi: 'list[float]' = []

data: 'list[tuple[float, float]]' = []
for params in parameters:
Expand All @@ -42,7 +42,7 @@ def __init__(self, parameters: 'list[Kratos.Parameters]') -> None:
raise RuntimeError("Young modulus and densities are not in the ascending order.")

for i, (density, young_modulus) in enumerate(data):
self.__phi.append(i+1)
self.__phi.append(i)
self.__list_of_densities.append(density)
self.__list_of_young_modulus.append(young_modulus)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def setUpClass(cls):
"simp_power_fac": 3,
"output_all_fields": true,
"list_of_materials": [
{
"density": 0.0,
"young_modulus": 0.0
},
{
"density": 7850.0,
"young_modulus": 206900000000.0
Expand Down Expand Up @@ -134,6 +138,10 @@ def test_AdaptiveBeta(self):
parameters = Kratos.Parameters("""{
"controlled_model_part_names": ["shell"],
"list_of_materials": [
{
"density": 0.0,
"young_modulus": 0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test please without zeros

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

altry :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done :)

},
{
"density": 7850.0,
"young_modulus": 206900000000.0
Expand Down
Loading