Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
413b637
Added water boundary for multiline or interpolation
Jul 5, 2023
d2959fd
Path corrected
Jul 5, 2023
3221d7a
Type is now more restrictive
Jul 5, 2023
de2303e
Type is now even more restrictive
Jul 5, 2023
e39bec7
Typing also passed in the funstion
Jul 5, 2023
6a37653
Types are checked in the if statement
Jul 6, 2023
b294ac2
new variables created
Jul 6, 2023
77d97de
Changed the functions so that it satisfies mypy test
Jul 6, 2023
378c38f
Reformatted code
Jul 6, 2023
c4b2d4f
mypy fix the same value cannot be initialised in the if statement
Jul 6, 2023
2504591
Deleted overload functions and defined the abstract class as type
Jul 6, 2023
e35a1d6
initial wip commit
aronnoordam Jul 6, 2023
6b7ca0a
Merge branch 'main' into create_soil_layer
aronnoordam Jul 7, 2023
b415925
Added phreatic line boundary
Jul 7, 2023
5ce7913
Merge branch 'get_geo_data_from_gmsh' into create_soil_layer
aronnoordam Jul 10, 2023
146cabd
tmp commit
aronnoordam Jul 10, 2023
66b75ce
Merge branch 'main' into create_soil_layer
aronnoordam Jul 10, 2023
c777d92
added tests for adding a single soil layer and multiple soil layers i…
aronnoordam Jul 11, 2023
e29e362
added a todo refering to an issue
aronnoordam Jul 11, 2023
0c8b780
added function and test to create geometry from geo_data
aronnoordam Jul 11, 2023
f1d015f
added function to create geometry from geo_file
aronnoordam Jul 12, 2023
7a11f0f
added test for creating geometry from geo_file
aronnoordam Jul 12, 2023
c9176ad
corrected model tests
aronnoordam Jul 12, 2023
7d8faad
solved mypy issues in geometry.py
aronnoordam Jul 12, 2023
88ae886
solved mypy issues in model.py
aronnoordam Jul 12, 2023
5f7d4f8
added test for synchronising geometry
aronnoordam Jul 12, 2023
eb0035f
cleanup
aronnoordam Jul 12, 2023
4213f54
fixed test
aronnoordam Jul 12, 2023
6029481
corrected docstrings in geometry.py
aronnoordam Jul 12, 2023
6e0a47b
added finalize gmsh to model destructor
aronnoordam Jul 12, 2023
e37a685
typo
aronnoordam Jul 12, 2023
9debbcd
Testing separate private function for mypy
Jul 13, 2023
bd9de50
adjust testing for expected vs actual
DavideMoretti Jul 13, 2023
3aa693a
Testing separate private function for mypy
Jul 13, 2023
f66c240
Update geometry.py
aronnoordam Jul 13, 2023
76215f6
Update model.py
aronnoordam Jul 13, 2023
69471dc
Corrected according to reviewer's commends
Jul 13, 2023
f242e1f
Update model_part.py
aronnoordam Jul 13, 2023
ed709c6
Corrected unit test
Jul 13, 2023
5b42cf6
Corrected unit test
Jul 13, 2023
362b18b
Typo corrected
Jul 13, 2023
2589965
Typo corrected
Jul 13, 2023
7d6a909
Path to file corrected
Jul 13, 2023
d7f3baf
added test_add_all_layers_from_geo_file_2D
aronnoordam Jul 13, 2023
2a09730
Merge remote-tracking branch 'origin/create_soil_layer' into create_s…
aronnoordam Jul 13, 2023
a1aaf7d
Merge pull request #61 from StemVibrations/define-boundary-conditionts-9
morettid Jul 13, 2023
65dca64
added test for synchronizing 3D geometry
aronnoordam Jul 14, 2023
cc021bc
added test for add_soil_layer_by_coordinates for a single 3D geometry
aronnoordam Jul 14, 2023
46a8d6a
added test for adding multiple soil layers in 3D
aronnoordam Jul 18, 2023
d544a77
Merge pull request #62 from StemVibrations/create_soil_layer
aronnoordam Jul 18, 2023
969c1c7
added gmsh vakantie_branch to requirements
aronnoordam Jul 18, 2023
160d28f
changed call to generate_geometry
aronnoordam Jul 18, 2023
0059216
Merge pull request #63 from StemVibrations/connect_gmsh_vakantiebranch
aronnoordam Jul 18, 2023
bd1b8ad
Merge branch 'main' into vakantie_branch
aronnoordam Jul 18, 2023
02fccb9
added gmsh vakantie_branch to requirements
aronnoordam Jul 18, 2023
bc4e7f2
changed call to generate_geometry
aronnoordam Jul 18, 2023
967323d
Merge branch 'vakantie_branch' of https://github.com/StemVibrations/S…
aronnoordam Jul 18, 2023
6c88023
added function to get mesh from group
aronnoordam Jul 20, 2023
fd8c73c
removed obsolete function
aronnoordam Jul 20, 2023
ed25784
added tests for creating mesh per group
aronnoordam Jul 20, 2023
81e7fae
fixed test
aronnoordam Jul 20, 2023
4ba941b
solved mypy issues
aronnoordam Jul 20, 2023
a9a369b
added test which checks mesh of combined body model part and process …
aronnoordam Jul 21, 2023
5061302
Adding geometry for load application and fixes in testing for model
DavideMoretti Jul 21, 2023
68e207b
removed mesh from model and moved mesh settings
aronnoordam Jul 21, 2023
5cfac04
extended mesh settings docstring
aronnoordam Jul 21, 2023
7dfb1f4
extended mesh settings docstring
aronnoordam Jul 21, 2023
02e2df6
added tests for validation
aronnoordam Jul 21, 2023
3f7eda1
extended docstring in mesh
aronnoordam Jul 21, 2023
16285b4
added element order as a property such that it can be validated
aronnoordam Jul 21, 2023
09ed8c8
added element order as a property such that it can be validated
aronnoordam Jul 21, 2023
b9e9b10
Merge pull request #65 from StemVibrations/generate_mesh
aronnoordam Jul 21, 2023
0b1a778
Adjust type settings for model_part and utils
DavideMoretti Jul 21, 2023
abff48c
Merge branch 'vakantie_branch' of https://github.com/StemVibrations/S…
DavideMoretti Jul 21, 2023
1f718ad
small fixes
DavideMoretti Jul 21, 2023
13fbb46
change in attribute name for excavation process
DavideMoretti Jul 21, 2023
69a55ea
added function to add boundary condition by geometry id
aronnoordam Jul 24, 2023
434a846
removed commented code
aronnoordam Jul 24, 2023
20cb836
added function to add gravity load to model
aronnoordam Jul 25, 2023
c79315c
added test for adding gravity load in 1d and 2d
aronnoordam Jul 25, 2023
98619e4
added test for adding gravity load in 2D and 3D
aronnoordam Jul 25, 2023
4847c0c
corrected docstrings
aronnoordam Jul 25, 2023
ef0befa
made add gravity load private as it depends on the stress initialisat…
aronnoordam Jul 25, 2023
a68dd26
added test for setting up stress initialisation
aronnoordam Jul 25, 2023
6680d25
Update stem/model.py
morettid Jul 26, 2023
d9b2f13
Update tests/test_model.py
morettid Jul 26, 2023
4208a73
Update tests/utils.py
morettid Jul 26, 2023
50ca8d4
Update tests/test_model.py
morettid Jul 26, 2023
2ab0081
Update stem/model.py
morettid Jul 26, 2023
9e609ce
solved mypy issues and added test to check if value error is raised
aronnoordam Jul 26, 2023
5e9d9fe
Merge pull request #68 from StemVibrations/add_boundary_condition_to_…
aronnoordam Jul 26, 2023
e34fe6a
Merge branch 'vakantie_branch' into add_gravity
aronnoordam Jul 26, 2023
b432ff8
used npt asser allclose instead of pytest approx
aronnoordam Jul 26, 2023
5bae45e
Merge pull request #69 from StemVibrations/add_gravity
aronnoordam Jul 26, 2023
27a30e6
Update stem/model_part.py
morettid Jul 26, 2023
ce08092
Update stem/utils.py
morettid Jul 26, 2023
7ed085b
Update stem/utils.py
morettid Jul 26, 2023
4e0d78a
Update stem/utils.py
morettid Jul 26, 2023
5c90b46
Update stem/utils.py
morettid Jul 26, 2023
7735db1
Update tests/test_model.py
morettid Jul 26, 2023
7d3bddc
Update tests/test_model.py
morettid Jul 26, 2023
5b745d5
Update stem/utils.py
morettid Jul 26, 2023
ccf1bd3
Update tests/test_model.py
morettid Jul 26, 2023
a1b6017
Update tests/test_model.py
morettid Jul 26, 2023
cad8783
Update tests/test_model.py
morettid Jul 26, 2023
93601fe
Update tests/test_model.py
morettid Jul 26, 2023
8b796da
first adjustment for review
DavideMoretti Jul 26, 2023
6bfbf5b
Merge remote-tracking branch 'origin/define-load-geometry' into defin…
DavideMoretti Jul 26, 2023
4c67140
commit for merge request
DavideMoretti Jul 27, 2023
ec29191
Merge branch 'vakantie_branch' of https://github.com/StemVibrations/S…
DavideMoretti Jul 27, 2023
b5cf60b
small adjustments to testing and utils
DavideMoretti Jul 27, 2023
5910fa1
Update stem/utils.py
morettid Jul 27, 2023
d1bcb19
adjustments to validation of coordinates
DavideMoretti Jul 27, 2023
9450cd0
Merge branch 'define-load-geometry' of https://github.com/StemVibrati…
DavideMoretti Jul 27, 2023
c0eb110
adjustments to validation of coordinates
DavideMoretti Jul 27, 2023
c82fd71
Merge pull request #66 from StemVibrations/define-load-geometry
morettid Jul 27, 2023
3c1a6a4
added function to check if coordinates are clockwise
aronnoordam Jul 28, 2023
fc668a7
Merge branch 'vakantie_branch' into sort_geom_anti_clockwise
aronnoordam Jul 28, 2023
f9d12c0
corrected a test
aronnoordam Jul 28, 2023
b853a1b
changed geometry lists to dictionaries
aronnoordam Jul 28, 2023
5faeaa2
corrected geometry tests
aronnoordam Jul 28, 2023
fb3d28c
Update tests/test_geometry.py
aronnoordam Jul 28, 2023
b845a5a
Update tests/test_geometry.py
aronnoordam Jul 28, 2023
3267d89
corrected geometry asserts
aronnoordam Jul 28, 2023
2dd7e68
Merge branch 'make_attr_in_geo_dicts' of https://github.com/StemVibra…
aronnoordam Jul 28, 2023
0bb2d81
Merge pull request #71 from StemVibrations/make_attr_in_geo_dicts
aronnoordam Jul 28, 2023
f362b8e
Merge branch 'vakantie_branch' into sort_geom_anti_clockwise
aronnoordam Jul 28, 2023
0d2b18d
corrected tests in model
aronnoordam Jul 28, 2023
c65a5da
corrected utils tests
aronnoordam Jul 28, 2023
bbd104f
solved mypy issue
aronnoordam Jul 28, 2023
1f2c6a9
added tests which check if coordinates are clockwise
aronnoordam Jul 28, 2023
434e8be
added comments
aronnoordam Jul 28, 2023
3205797
removed obsolete import
aronnoordam Jul 28, 2023
ad590a7
Merge pull request #73 from StemVibrations/sort_geom_anti_clockwise
aronnoordam Jul 28, 2023
a835731
Merge branch 'main' into water_boundaries
Aug 3, 2023
40a982e
Changed according reviewers commends
Aug 11, 2023
a14722c
Merge remote-tracking branch 'origin/vakantie_branch' into water_boun…
Aug 11, 2023
82c1139
Commit reverted
Aug 11, 2023
b9dbb5f
Deleted sneaky pass typo
Aug 11, 2023
0a1c388
Attributes to Args
Aug 11, 2023
21222ff
Attributes to Args
Aug 11, 2023
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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
numpy==1.24.2
gmsh_utils @ git+https://github.com/StemVibrations/gmsh_utils@main
gmsh_utils @ git+https://github.com/StemVibrations/gmsh_utils@vakantie_branch
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy==1.24.2
gmsh_utils @ git+https://github.com/StemVibrations/gmsh_utils@main
gmsh_utils @ git+https://github.com/StemVibrations/gmsh_utils@vakantie_branch
pytest==7.2.2
pytest-cov==4.0.0
tox==4.4.11
Expand Down
1 change: 0 additions & 1 deletion run_stem/demo_create_gmsh_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
mesh_output_dir = "./"



