moose icon indicating copy to clipboard operation
moose copied to clipboard

Default clock sequence

Open subhacom opened this issue 2 years ago • 2 comments

In older versions, one needed to set the timestep (dt) for the various clock ticks and assign them to specific function (process/init) in classes/objects selected by wildcard in order to run things in a desired order.

The setDefaultDt and assignDefaultTicks in moose.utility submodule were written by Aditya (Gilra) and others as wrappers over setClock and useClock to facilitate this.

IIRC, there were plans to automate the setup and assignment of these clockticks. However, if I try to simulate the cells from Traub 2005 model now, I get flat lines, which is usually a symptom of incorrect/absent clocktick assignment. The useClock and setClock docs do not seem to have changes. So I am wondering what is the ideal way to setup clockticks now.

Also, the moose.utility submodule has become disfunctional now as it uses the parser module, which has been deprecated.

subhacom avatar Jun 06 '23 04:06 subhacom

Hi, Subha, There is already a reasonable set of default dt assigned to each clock tick in the C++ code. In almost all cases, this will allow simulations to run reasonably without any attention to the setclock and useclock functions. If you can point me to the scripts in the Traub2005 model that are not working, I'll see why they are flatlining. I think the moose.utility submodule can be deprecated. -- Upi

upibhalla avatar Jun 06 '23 08:06 upibhalla

I made some fixes to replace PyQt4 dependency with PyQt5 in the examples: https://github.com/subhacom/moose-examples The issue can be seen by running the moose-examples/traub_2005/py/gui.py

The following function in that file sets up the simulation (line 359 ff):

    def simulateSelected(self):
        cellnames = [str(c.text()) for c in self.cellListWidget.selectedItems()]
        assert(len(cellnames) == 1)        
        name = cellnames[0]
        params = self.createCell(name)
        # hsolve = moose.HSolve('%s/solver' % (params['cell'].path))
        # hsolve.dt = simdt
        # hsolve.target = params['cell'].path
        # setDefaultDt(elecdt=simdt, plotdt2=plotdt)
        # assignDefaultTicks(modelRoot=params['modelRoot'],
        #                           dataRoot=params['dataRoot'],
        #                           solver='hsolve')

...

subhacom avatar Jun 06 '23 09:06 subhacom