gf_workspace
Purpose
Synopsis
gf_workspace('push') gf_workspace('pop' [,hobj i, hobj j,..]) gf_workspace('stat') gf_workspace('stats') gf_workspace('keep', hobj i[,hobj j, hobj k..]) gf_workspace('clear') gf_workspace('clear all') gf_workspace('class name', hobj i)
Description
gf_workspace('push') : create a new temporary workspace on the workspace stack.
gf_workspace('pop' [,i,j,..]) : leave the current workspace, destroying all getfem variables belonging to it, except the one listed after 'pop', and the ones which were moved to the parent workspace by gf_workspace('keep').
gf_workspace('stat') : print informations about variables in current workspace.
gf_workspace('stats') : print informations about all getfem variables.
gf_workspace('keep', i[,j,k..]) : prevent the listed variables i from being deleted when the command gf_workspace('pop') will be called. This is accomplished by moving this variable in the parent workspace.
gf_workspace('clear') : clear the current workspace.
gf_workspace('clear all') : clear every workspace, and return to the main workspace.
gf_workspace('class name', i) : return the class name of object i (if I is a mesh handle, it returns 'gfMesh' etc..).
Examples
function [a]=foo(x,y,z) gf_workspace('push'); try ... % some work here ... a = gf_mesh_fem(m); % create a getfem$++$ object b = gf_mesh(x); gf_workspace('keep', a); % b will be automatically destroyed at the 'pop' ... % other work... catch gf_workspace('pop'); % cleanup before error error(lasterr); end; gf_workspace('pop');