gmsh_io = GmshIO()

gmsh_io.generate_gmsh_mesh(input_points, extrusion_length, element_size, dims, name_label, mesh_name, mesh_output_dir,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ packages =
include_package_data = True
install_requires =
numpy>=1.24
gmsh_utils @ git+https://github.com/StemVibrations/gmsh_utils@main
gmsh_utils @ git+https://github.com/StemVibrations/gmsh_utils@vakantie_branch
python_requires = >=3.8

[options.extras_require]
Expand Down
3 changes: 2 additions & 1 deletion stem/IO/kratos_additional_processes_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ def __create_excavation_dict(
"python_module": "apply_excavation_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyExcavationProcess",
"Parameters": parameters.__dict__,
"Parameters": {},
}

boundary_dict["Parameters"]["model_part_name"] = f"{self.domain}.{part_name}"
boundary_dict["Parameters"]["variable_name"] = "EXCAVATION"
boundary_dict["Parameters"]["deactivate_soil_part"] = parameters.deactivate_body_model_part

return boundary_dict

Expand Down
1 change: 1 addition & 0 deletions stem/IO/kratos_output_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def __create_json_output_dict(
"gauss_points_output_variables": [
op.name for op in output_parameters.gauss_point_results
],
"time_frequency": output_parameters.time_frequency,
},
}
return output_dict
Expand Down
171 changes: 171 additions & 0 deletions stem/IO/kratos_water_boundaries_io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
from typing import Dict, Any
Comment thread
aronnoordam marked this conversation as resolved.

