Skip to content

Commit

Permalink
added recursive velocity setting to objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jgd10 committed Feb 14, 2022
1 parent 95e7268 commit 650a49e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion PySALESetup/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,24 @@ def material_colors(self) -> Dict[int, str]:
self.set_material_colormap('viridis')
return self._material_colors

def set_velocity(self, x: float, y: float) -> None:
def set_velocity(self, x: float, y: float,
include_children: bool = True) -> None:
"""Set the velocity of the object.
Parameters
----------
x : float
y : float
include_children : bool
Set velocity of all children as well? defaults to True.
Returns
-------
None
"""
self._velocity = Velocity(x=x, y=y)
for child in self.children:
child.set_velocity(x, y)

def set_as_void(self) -> None:
"""Set the material to void.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PySALESetup

PySALESetup is a preprocessing tool designed for use with [iSALE2D](www.iSALE-code.de).
PySALESetup is a preprocessing tool designed for use with [iSALE2D](https://www.iSALE-code.de).
It is a python module that allows for the setup of complex geometries in 2D simulations.
This is of particular use in granular mesoscale numerical simulations and example
scripts are also included. read the documentation [here](https://jgd10.github.io/PySALESetup/).
Expand Down
Empty file added examples/regolith_example.py
Empty file.

0 comments on commit 650a49e

Please sign in to comment.