<?xml version="1.0" encoding="UTF-8"?>
<refentry version="5.0-subset Scilab" xml:id="gf_workspace" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:html="http://www.w3.org/1999/xhtml"
          xmlns:db="http://docbook.org/ns/docbook">
  <refnamediv>
    <refname>gf_workspace</refname>
    <refpurpose>    Getfem workspace management function. 

    Getfem uses its own workspaces in Matlab, independently of the
    matlab workspaces (this is due to some limitations in the memory
    management of matlab objects). By default, all getfem variables
    belong to the root getfem workspace. A function can create its own
    workspace by invoking gf_workspace('push') at its beginning. When
    exiting, this function MUST invoke gf_workspace('pop') (you can
    use matlab exceptions handling to do this cleanly when the
    function exits on an error).

 </refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>

    <synopsis>gf_workspace('push')</synopsis>
    <synopsis>gf_workspace('pop',  [,i,j, ...])</synopsis>
    <synopsis>gf_workspace('stat')</synopsis>
    <synopsis>gf_workspace('stats')</synopsis>
    <synopsis>gf_workspace('keep', i[,j,k...])</synopsis>
    <synopsis>gf_workspace('keep all')</synopsis>
    <synopsis>gf_workspace('clear')</synopsis>
    <synopsis>gf_workspace('clear all')</synopsis>
    <synopsis>gf_workspace('class name', i)</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Description</title>
    <para>    Getfem workspace management function. 

    Getfem uses its own workspaces in Matlab, independently of the
    matlab workspaces (this is due to some limitations in the memory
    management of matlab objects). By default, all getfem variables
    belong to the root getfem workspace. A function can create its own
    workspace by invoking gf_workspace('push') at its beginning. When
    exiting, this function MUST invoke gf_workspace('pop') (you can
    use matlab exceptions handling to do this cleanly when the
    function exits on an error).

 </para>
  </refsection>

  <refsection>
    <title>Command list</title>

    <itemizedlist>
    <listitem>
    <para><literal>gf_workspace('push')</literal></para>

    <para>         Create a new temporary workspace on the workspace stack. 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('pop',  [,i,j, ...])</literal></para>

    <para>         Leave the current workspace, destroying all getfem objects
      belonging to it, except the one listed after 'pop', and the ones
      moved to parent workspace by gf_workspace('keep'). 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('stat')</literal></para>

    <para>          Print informations about variables in current workspace. 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('stats')</literal></para>

    <para>          Print informations about all getfem variables. 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('keep', i[,j,k...])</literal></para>

    <para>         prevent the listed variables from being deleted when
      gf_workspace("pop") will be called by moving these variables in the
      parent workspace. 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('keep all')</literal></para>

    <para>         prevent all variables from being deleted when
      gf_workspace("pop") will be called by moving the variables in the
      parent workspace. 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('clear')</literal></para>

    <para>         Clear the current workspace. 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('clear all')</literal></para>

    <para>         Clear every workspace, and returns to the main workspace (you
      should not need this command). 
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_workspace('class name', i)</literal></para>

    <para>         Return the class name of object i (if I is a mesh handle, it 
      return gfMesh etc..) 
    </para>
    </listitem>

    </itemizedlist>
  </refsection>

  <refsection>
    <title>See Also</title>
    <simplelist type="inline">
      <member><link linkend="getfem_types">getfem types</link></member>
    </simplelist>
  </refsection>

  <refsection>
    <title>Authors</title>
    <para>Y. Collette</para>
  </refsection>

</refentry>
