Added water boundary for multiline or interpolation - #49
Conversation
| from stem.water_boundaries import WaterBoundary, PhreaticMultiLineBoundary, InterpolateLineBoundary, WaterBoundaryParameters | ||
|
|
||
|
|
||
| class KratosWaterBoundariesIO: |
There was a problem hiding this comment.
cna you add the docstring for this class and init
There was a problem hiding this comment.
missing attributes :)
There was a problem hiding this comment.
Hmm I really don't understand what is missing
|
|
||
| def __water_boundary_dict(self, name: str, type: str, water_boundary: WaterBoundaryParameters) -> Dict[str, Any]: | ||
| """ | ||
| Creates a dictionary containing the water boundary parameters |
There was a problem hiding this comment.
can you add the types in the docstring and style the Return like:
"""
Creates a dictionary containing the material parameters for a UDSM material. The UDSM parameters are moved to
the UMAT_PARAMETERS key, as this can be recognized by Kratos.
Args:
- material (:class:`stem.soil_material.SoilConstitutiveLawABC`): soil constitutive law object containing the material parameters for UDSM
Returns:
- Dict[str, Any]: dictionary containing the material parameters
"""
There was a problem hiding this comment.
same for rest of the functions
There was a problem hiding this comment.
this comment is not resolved yet
There was a problem hiding this comment.
This is also resolved
| def __init__(self, domain: str): | ||
| self.domain = domain | ||
|
|
||
| def __water_boundary_dict(self, name: str, type: str, water_boundary: WaterBoundaryParameters) -> Dict[str, Any]: |
There was a problem hiding this comment.
| def __water_boundary_dict(self, name: str, type: str, water_boundary: WaterBoundaryParameters) -> Dict[str, Any]: | |
| def __create_water_boundary_dict(self, name: str, type: str, water_boundary: WaterBoundaryParameters) -> Dict[str, Any]: |
|
|
||
| """ | ||
| if isinstance(water_boundary, PhreaticMultiLineBoundary): | ||
| parameters: Dict[str, Any] = { |
There was a problem hiding this comment.
can you add a separate private function per boundary? to keep it a bit more overseeable.
e.g.:
if isinstance(water_boundary, PhreaticMultiLineBoundary):
self.__create_phreatic_multi_line_boundary_dict
| Returns: dictionary containing the water boundary parameters | ||
|
|
||
| """ | ||
| return self.__water_boundary_dict(water_boundary.name, |
There was a problem hiding this comment.
| return self.__water_boundary_dict(water_boundary.name, | |
| return self.__create_water_boundary_dict(water_boundary.name, |
| y_coordinates: List[float] = field(default_factory=lambda: [0.0]) | ||
| z_coordinates: List[float] = field(default_factory=lambda: [0.0]) | ||
| specific_weight: float = 9.81 | ||
| water_pressure: float = 0.0 |
There was a problem hiding this comment.
water pressure is not in the docstring
|
|
||
|
|
||
| """ | ||
| surfaces_assigment: List[str] = field(default_factory=lambda: [""]) |
There was a problem hiding this comment.
i think the surface assignment will be managed in the modelparts. In this file I propose to only put the parameters as present in the projectparameters.json
There was a problem hiding this comment.
in the future, we should add some helper functions in model.py, which should handle this. But I would say thats a problem for later
|
|
||
|
|
||
| """ | ||
| x_coordinates: List[float] = field(default_factory=lambda: [0.0]) |
There was a problem hiding this comment.
I think the parameters here should not be given as a default, as I think its important that the user actively thinks about what he/she wants
There was a problem hiding this comment.
except the z_coordinates, that is only required in 3D, so this can be checked in the post_init if z_coordinates are present in 3D cases
There was a problem hiding this comment.
Yes the z coordinates are checked in the post init
There was a problem hiding this comment.
The problem is that there are default values in the parent class. If a default value is defined in the parent class then everything else needs to have default values. This has to do with the ordering of the variables :/ I will make everything undefault but this is also not ideal
|
|
||
| """ | ||
| surfaces_assigment: List[str] = field(default_factory=lambda: [""]) | ||
| is_fixed: bool = True |
There was a problem hiding this comment.
these parameters should not be given a default. As wrong stuff can happen in 3D situations, when the user keeps it on the default values
|
|
||
| """ | ||
|
|
||
| def __init__(self, water_boundary: Union[InterpolateLineBoundary, PhreaticMultiLineBoundary], name: str): |
There was a problem hiding this comment.
| def __init__(self, water_boundary: Union[InterpolateLineBoundary, PhreaticMultiLineBoundary], name: str): | |
| def __init__(self, water_boundary_parameters: Union[InterpolateLineBoundary, PhreaticMultiLineBoundary], name: str): |
Co-authored-by: aronnoordam <51492202+aronnoordam@users.noreply.github.com>
…ons/STEM into define-load-geometry
Adding geometry for load application and fixes in testing for model
…tions/STEM into make_attr_in_geo_dicts
changed geometry lists to dictionaries
# Conflicts: # tests/test_model.py
Sort geom anti clockwise
No description provided.