I'm working on a model with mixed boundary conditions, e.g. a 2D model which is periodic along the x direction, but has closed walls along the y direction.
What I'm doing right now is to use a periodic space and then re-define the behavior at the y boundary in the agent stepping function.
A bit clunky but it's ok.
I was wondering if there's any interest in properly implementing such behavior directly in the library?
"In principle" it doesn't seem too complicated, the main change would be to have normalize_position operate differently on each axis in a loop according to some dims argument.
I'm not yet sure, however, how one could deal with the Space for the dispatch.
Options I thought of:
define new space types e.g. ContinuousSpaceMixedBC, GridSpaceMixedBC etc.. which by default have periodic=true and an extra field dims that defines which dimensions are periodic
add the extra field dims to the already existing space types, taking default value Tuple(1:D) for a D-dimensional space so that if not specified everything would work exactly as it does now
The second option would be more elegant, but the first one would be immediate to add and doesn't require any change to the existing code.
I'm working on a model with mixed boundary conditions, e.g. a 2D model which is periodic along the x direction, but has closed walls along the y direction.
What I'm doing right now is to use a periodic space and then re-define the behavior at the y boundary in the agent stepping function. A bit clunky but it's ok.
I was wondering if there's any interest in properly implementing such behavior directly in the library? "In principle" it doesn't seem too complicated, the main change would be to have
normalize_position
operate differently on each axis in a loop according to somedims
argument. I'm not yet sure, however, how one could deal with theSpace
for the dispatch. Options I thought of:ContinuousSpaceMixedBC
,GridSpaceMixedBC
etc.. which by default haveperiodic=true
and an extra fielddims
that defines which dimensions are periodicdims
to the already existing space types, taking default valueTuple(1:D)
for a D-dimensional space so that if not specified everything would work exactly as it does nowThe second option would be more elegant, but the first one would be immediate to add and doesn't require any change to the existing code.
Let me know if you think this could be useful