Primary Usage (Object-Oriented)¶
The standard way to use this class is by first defining your physical objects and then passing them to the constructor.
from openflash import SteppedBody, ConcentricBodyGroup, BasicRegionGeometry
# 1. Define the physical bodies
body1 = SteppedBody(a=np.array([5.0]), d=np.array([20.0]), heaving=True)
body2 = SteppedBody(a=np.array([10.0]), d=np.array([10.0]), heaving=False)
# 2. Group the bodies into an arrangement
arrangement = ConcentricBodyGroup(bodies=[body1, body2])
# 3. Define other parameters
h = 100.0 # Total water depth
NMK = [30, 30, 30] # Harmonics for inner, middle, and outer domains
# 4. Create the Geometry object
# This object will automatically generate the fluid domains internally.
geometry = BasicRegionGeometry(
body_arrangement=arrangement,
h=h,
NMK=NMK
)