How to write the chech_time of the condtion in Group

25 views
Skip to first unread message

Binghui Cui

unread,
Mar 20, 2023, 7:40:08 AM3/20/23
to pysph-users
Dear developers,   
      I  want to run a specific set of equations only every 20 iterations.  I know a Group takes a keyword argument called condition. But I don't know where the check_time is written. Who can give me an example. 

Thanks in advance!

Best,

Cui Binghui

Prabhu Ramachandran

unread,
Mar 22, 2023, 5:05:52 AM3/22/23
to Binghui Cui, pysph-users
Hi,

There is an example here:

https://pysph.readthedocs.io/en/latest/design/equations.html#conditional-execution-of-groups

For an executable version see the test here:

https://github.com/pypr/pysph/blob/master/pysph/sph/tests/test_acceleration_eval.py#L586

The callable can also be a method, so you may define a method on your Application and pass that long to your Group.

cheers,
Prabhu
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/6eadf28b-bbba-4a08-a846-01c6ce5c4acan%40googlegroups.com.

Binghui Cui

unread,
Mar 22, 2023, 8:23:52 AM3/22/23
to pysph-users
Hi Prabhu,

Thanks for your reply, I've made it

Regards,
Cui Binghui
Reply all
Reply to author
Forward
0 new messages