Evaluators

28 views
Skip to first unread message

Andrew Cook

unread,
Feb 25, 2026, 2:06:14 PMFeb 25
to Dedalus Users
Hi all,
I was wondering if it was possible to modify the interval which the evaluators collect data in dedalus3. For example, what I want to do is collect very sparse data before a certain simulation time to conserve storage as I am more interested in the long time dynamics of the system I am studying. I could make 2 files which I run in succession and do this, but I was wondering if it was possible to do this within just one file through like a command that runs a certain simulation time has passed.
-Andrew

Daniel Lecoanet

unread,
Feb 25, 2026, 4:18:38 PMFeb 25
to Dedalus Users
Hi,

You can call evaluator.evaluate_scheduled() whenever you want, passing in a list of the filehandlers you want evaluated, as well as the keywords for filehandlers (I believe this is iteration, wall_time, sim_time, and timestep). E.g.,


Hope that helps,
Daniel

--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/4994791f-d706-45db-926a-a0373b69a05fn%40googlegroups.com.

Calum Skene

unread,
Feb 26, 2026, 5:02:53 AMFeb 26
to Dedalus Users
Hi Andrew,
Just to add to Daniel's reply. You can also specify a custom_schedule when adding a file handler. This may help.
Best,
Calum

custom_schedule : function, optional
        Custom scheduling function returning a boolean for triggering output (default: None).
        Signature for IVPs: custom_schedule(iteration, wall_time, sim_time, timestep)
        Signature for BVPs: custom_schedule(iteration)

Andrew Cook

unread,
Feb 26, 2026, 11:06:33 AMFeb 26
to Dedalus Users
Hi Calum,
just to make sure I understand, when I start to create my evaluators. I would create custom schedule as you described custom_schedule(iteration, wall_time, sim_time, timestep)? are iteration, wall_time, sim_time, and timestep all integer inputs, though you don't have to specify all of them right? Then I just pass the custom schedule into the add_file_evaluators command when I am creating my evaluator for the problem I am solving. I think daniel's method should work prefectly fine for what I want to do, but this method seems a bit cleaner so if it can do what I want to do I want to use it.
-Andrew

Calum Skene

unread,
Feb 26, 2026, 3:13:52 PMFeb 26
to Dedalus Users
Hi Andrew,
I haven't tried, but I think you do something like this

def custom_schedule(iteration, wall_time, sim_time, timestep):
    # Write a function here that returns true based on arguments iteration (int), wall_time (double), sim_time (double)
    # and timestep (double) if you want to trigger an output, and false otherwise

and then 
handler = solver.evaluator.add_file_handler('handler_name', custom_schedule=custom_schedule)

If you start with Daniel's suggestion you will probably see how to define custom_schedule to integrate it into the evaluator framework.
Hope it helps,
Calum
Reply all
Reply to author
Forward
0 new messages