First we give a short guideline how to setup hsolve:
We indicate points of interest with a marker of the form '// point <n>' such that we can refer to it later on. Here is the complete script:
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 > // point 1
genesis > call main SETUP
genesis > create xform /cell [200,350,300,300]
genesis > create xdraw /cell/draw [0,0,100%,100%]
genesis > setfield /cell/draw xmin -0.00005 xmax 0.00005 \
genesis > ymin -1e-5 ymax 4e-5 \
genesis > zmin -1e-5 zmax 1e-5
genesis > create xcell /cell/draw/xcell
genesis > setfield /cell/draw/xcell colmin -0.1 colmax 0.05 \
genesis > path /main/##[TYPE=compartment]
genesis > str element
genesis > foreach element ( { el /main/##[TYPE=compartment] } )
genesis > addmsg /main /cell/draw/xcell \
genesis > COLOR {findsolvefield /main {element} Vm}
genesis > end
genesis > setfield /cell/draw/xcell \
genesis > nfield {countelementlist /main/##[TYPE=compartment]}
genesis > xshow /cell
genesis > reset
genesis > // point 2
| NOTE: The xcell element assumes that you have it setup the right messages with the path field of the element. If you setup the messages manually as we do here, you must set the nfield field with the number of messages going to the xcell element, otherwise it will not display anything. The nfield field of xcell is not documented. |