# Created by Octave 3.2.4, Tue Nov 23 12:53:38 2010 EST <mockbuild@jetta.math.Princeton.EDU.private>
# name: cache
# type: cell
# rows: 3
# columns: 17
# name: <cell-element>
# type: string
# elements: 1
# length: 26
MSH2Mdisplacementsmoothing
# name: <cell-element>
# type: string
# elements: 1
# length: 1410
 -- Function File: [AX,AY] = MSH2Mdisplacementsmoothing(MSH,K)
     To displace the boundary of a 2D mesh, set a spring with
     force/length constant K along each edge and enforce equilibrium.

     This function builds matrices containing the resulting
     (linearized) equation for x and y coordinates of each mesh node.
     Boundary conditions enforcing the displacement (Dirichlet type
     problem) or the force (Neumann type) at the boundary must be added
     to make the system solvable, e.g.:

          msh = MSH2Mstructmesh(linspace(0,1,10), linspace(0,1,10), 1,1:4, "left");
          dnodes = MSH2Mnodesonsides(msh,1:4);
          varnodes = setdiff([1:columns(msh.p)],dnodes);
          xd = msh.p(1,dnodes)';
          yd = msh.p(2,dnodes)';
          dx = dy = zeros(columns(msh.p),1);
          dxtot = dytot = -.5*sin(xd.*yd*pi/2);
          Nsteps = 10;
          for ii=1:Nsteps
           dx(dnodes) = dxtot;
           dy(dnodes) = dytot;
           [Ax,Ay] = MSH2Mdisplacementsmoothing(msh,1);
           dx(varnodes) = Ax(varnodes,varnodes) \ ...
               (-Ax(varnodes,dnodes)*dx(dnodes));
           dy(varnodes) = Ay(varnodes,varnodes) \ ...
               (-Ay(varnodes,dnodes)*dy(dnodes));
           msh.p += [ dx'/Nsteps; dy'/Nsteps ] ;
           triplot(msh.t(1:3,:)',msh.p(1,:)',msh.p(2,:)');
           pause(.01)
          endfor

     See also: MSH2Mjigglemesh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
To displace the boundary of a 2D mesh, set a spring with force/length
constant K

# name: <cell-element>
# type: string
# elements: 1
# length: 17
MSH2Mequalizemesh
# name: <cell-element>
# type: string
# elements: 1
# length: 392
 -- Function File: [AX, AY, BX,  BY] = MSH2Mequalizemesh(MSH)
     To equalize the size of  triangle edges, apply a baricentric
     regularization, i.e. move each node to the  center of mass of the
     patch of triangles to which it belongs.

     May be useful when distorting a mesh, type ` demo
     MSH2Mequalizemesh ' to see some examples.

     See also: MSH2Mdisplacementsmoothing



# name: <cell-element>
# type: string
# elements: 1
# length: 79
To equalize the size of  triangle edges, apply a baricentric
regularization, i.

# name: <cell-element>
# type: string
# elements: 1
# length: 13
MSH2Mgeomprop
# name: <cell-element>
# type: string
# elements: 1
# length: 2216
 -- Function File: [VARARGOUT] =
          MSH2Mgeomprop(MESH,[STRING1,STRING2,...])
     Computes geometrical properties of the specified mesh

     Input:
        - MESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - STRING1, STRING2,...: identifier of the property to compute.
          Possible choices are listed below.
             * "bar" (center of mass): return a matrix with size 2
               times number of elements containing the coordinates of
               the center of mass of every trg.

             * "cir" (circumcenter):  return a matrix with size 2 times
               number of elements containing the coordinates of the
               circumcenter of every trg.

             * "emidp" (boundary edges midpoint): return a matrix with
               size 2 times number of b.edges containing the
               coordinates of the midpoint.

             * "slength" (length of the sides): return a matrix with
               size 3 times number of elements containing the length of
               the sides.

             * "cdist" (distance among circumcenters of neighbouring
               elements): return a matrix with size 3 times number of
               elements containing the               distance among
               circumcenters of neighbouring elements. If the
               corresponding side lies on the edge, the distance between
                            circumcenter and border edge is returned in
               the matrix.

             * "wjacdet" :

             * "shg": gradient of the P1 shape functions for BIM method

             * "area" (trg area): return a row vector, with length
               equal to number of elements, containing the area of
               every trg in the mesh.

             * "midedge" (midpoint coordinates of every edge): return a
               matrix with size 2(x and y coordinates) times 3(edge
               number) times n of elements                  containing
               the coordinates of the midpoint of every trg edge.

     The output will contain the geometrical properties requested in
     the input in the same order specified in the function call

     See also: MSH2Mtopprop



# name: <cell-element>
# type: string
# elements: 1
# length: 54
Computes geometrical properties of the specified mesh


# name: <cell-element>
# type: string
# elements: 1
# length: 9
MSH2Mgmsh
# name: <cell-element>
# type: string
# elements: 1
# length: 918
 -- Function File: [MESH] = msh2m_gmsh(GEOMETRY,OPTION,VALUE,...)
     Construct an unstructured triangular 2D mesh making use of the free
     software gmsh. Return a PDE-tool like mesh structure.

     Input:
        - GEOMETRY: basename of the ".geo" file to be meshed.

        - OPTION: string of the option to pass gmsh.

        - VALUE: value of the option to pass gmsh.

     For more information regarding the possible option to pass, refer
     to gmsh manual or gmsh site: http://www.geuz.org/gmsh/

     MESH structure is composed of the following fields:

        - P: 2 X (# nodes) matrix. Contain mesh points coordinates.

        - E: 7 X (# side edges) matrix. Contain mesh side edges
          information.

        - T: 4 X (# triangles) matrix. Contain pointer to P field, as
          well as region number.

     See also: msh2m_structured_mesh, msh2m_join_structured_mesh,
     msh2m_submesh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
Construct an unstructured triangular 2D mesh making use of the free
software gms

# name: <cell-element>
# type: string
# elements: 1
# length: 15
MSH2Mjigglemesh
# name: <cell-element>
# type: string
# elements: 1
# length: 547
 -- Function File: [newmsh] = MSH2Mjigglemesh(MSH, STEPS)
     To equalize the size of  triangle edges, set a spring of rest
     length FACTOR*AREA along each edge of the mesh and solve for
     static equilibrium.

     The non-linear eqautions of the system obtained are soved via a
     non-linear Gass-Seidel method. STEP is the number of steps of the
     method to be applied.

     May be useful when distorting a mesh, type `demo MSH2Mjigglemesh'
     to see some examples.

     See also: MSH2Mdisplacementsmoothing, MSH2Mequalizemesh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
To equalize the size of  triangle edges, set a spring of rest length
FACTOR*AREA

# name: <cell-element>
# type: string
# elements: 1
# length: 16
MSH2Mjoinstructm
# name: <cell-element>
# type: string
# elements: 1
# length: 607
 -- Function File: [MESH] = MSH2Mjoinstructm(MESH1,MESH2,S1,S2)
     Join two structured meshes (created by MSH2Mstructmesh) into one
     mesh structure variable.

     Input:
        - MESH1, MESH2: standard PDEtool-like mesh, with field "p",
          "e", "t".

        - S1, S2: number of the corresponding geometrical border edge
          for respectively mesh1 and mesh2.

     Output:
        - MESH: standard PDEtool-like mesh, with field "p", "e", "t".

     WARNING: on the common edge the two meshes must share the same
     vertexes.

     See also: MSH2Mstructmesh, MSH2Mgmsh, MSH2Msubmesh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
Join two structured meshes (created by MSH2Mstructmesh) into one mesh
structure 

# name: <cell-element>
# type: string
# elements: 1
# length: 20
MSH2Mmeshalongspline
# name: <cell-element>
# type: string
# elements: 1
# length: 618
 -- Function File: [MSH] =
     MSH2Mmeshalongspline(XC, YC, NNX, NNY, SIGMA)

     Generates a structured mesh in a thin layer of size SIGMA sitting
     on a natural Catmull-Rom type cubic spline with control points XC,
     YC.  If NNX and NNY are scalars, the mesh will have NNX nodes in
     the direction along the spline and NNY in the normal direction.
     If NNX and NNY are vectors they will indicate the curvilinear
     coordinates of the mesh nodes.  Be aware that if SIGMA is not much
     smaller than the curvature of the line the resulting mesh may be
     invalid.

     See also: MSH2Mstructmesh



# name: <cell-element>
# type: string
# elements: 1
# length: 46
MSH2Mmeshalongspline(XC, YC, NNX, NNY, SIGMA)


# name: <cell-element>
# type: string
# elements: 1
# length: 17
MSH2Mnodesonsides
# name: <cell-element>
# type: string
# elements: 1
# length: 479
 -- Function File: [NODELIST] = MSH2Mnodesonsides(MESH, SIDELIST)
     Returns a list of the nodes lying on the sides SIDELIST of the
     mesh MESH.

     Input:
        - MESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - SIDELIST: row vector containing the number of the sides
          (numbering referred to mesh.e(5,:)).

     Output:
        - NODELIST: list of the nodes that lies on the specified sides.

     See also: MSH2Mgeomprop, MSH2Mtopprop



# name: <cell-element>
# type: string
# elements: 1
# length: 73
Returns a list of the nodes lying on the sides SIDELIST of the mesh
MESH.

# name: <cell-element>
# type: string
# elements: 1
# length: 15
MSH2Mstructmesh
# name: <cell-element>
# type: string
# elements: 1
# length: 2137
 -- Function File: [MESH] = MSH2Mstructmesh(X,Y,REGION,SIDES,STRING)
     Constructs a structured triangular 2D mesh on a rectangular domain,
     and returns a PDEtool-like mesh structure.

     Input:
        - X: vector representing the 1D meshing of the side parallel to
          x axis.

        - Y: vector representing the 1D meshing of the side parallel to
          y axis.

        - REGION: number assigned to the meshed region.

        - SIDES: row vector containing the four numbers assigned to the
          geometrical edges.

        - STRING: (optional) orientation of the diagonal edge of the
          structured mesh.                      Values: "right",
          "left", "random". Default is "right".

     Output: mesh basic structure, composed of the following fields
        - P: matrix with size 2 times number of mesh point.
             * 1st row: x-coordinates of the points.

             * 2nd row: y-coordinates of the points.

        - E: matrix with size 7 times number of mesh border edges.
             * 1st row: p-matrix column number of the first edge-vertex.

             * 2nd row: p-matrix column number of the second
               edge-vertex.

             * 3rd row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 4th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 5th row: number of the geometrical border upon which the
               referred mesh edge is lying on.

             * 6th row: number of the region to the right of the
               referred mesh edge.

             * 7th row: number of the region to the left of the
               referred mesh edge.

        - T:
             * 1st row: p-matrix column number of the first trg-vertex.

             * 2nd row: p-matrix column number of the second trg-vertex.

             * 3rd row: p-matrix column number of the third trg-vertex.

             * 4th row: number of the region upon which the referred
               trg is lying on.

     See also: MSH2Mgmsh, MSH2Mjoinstructm, MSH2Msubmesh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
Constructs a structured triangular 2D mesh on a rectangular domain, and
returns 

# name: <cell-element>
# type: string
# elements: 1
# length: 12
MSH2Msubmesh
# name: <cell-element>
# type: string
# elements: 1
# length: 975
 -- Function File: [OMESH,NODELIST,ELEMENTLIST] =
          MSH2Msubmesh(IMESH,INTRFC,SDL)
     Gives as output a specified submesh, and the lists of nodes and
     element that are mantained.

     Input:
        - IMESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - INTRFC: row vector containing the number of the internal
          interface sides (numbering referred to mesh.e(5,:)) that
          should be mantained.                      Could be empty.

        - SDL (subdomain list): row vector containing the list of the
          subdomain that are going to be extracted.

     Output:
        - OMESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - NODELIST: list of the node of the original mesh that are
          present in the restricted one.

        - ELEMENTLIST: list of the element of the original mesh that
          are present in the restricted one.

     See also: MSH2Mstructmesh, MSH2Mjoinstructm, MSH2Mgmsh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
Gives as output a specified submesh, and the lists of nodes and element
that are

# name: <cell-element>
# type: string
# elements: 1
# length: 12
MSH2Mtopprop
# name: <cell-element>
# type: string
# elements: 1
# length: 2337
 -- Function File: [VARARGOUT] = MSH2Mtopprop(MESH, [STRING1,
          STRING2,...])
     Computes some topological properties of the mesh MESH.

     Input:
        - MESH: mesh structure with (at least) fields `p', `e' and `t'
          a detailed in the help for `MSH2Mstructmesh'.

        - STRING1, STRING2,...: properties to compute, available
          choices are:

             * "n" (neighbouring triangles): a matrix `M' of size 3 by
               the number of elements. Element `M(i,j)' will be the
               index of  the mesh element sharing with elemnt number
               `j' its `i'-th edge if no such element exists (i.e. for
               boundary  edges) a value of `NaN' is set.

             * "sides" (global edge matrix): a matrix `M' of size 2 by
               total number of edges. Element `M(i,j)' will be the
               index of  the vertex at the `i'-th end of the `j'-th
               edge.

             * "ts" (triangle sides matrix): a matrix `M' of size 3 by
               number of elements. Element `M(i,j)' will be the index
               of the  `i'-th side of the `j'-th mesh element.

             * "tws" (trg with sides matrix):a matrix `M' of size 2 by
               the total number of edges.   `M(:,j)' will the set of
               indeces of the mesh  elements to whose boundary the
               `j'-th mesh edge belongs.   For an edge `j' belonging to
               one triangle onlly (an external  boundary edge)  `M(2,j)
               = NaN'.

             * "coinc" (coincident circumcenter matrix): a matrix `M'
               with 2 rows.   Each column will contain the indices of
               two triangles sharing the  same circumcenter.

             * "boundary" (boundary edge matrix): a matrix `M' of size 2
               times the total number of boundary edges.   `M(1,:)'
               will be the set of mesh elements (possibly repeated)
               with at least one edge belonging to the external
               boundary.   `0 < M(2,j) < 4' will be the (local) index
               of an edge of the  `j'-th mesh element that lies on the
               external boundary.

     The output will contain the geometrical properties requested in
     the input in the same order specified in the function call

     See also: MSHM2geomprop



# name: <cell-element>
# type: string
# elements: 1
# length: 54
Computes some topological properties of the mesh MESH.

# name: <cell-element>
# type: string
# elements: 1
# length: 13
MSH3Mgeomprop
# name: <cell-element>
# type: string
# elements: 1
# length: 736
 -- Function File: [VARARGOUT] =
          MSH3Mgeomprop(MESH,[STRING1,STRING2,...])
     Computes geometrical properties of the specified mesh

     Input:
        - MESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - STRING1, STRING2,...: identifier of the property to compute.
          Possible choices are listed below.
             * "wjacdet" : weighted determinant of jacobian
               trasformation to reference tetrahedron

             * "shg": gradient of the P1 shape functions for BIM method

             * "shp": value of the P1 shape functions for BIM method

     The output will contain the geometrical properties requested in
     the input in the same order specified in the function call


# name: <cell-element>
# type: string
# elements: 1
# length: 54
Computes geometrical properties of the specified mesh


# name: <cell-element>
# type: string
# elements: 1
# length: 9
MSH3Mgmsh
# name: <cell-element>
# type: string
# elements: 1
# length: 2448
 -- Function File: [MESH] = MSH3Mgmsh(GEOMETRY,OPTION,VALUE,...)
     Construct an unstructured 3D mesh making use of the free software
     gmsh. Give as output the PDE-tool like mesh structure.

     Input:
        - GEOMETRY: name of the ".geo" file describing the 2D geometry.
          Required by gmsh to start the meshing operation.

        - OPTION: option to be used by gmsh

        - VALUE: value of the option
     For more information refer to gmsh manual, or gmsh site:

     http://www.geuz.org/gmsh/

     Output: mesh basic structure, composed of the following fields
        - P: matrix with size 3 times number of mesh point.
             * 1st row: x-coordinates of the points.

             * 2nd row: y-coordinates of the points.

             * 3rd row: z-coordinates of the points.

        - E: matrix with size 10 times number of mesh border edges.
             * 1st row: p-matrix column number of the first edge-vertex.

             * 2nd row: p-matrix column number of the second
               edge-vertex.

             * 3rd row: p-matrix column number of the third edge-vertex.

             * 4th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 5th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 6th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 7th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 8th row: number of the region to the right of the
               referred mesh edge.

             * 9th row: number of the region to the left of the
               referred mesh edge.

             * 10th row: number of the geometrical border upon which
               the referred mesh edge is lying on.

        - T:
             * 1st row: p-matrix column number of the first tetrahedra
               vertex.

             * 2nd row: p-matrix column number of the second tetrahedra
               vertex.

             * 3rd row: p-matrix column number of the third tetrahedra
               vertex.

             * 4th row: p-matrix column number of the fourth tetrahedra
               vertex.

             * 5th row: number of the region upon which the referred
               trg is lying on.

     See also: MSH2Mgmsh, MSH2Mjoinstructm, MSH2Msubmesh



# name: <cell-element>
# type: string
# elements: 1
# length: 71
Construct an unstructured 3D mesh making use of the free software gmsh.

# name: <cell-element>
# type: string
# elements: 1
# length: 16
MSH3Mjoinstructm
# name: <cell-element>
# type: string
# elements: 1
# length: 607
 -- Function File: [MESH] = MSH3Mjoinstructm(MESH1,MESH2,S1,S2)
     Join two structured meshes (created by MSH3Mstructmesh) into one
     mesh structure variable.

     Input:
        - MESH1, MESH2: standard PDEtool-like mesh, with field "p",
          "e", "t".

        - S1, S2: number of the corresponding geometrical border edge
          for respectively mesh1 and mesh2.

     Output:
        - MESH: standard PDEtool-like mesh, with field "p", "e", "t".

     WARNING: on the common edge the two meshes must share the same
     vertexes.

     See also: MSH3Mstructmesh, MSH3Mgmsh, MSH3Msubmesh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
Join two structured meshes (created by MSH3Mstructmesh) into one mesh
structure 

# name: <cell-element>
# type: string
# elements: 1
# length: 17
MSH3Mnodesonfaces
# name: <cell-element>
# type: string
# elements: 1
# length: 480
 -- Function File: [NODELIST] = MSH3Mnodesonfaces(MESH, FACELIST)
     Returns a list of the nodes lying on the faces FACELIST of the
     mesh MESH.

     Input:
        - MESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - FACELIST: row vector containing the number of the faces
          (numbering referred to mesh.e(10,:)).

     Output:
        - NODELIST: list of the nodes that lies on the specified faces.

     See also: MSH3Mgeomprop, MSH3Mtopprop



# name: <cell-element>
# type: string
# elements: 1
# length: 73
Returns a list of the nodes lying on the faces FACELIST of the mesh
MESH.

# name: <cell-element>
# type: string
# elements: 1
# length: 15
MSH3Mstructmesh
# name: <cell-element>
# type: string
# elements: 1
# length: 2573
 -- Function File: [MESH] = MSH3Mstructmesh(X,Y,Z,REGION,SIDES)
     Constructs a structured tetrahedral 3D mesh on a parallelepipedal
     domain, and returns a PDEtool-like mesh structure.

     Input:
        - X: vector representing the 1D meshing of the side parallel to
          x axis.

        - Y: vector representing the 1D meshing of the side parallel to
          y axis.

        - Z: vector representing the 1D meshing of the side parallel to
          z axis.

        - REGION: number assigned to the meshed region.

        - SIDES: row vector containing the six numbers assigned to the
          geometrical surface-edges.

     Output: mesh basic structure, composed of the following fields
        - P: matrix with size 3 times number of mesh point.
             * 1st row: x-coordinates of the points.

             * 2nd row: y-coordinates of the points.

             * 3rd row: z-coordinates of the points.

        - E: matrix with size 10 times number of mesh border edges.
             * 1st row: p-matrix column number of the first edge-vertex.

             * 2nd row: p-matrix column number of the second
               edge-vertex.

             * 3rd row: p-matrix column number of the third edge-vertex.

             * 4th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 5th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 6th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 7th row: not initialized, only for compatibility with
               standard PDE-tool like mesh.

             * 8th row: number of the region to the right of the
               referred mesh edge.

             * 9th row: number of the region to the left of the
               referred mesh edge.

             * 10th row: number of the geometrical border upon which
               the referred mesh edge is lying on.

        - T:
             * 1st row: p-matrix column number of the first tetrahedra
               vertex.

             * 2nd row: p-matrix column number of the second tetrahedra
               vertex.

             * 3rd row: p-matrix column number of the third tetrahedra
               vertex.

             * 4th row: p-matrix column number of the fourth tetrahedra
               vertex.

             * 5th row: number of the region upon which the referred
               trg is lying on.

     See also: MSH2Mgmsh, MSH2Mjoinstructm, MSH2Msubmesh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
Constructs a structured tetrahedral 3D mesh on a parallelepipedal
domain, and re

# name: <cell-element>
# type: string
# elements: 1
# length: 12
MSH3Msubmesh
# name: <cell-element>
# type: string
# elements: 1
# length: 955
 -- Function File: [OMESH,NODELIST,ELEMENTLIST] =
          MSH3Msubmesh(IMESH,INTRFC,SDL)
     Gives as output a specified submesh, and the lists of nodes and
     element that are mantained.

     Input:
        - IMESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - INTRFC: row vector containing the number of the internal
          interface sides (numbering referred to mesh.e(10,:)) that
          should be mantained. Could be empty.

        - SDL (subdomain list): row vector containing the list of the
          subdomain that are going to be extracted.

     Output:
        - OMESH: standard PDEtool-like mesh, with field "p", "e", "t".

        - NODELIST: list of the node of the original mesh that are
          present in the restricted one.

        - ELEMENTLIST: list of the element of the original mesh that
          are present in the restricted one.

     See also: MSH3Mstructmesh, MSH3Mjoinstructm, MSH3Mgmsh



# name: <cell-element>
# type: string
# elements: 1
# length: 80
Gives as output a specified submesh, and the lists of nodes and element
that are

