-
Notifications
You must be signed in to change notification settings - Fork 244
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
Geo/check number of tables phreatic multi line #12689
base: master
Are you sure you want to change the base?
Conversation
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.
Nice catch and well tested and scoped fix! I have some questions left, mainly about the 'constant' version of the multiline process and the defaults.
"x_coordinates": [0.0, 1.0], | ||
"y_coordinates": [1.0, 0.5], |
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.
It seems quite random that the defaults have non-zero values here, but that might be a larger discussion
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.
The points are chosen such that over a small domain they form a possible phreatic surface. ( if the gravity direction is in the xy plane )
@@ -129,14 +129,15 @@ KRATOS_TEST_CASE_IN_SUITE(ApplyConstantPhreaticMultiLinePressureProcessDoesNotTh | |||
"y_coordinates": [0.0, 1.0], | |||
"z_coordinates": [0.0, 0.0], | |||
"gravity_direction": 1, | |||
"out_of_plane_direction": 2 | |||
"out_of_plane_direction": 2, | |||
"table": [0, 0] |
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.
I would expect the 'constant' process doesn't need a table here
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.
Indeed, reverted the wrong addition.
"specific_weight" : 10000.0, | ||
"pressure_tension_cut_off" : 0.0, | ||
"table" : [0,1] | ||
"table" : [0, 0] |
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.
Would it be possible to have this default only in the table version of this process?
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.
Lets look at that together.
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.
Tried together, but without succes. The constructor of the "constant" process fails when it has no table in its defaults.
KRATOS_TEST_CASE_IN_SUITE(ApplyPhreaticMultiLinePressureTableProcessThrowsWhenTableLengthDoesNotMatchCoordinates, | ||
KratosGeoMechanicsFastSuiteWithoutKernel) | ||
{ | ||
auto model = Model{}; | ||
auto& r_model_part = model.CreateModelPart("foo"); | ||
auto test_parameters = Parameters{R"( | ||
{ | ||
"model_part_name": "foo", | ||
"variable_name": "WATER_PRESSURE", | ||
"x_coordinates": [0.0, 1.0], | ||
"y_coordinates": [0.0, 1.0], | ||
"z_coordinates": [0.0, 0.0], | ||
"gravity_direction": 1, | ||
"out_of_plane_direction": 2, | ||
"table": [1, 2, 3, 4] | ||
} )"}; | ||
|
||
KRATOS_EXPECT_EXCEPTION_IS_THROWN( | ||
(ApplyPhreaticMultiLinePressureTableProcess{r_model_part, test_parameters}), | ||
"Got 2 coordinates and 4 table references. The number of coordinates and table references should be equal.") | ||
} |
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.
Let's also add a test which doesn't throw here
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.
Added a test that does not throw
} )"}; | ||
|
||
KRATOS_EXPECT_TRUE(CanCreateInstanceOfApplyConstantPhreaticMultiLinePressureProcessWithoutFailure( | ||
r_model_part, test_parameters)) | ||
|
||
test_parameters.RemoveValue("x_coordinates"); | ||
test_parameters.AddVector("x_coordinates", ScalarVector{5, 1.0}); | ||
test_parameters.AddVector("x_coordinates", ScalarVector{2, 1.0}); |
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.
Does this mean that if we create a 'constant' multiline process, with e.g. 2 tables in the parameters, we cannot have 5 x_coordinates (while the tables aren't used)? Please correct me if I'm wrong
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.
There should be as many entries in the table list as there are points. However a entry in the table list may be 0 to indicate a constant value.
📝 Description
To make sure that the number of tables matches the number of points of the multlinear phreatic line input a check has been added.
🆕 Changelog