<?xml version="1.0" encoding="UTF-8"?>
<refentry version="5.0-subset Scilab" xml:id="gf_mdbrick_get" 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_mdbrick_get</refname>
    <refpurpose>  Get information from a brick, or launch the solver.
</refpurpose>
  </refnamediv>

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

    <synopsis>n = gf_mdbrick_get(mdbrick MDB, 'nbdof')</synopsis>
    <synopsis>d = gf_mdbrick_get(mdbrick MDB, 'dim')</synopsis>
    <synopsis>n = gf_mdbrick_get(mdbrick MDB, 'nb_constraints')</synopsis>
    <synopsis>b = gf_mdbrick_get(mdbrick MDB, 'is_linear')</synopsis>
    <synopsis>b = gf_mdbrick_get(mdbrick MDB, 'is_symmetric')</synopsis>
    <synopsis>b = gf_mdbrick_get(mdbrick MDB, 'is_coercive')</synopsis>
    <synopsis>b = gf_mdbrick_get(mdbrick MDB, 'is_complex')</synopsis>
    <synopsis>I = gf_mdbrick_get(mdbrick MDB, 'mixed_variables')</synopsis>
    <synopsis>gf_mdbrick_get(mdbrick MDB, 'subclass')</synopsis>
    <synopsis>gf_mdbrick_get(mdbrick MDB, 'param_list')</synopsis>
    <synopsis>gf_mdbrick_get(mdbrick MDB, 'param', string parameter_name)</synopsis>
    <synopsis>gf_mdbrick_get(mdbrick MDB, 'solve',mdstate mds[,...])</synopsis>
    <synopsis>VM = gf_mdbrick_get(mdbrick MDB, 'von mises', mdstate mds, mesh_fem mfvm)</synopsis>
    <synopsis>T = gf_mdbrick_get(mdbrick MDB, 'tresca', mdstate mds, mesh_fem mft)</synopsis>
    <synopsis>z = gf_mdbrick_get(mdbrick MDB, 'memsize')</synopsis>
    <synopsis>s = gf_mdbrick_get(mdbrick MDB, 'char')</synopsis>
    <synopsis>gf_mdbrick_get(mdbrick MDB, 'display')</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Description</title>
    <para>  Get information from a brick, or launch the solver.
</para>
  </refsection>

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

    <itemizedlist>
    <listitem>
    <para><literal>n = gf_mdbrick_get(mdbrick MDB, 'nbdof')</literal></para>

    <para>       Get the total number of dof of the current problem.

    This is the sum of the brick specific dof plus the dof of the
    parent bricks.
    </para>
    </listitem>

    <listitem>
    <para><literal>d = gf_mdbrick_get(mdbrick MDB, 'dim')</literal></para>

    <para>       Get the dimension of the main mesh (2 for a 2D mesh, etc).
    </para>
    </listitem>

    <listitem>
    <para><literal>n = gf_mdbrick_get(mdbrick MDB, 'nb_constraints')</literal></para>

    <para>       Get the total number of dof constraints of the current problem.

    This is the sum of the brick specific dof constraints plus the
    dof constraints of the parent bricks.
    </para>
    </listitem>

    <listitem>
    <para><literal>b = gf_mdbrick_get(mdbrick MDB, 'is_linear')</literal></para>

    <para>       Return true if the problem is linear.
    </para>
    </listitem>

    <listitem>
    <para><literal>b = gf_mdbrick_get(mdbrick MDB, 'is_symmetric')</literal></para>

    <para>       Return true if the problem is symmetric.
    </para>
    </listitem>

    <listitem>
    <para><literal>b = gf_mdbrick_get(mdbrick MDB, 'is_coercive')</literal></para>

    <para>       Return true if the problem is coercive.
    </para>
    </listitem>

    <listitem>
    <para><literal>b = gf_mdbrick_get(mdbrick MDB, 'is_complex')</literal></para>

    <para>       Return true if the problem uses complex numbers.
    </para>
    </listitem>

    <listitem>
    <para><literal>I = gf_mdbrick_get(mdbrick MDB, 'mixed_variables')</literal></para>

    <para>       Identify the indices of mixed variables (typically the pressure,
    etc.) in the tangent matrix.
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_mdbrick_get(mdbrick MDB, 'subclass')</literal></para>

    <para>       Get the typename of the brick.
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_mdbrick_get(mdbrick MDB, 'param_list')</literal></para>

    <para>       Get the list of parameters names.

    Each brick embeds a number of parameters (the Lame coefficients
    for the linearized elasticity brick, the wave number for the
    Helmholtz brick,...), described as a (scalar, or vector, tensor
    etc) field on a mesh_fem. You can read/change the parameter values
    with gf_mdbrick_get(mdbrick MDB, 'param') and gf_mdbrick_set(mdbrick MDB, 'param').
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_mdbrick_get(mdbrick MDB, 'param', string parameter_name)</literal></para>

    <para>       Get the parameter value.

    When the parameter has been assigned a specific mesh_fem, it is returned
    as a large array (the last dimension being the mesh_fem dof). When no
    mesh_fem has been assigned, the parameter is considered to be constant
    over the mesh.
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_mdbrick_get(mdbrick MDB, 'solve',mdstate mds[,...])</literal></para>

    <para>       Run the standard getfem solver.

    Note that you should be able to use your own solver if you want
    (it is possible to obtain the tangent matrix and its right hand
    side with the gf_mdstate_get(mdstate MDS, 'tangent matrix') etc.).

    Various options can be specified:

    - 'noisy' or 'very noisy'
       the solver will display some information showing the progress
       (residual values etc.).
    - 'max_iter', NIT
       set the maximum iterations numbers.
    - 'max_res', RES
       set the target residual value.
    - 'lsolver', SOLVERNAME
       select explicitely the solver used for the linear systems (the
       default value is 'auto', which lets getfem choose itself).
       Possible values are 'superlu', 'mumps' (if supported),
       'cg/ildlt', 'gmres/ilu' and 'gmres/ilut'.
    </para>
    </listitem>

    <listitem>
    <para><literal>VM = gf_mdbrick_get(mdbrick MDB, 'von mises', mdstate mds, mesh_fem mfvm)</literal></para>

    <para>       Compute the Von Mises stress on the mesh_fem <literal>mfvm</literal>.

    Only available on bricks where it has a meaning: linearized
    elasticity, plasticity, nonlinear elasticity. Note that in 2D
    it is not the "real" Von Mises (which should take into account
    the 'plane stress' or 'plane strain' aspect), but a pure 2D Von
    Mises.
    </para>
    </listitem>

    <listitem>
    <para><literal>T = gf_mdbrick_get(mdbrick MDB, 'tresca', mdstate mds, mesh_fem mft)</literal></para>

    <para>       Compute the Tresca stress criterion on the mesh_fem <literal>mft</literal>.

    Only available on bricks where it has a meaning: linearized
    elasticity, plasticity, nonlinear elasticity.
    </para>
    </listitem>

    <listitem>
    <para><literal>z = gf_mdbrick_get(mdbrick MDB, 'memsize')</literal></para>

    <para>       Return the amount of memory (in bytes) used by the model brick.
    </para>
    </listitem>

    <listitem>
    <para><literal>s = gf_mdbrick_get(mdbrick MDB, 'char')</literal></para>

    <para>         Output a (unique) string representation of the mdbrick.

      This can be used to perform comparisons between two
      different mdbrick objects.
      This function is to be completed.
      
    </para>
    </listitem>

    <listitem>
    <para><literal>gf_mdbrick_get(mdbrick MDB, 'display')</literal></para>

    <para>         displays a short summary for a mdbrick.
    </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>
