zone.state.restore

Syntax

i = zone.state.restore(z)

Restores all zone state information from the currently open FISH file. See the file.open and file.read intrinsics.

Returns:

i - returns 0 upon success; otherwise, returns a FISH file error code

Arguments:

z - a pointer to a zone

Usage Example

The following example illustrates how zone.state.restore can be used.

model new
model large-strain off
;
zone create brick size 5 5 5
zone face skin
zone cmodel assign elastic
zone property density 2000 bulk 1e8 shear 0.3e8
;
model gravity 0 0 -10
;
zone face apply velocity-x 0 range group "west" or "east"
zone face apply velocity-y 0 range group "north" or "south"
zone face apply velocity-z 0 range group "bottom"
;
model solve
;
def saveInfo
    file.open('dataGp.txt','write','fish')
    loop foreach local gPnt gp.list
        gp.state.save(gPnt)
    endloop
    file.close
    
    file.open('dataZp.txt','write','fish')
    loop foreach local zPnt zone.list
        zone.state.save(zPnt)
    endloop
    file.close
end
[saveInfo]
;
zone cmodel assign null
;
def restoreInfo
    file.open('dataGp.txt','read','fish')
    loop foreach local gPnt gp.list
        gp.state.restore(gPnt)
    endloop
    file.close
    
    file.open('dataZp.txt','read','fish')
    loop foreach local zPnt zone.list
        zone.state.restore(zPnt)
    endloop
    file.close
end
[restoreInfo]
;
return