from stem.water_boundaries import WaterBoundary, PhreaticMultiLineBoundary, InterpolateLineBoundary, \
WaterBoundaryParameters, PhreaticLine


class KratosWaterBoundariesIO:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

cna you add the docstring for this class and init

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

missing attributes :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hmm I really don't understand what is missing

"""
Class to create the water boundary process dictionary for the ProjectParameters.json file in Kratos


"""

def __init__(self, domain: str):
"""
Constructor of KratosWaterBoundariesIO class

Args:
domain: Name of the Kratos domain


"""
self.domain = domain

def __create_phreatic_line_dict(self, name: str, type: str, water_boundary: PhreaticLine) -> Dict[str, Any]:
"""
Creates a dictionary containing the phreatic line parameters


Args:
- name: Name of the boundary

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

types

- type: Type of the boundary
- water_boundary: Phreatic line boundary object

Returns:
- Dict[str, Any]: dictionary containing the phreatic line parameters

"""
boundary_dict_phreatic_line: Dict[str, Any] = {
"python_module": "apply_scalar_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyScalarConstraintTableProcess",
"Parameters": {
"model_part_name": f"{self.domain}.{name}",
"variable_name": "WATER_PRESSURE",
"is_fixed": water_boundary.is_fixed,
"table": [0, 0],
"fluid_pressure_type": type,
"gravity_direction": water_boundary.gravity_direction,
"out_of_plane_direction": water_boundary.out_of_plane_direction,
"specific_weight": water_boundary.specific_weight,
"first_reference_coordinate": water_boundary.first_reference_coordinate,
"second_reference_coordinate": water_boundary.second_reference_coordinate,
"value": water_boundary.value,
}
}
return boundary_dict_phreatic_line

