MEDYAN.set_mech_boundary!

Tuple{MEDYAN.Context, MEDYAN.Boundary}

set_mech_boundary!(
    c::MEDYAN.Context,
    boundary::MEDYAN.Boundary
)

Set the mechanical boundary, replacing any existing one.

The mechanical boundary is a set of soft walls that push beads back inside the domain. Build the Boundary with one of the constructors:

Combine boundaries with . Pass Boundary() to remove the boundary.

Example

grid = CubicGrid(SA[4, 4, 4], 250.0)
set_mech_boundary!(c, MEDYAN.boundary_box(grid; stiffness=100.0))

# a sphere of radius 400 nm clipped by the grid box
sphere = MEDYAN.boundary_capsule(; radius=400.0, stiffness=100.0)
set_mech_boundary!(c, sphere  MEDYAN.boundary_box(grid; stiffness=100.0))

See also set_chem_boundary!