amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
154 stars 98 forks source link

Revise stopping conditions #839

Open rieder opened 2 years ago

rieder commented 2 years ago

The stopping condition library currently has the following stopping conditions:

    PARAMETER (COLLISION_DETECTION=0)
    PARAMETER (PAIR_DETECTION=1)
    PARAMETER (ESCAPER_DETECTION=2)
    PARAMETER (TIMEOUT_DETECTION=3)
    PARAMETER (NUMBER_OF_STEPS_DETECTION=4)
    PARAMETER (OUT_OF_BOX_DETECTION=5)
    PARAMETER (DENSITY_LIMIT_DETECTION=6)
    PARAMETER (INTERNAL_ENERGY_LIMIT_DETECTION=7)
    PARAMETER (INTERACTION_OVER_DETECTION=8)
    PARAMETER (SUPERNOVA_DETECTION=9)

This doesn't match the table in the AMUSE book describing the stopping conditions (B7) - I've indicated the missing ones in bold:

GRAVITATIONAL DYNAMICS

I think we should add the missing stopping conditions... And perhaps there are more stopping conditions we can think of? Maybe a "general" stopping condition would be useful to have as well, something that can be used instead of stopping the community code (i.e. preventing crashes)?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

rieder commented 2 years ago

I think it would be best to have stopping conditions that can pass a message - e.g.:

def stop(
    condition="some condition - like collision, supernova, or simply 'active particle'",
    particles_involved=(particle_index_i, particle_index_j, particle_index_k, ...),
)
rieder commented 2 years ago

Probably the condition should allow passing more information, but this would make the conditions more generic. We can re-define current stopping condition as designated messages, and define what these should pass.