def __create_phreatic_multi_line_dict(self, name: str, type: str, water_boundary: PhreaticMultiLineBoundary) -> \
Dict[str, Any]:
"""
Creates a dictionary containing the phreatic multi line parameters

Args:
- name: Name of the boundary

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

types

- type: Type of the boundary
- water_boundary: Multi line phreatic line boundary object

Returns:
- Dict[str, Any]: dictionary containing the phreatic line parameters

"""
parameters: Dict[str, Any] = {
"model_part_name": f"{self.domain}.{name}",
"variable_name": "WATER_PRESSURE",
"table": [0, 0, 0],
"value": water_boundary.water_pressure,
"is_fixed": water_boundary.is_fixed,
"gravity_direction": water_boundary.gravity_direction,
"out_of_plane_direction": water_boundary.out_of_plane_direction,
"fluid_pressure_type": type,
"specific_weight": water_boundary.specific_weight,
"x_coordinates": water_boundary.x_coordinates,
"y_coordinates": water_boundary.y_coordinates,
"z_coordinates": water_boundary.z_coordinates,
}
boundary_dict_multi_line: Dict[str, Any] = {
"python_module": "apply_scalar_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyScalarConstraintTableProcess",
"Parameters": parameters,
}
return boundary_dict_multi_line

def __create_interpolation_line_dict(self, name: str, type: str, water_boundary: InterpolateLineBoundary) -> Dict[
str, Any]:
"""
Creates a dictionary containing the interpolation line parameters

Args:
- name: Name of the boundary

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

types

- type: Type of the boundary
- water_boundary: Interpolation line boundary object

Returns:
- Dict[str, Any]: dictionary containing the phreatic line parameters

"""

