next up previous contents
Next: A Practical Example 1: Up: Communication with Other Elements Previous: Messages from and to   Contents

The 'findsolvefield' command

The 'findsolvefield' command gives access to hsolve's internal data structures. Hsolve only keeps these data structures after it has examined the structure and stored the properties of the model it has to compute. This means that the findsolvefield command can only be used after a valid SETUP and RESET call. The command has the following syntax:

  genesis > findsolvefield <hsolve-element> <computed-element> <computed-field>

The following code shows both approaches at the same time: two messages are setup to a graph, plotting both the membrane potential of the same compartment. If you run this example, the two plots will be completely overlapping. To be able to run this demo, you must have access to the tutorial scripts that come alone with this document.

    genesis > include ht_compartments.g
    genesis > make_compartments
    genesis > setclock 0 0.000010
    genesis > readcell main.p /main -hsolve
    genesis > setmethod main 11
    genesis > setfield main chanmode 4
    genesis > create xform /out [200,50,300,300]
    genesis > create xgraph /out/voltage [0,0,100%,100%]
    genesis > setfield ^ xmax 2 ymin -0.1 ymax 0.05
    genesis > xshow /out
    genesis > addmsg /main/main /out/voltage PLOT Vm *cmp *red
    genesis > call main SETUP
    genesis > addmsg /main /out/voltage \
    genesis >         PLOT {findsolvefield /main /main/main Vm} *fsf *blue
    genesis > reset

As you can notice the hsolve element is created with the -hsolve option of the readcell command. The numerical method is set to 11 (Crank-Nicolson) and the chanmode is set to 4 (hsolve integrates compartments i.e. cable equations, and channels on a staggered time grid). The graphics are created (see the Xodus documentation for details) and messages are created between the fields of interest and the graphical output widgets. As you see, before the SETUP call a regular message from a compartment is created. After the SETUP call, findsolvefield is used to create the same message from the hsolve element.





NOTE: Internally hsolve restores all computed fields in the original element for every element that has a single outgoing messages during the SETUP call. This incurs a small performance penalty. For this reason it is better to use the findsolvefield command whenever possible.





NOTE: The implementation of findsolvefield uses a small name space of elements that is private to hsolve. Since hsolve looks at all elements from the viewpoint of numerical solution, this name space is flattened out. An example of this flattened name space are compartments that are contained within another compartment in the Genesis element name space. From solution viewpoint, all compartments are equally important for the solution matrix so such a hierarchical arrangement must be addressed without any prefix when using findsolvefield.






next up previous contents
Next: A Practical Example 1: Up: Communication with Other Elements Previous: Messages from and to   Contents
2002-11-15