Partial Differential Equation Toolbox |

jigglemesh

Jiggle internal points of triangular mesh

Syntax

-     p1=jigglemesh(p,e,t)
      p1=jigglemesh(p,e,t,'PropertyName',PropertyValue,...)

Description

`p1=jigglemesh(p,e,t)` jiggles the triangular mesh by adjusting the node point positions. The quality of the mesh normally increases.

The following property name/property value pairs are allowed.

Property | Value | Default | Description
``Opt`` | ``off|mean|min`` | `mean` | Optimization method
``Iter`` | numeric | 1 or 20 (see below) | Maximum iterations

Each mesh point that is not located on an edge segment is moved toward the center of mass of the polygon formed by the adjacent triangles. This process is repeated according to the settings of the `Opt` and `Iter` variables:

- When `Opt` is set to `off` this process is repeated `Iter` times (default: 1).
- When `Opt` is set to `mean` the process is repeated until the mean triangle quality does not significantly increase, or until the bound `Iter` is reached (default: 20).
- When `Opt` is set to `min` the process is repeated until the minimum triangle quality does not significantly increase, or until the bound `Iter` is reached (default: 20).

Examples

Create a triangular mesh of the L-shaped membrane, first without jiggling, and then jiggle the mesh.

-     [p,e,t]=initmesh('lshapeg','jiggle','off');
      q=pdetriq(p,t);
      pdeplot(p,e,t,'xydata',q,'colorbar','on','xystyle','flat')
      p1=jigglemesh(p,e,t,'opt','mean','iter',inf);
      q=pdetriq(p1,t);
      pdeplot(p1,e,t,'xydata',q,'colorbar','on','xystyle','flat')

See Also

`initmesh`, `pdetriq`

| initmesh |  | parabolic |