% FUNCTION M = gf_mesh([operation [, args]])
%   General constructor for mesh object. Returns a getfem handle to the
%   newly created mesh object. Note that for recent (> 6.0) versions of
%   matlab, you should replace the calls to 'gf_mesh' with 'gfMesh'
%   (this will instruct Matlab to consider the getfem mesh as a regular
%   matlab object that can be manipulated with get() and set() methods).
% 
%   
%   *  M=gf_mesh('empty', int dim)
%   Create a new empty mesh.
% 
%   *  M=gf_mesh('cartesian', vec X[, vec Y[, vec Z,..]])
%   Build quickly a cartesian mesh.
% 
%   * M=gf_mesh('regular_simplices', vec X[, vec Y[, vec Z,.., ]]['degree', int
%   K]['noised'])
%   Mesh a n-dimensionnal parallelepipeded with simplices.  The optional degree
%   may be used to build meshes with non linear geometric transformations.
% 
%   *  M=gf_mesh('triangles_grid', vec X, vec Y)
%   Build quickly a regular mesh of triangles.   This is a very limited and
%   somehow deprecated functin (See also gf_mesh('ptND'),
%   gf_mesh('regular_simplices') and gf_mesh('cartesian')).
% 
%   *  M=gf_mesh('curved', M0, vec F)
%   Build a curved (n+1)-dimensions mesh from a n-dimensions mesh M0.   The points
%   of the new mesh have one additional coordinate, given by the vector F. This
%   can be used to obtain meshes for shells. M0 may be a meshfem object, in that
%   case its linked mesh will be used.
% 
%   *  M=gf_mesh('prismatic', M0, int NLAY)
%   Extrude a prismatic mesh M from a mesh M0.   In the additional dimension there
%   are NLAY layers of elements built from 0 to 1.
% 
%   *  M=gf_mesh('pt2D', mat P, ivec T[, int N])
%   Build a mesh from a 2D triangulation.  Each column of P contains a point
%   coordinate, and each column of T contains the point indices of a triangle. N
%   is optional and is a zone number. If N is specified then only the zone number
%   'N' is converted (in that case, T is expected to have 4 rows, the fourth
%   containing these zone numbers).
%   
%   Can be used to Convert a "pdetool" triangulation exported in variables P and T
%   into a GETFEM mesh.
% 
% 
%   *  M=gf_mesh('ptND', mat P, imat T)
%   Build a mesh from a N-dimensional "triangulation".  Similar function to
%   'pt2D', for building simplexes meshes from a triangulation given in T, and a
%   list of points given in P. The dimension of the mesh will be the number of
%   rows of P, and the dimension of the simplexes will be the number of rows of T.
% 
%   *  M=gf_mesh('load', string FILENAME)
%   Load a mesh from a GETFEM++ ascii mesh file. See also
%   gf_mesh_get(M,'save',FILENAME).
% 
%   *  M=gf_mesh('from_string', string S)
%   Load a mesh from a string description. For example, a string returned by
%   gf_mesh_get(M,'char').
% 
%   *  M=gf_mesh('import', string FORMAT, string FILENAME)
%   Import a mesh, FORMAT may be:
%   
%    - 'gmsh'   for a mesh created with gmsh ( http://www.geuz.org/gmsh )
%    - 'gid'    for a mesh created with GiD  ( http://gid.cimne.upc.es )
%    - 'am_fmt' for a mesh created with emc2 (
%   http://pauillac.inria.fr/cdrom/www/emc2/fra.htm )
% 
%   *  M=gf_mesh('clone', mesh M2)
%   Create a copy of a mesh.
% 
%  
%   $Id: gf_mesh.cc 2322 2006-03-31 12:21:16Z pommier $
function [varargout]=gf_mesh(varargin)
  if (nargout),
    [varargout{1:nargout}]=gf_matlab('mesh',varargin{:});
  else
    gf_matlab('mesh',varargin{:});
    if (exist('ans','var') == 1), varargout{1}=ans; end;
  end;