boundary_dict_interpolate: Dict[str, Any] = {
"python_module": "apply_scalar_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyScalarConstraintTableProcess",
"Parameters": {
"model_part_name": f"{self.domain}.{name}",
"variable_name": "WATER_PRESSURE",
"is_fixed": water_boundary.is_fixed,
"table": 0,
"fluid_pressure_type": type,
"gravity_direction": water_boundary.gravity_direction,
"out_of_plane_direction": water_boundary.out_of_plane_direction,
}
}
return boundary_dict_interpolate

def __create_water_boundary_dict(self, name: str, type: str, water_boundary: WaterBoundaryParameters) -> Dict[
str, Any]:
"""
Creates a dictionary containing the water boundary parameters

Args:
- name: name of the water boundary

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

types

- type: type of the water boundary
- water_boundary: water boundary object

Returns:
- Dict[str, Any]: dictionary containing the water boundary parameters

"""
if isinstance(water_boundary, PhreaticMultiLineBoundary):
temp_phreatic_multi_line: PhreaticMultiLineBoundary = water_boundary
boundary_dict_multi_line: Dict[str, Any] = self.__create_phreatic_multi_line_dict(name, type,
temp_phreatic_multi_line)
return boundary_dict_multi_line
elif isinstance(water_boundary, InterpolateLineBoundary):
temp_interpolate_line: InterpolateLineBoundary = water_boundary
boundary_dict_interpolate_line: Dict[str, Any] = self.__create_interpolation_line_dict(name, type,
temp_interpolate_line)
return boundary_dict_interpolate_line
elif isinstance(water_boundary, PhreaticLine):
temp_phreatic_line: PhreaticLine = water_boundary
boundary_dict_phreatic_line: Dict[str, Any] = self.__create_phreatic_line_dict(name, type,
temp_phreatic_line)
return boundary_dict_phreatic_line
else:
raise NotImplementedError("This type of boundary is not implemented")

def create_water_boundary_dict(self, water_boundary: WaterBoundary) -> Dict[str, Any]:
"""
Creates a dictionary containing the water boundary parameters

Args:
- water_boundary: water boundary object

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

type


Returns:
- Dict[str, Any]: dictionary containing the water boundary parameters

"""
return self.__create_water_boundary_dict(water_boundary.name,
water_boundary.water_boundary.type,
water_boundary.water_boundary)
4 changes: 2 additions & 2 deletions stem/additional_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Excavation(AdditionalProcessesParametersABC):
- :class:`AdditionalProcessesParametersABC`

Attributes:
- deactivate_soil_part (bool): Deactivate or not the body model part
- deactivate_body_model_part (bool): Deactivate or not the body model part
"""

deactivate_soil_part: bool
deactivate_body_model_part: bool
Loading