Partial Differential Equation Toolbox |

Data Structures and Utility Functions

The process of defining your problem and solving it is reflected in the design of the GUI. A number of data structures define different aspects of the problem, and the various processing stages produce new data structures out of old ones. See the figure following.

The rectangles are functions, and ellipses are data represented by matrices or M-files. Arrows indicate data necessary for the functions.

As there is a definite direction in this diagram, you can cut into it by presenting the needed data sets, and then continue downward. In the sections below we give pointers to descriptions of the precise formats of the various data structures and M-files.

Constructive Solid Geometry Model

A Constructive Solid Geometry (CSG) model is specified by a Geometry Description matrix, a set formula, and a Name Space matrix. For a description of these data structures, see the reference page for `decsg`. At this level, the problem geometry is defined by overlapping solid objects. These can be created by drawing the CSG model in the GUI and then exporting the data using the Export Geometry Description, Set Formula, Labels. . . option from the Draw menu.

Decomposed Geometry

A decomposed geometry is specified by either a Decomposed Geometry matrix, or by a Geometry M-file. Here, the geometry is described as a set of disjoint minimal regions bounded by boundary segments and border segments. A Decomposed Geometry matrix can be created from a CSG model by using the function `decsg`. It can also be exported from the GUI by selecting the Export Decomposed Geometry, Boundary Cond's. . . option from the Boundary menu. A Geometry M-file equivalent to a given Decomposed Geometry matrix can be created using the `wgeom` function. A decomposed geometry can be visualized with the `pdegplot` function. For descriptions of the data structures of the Decomposed Geometry matrix and Geometry M-file, see the respective reference pages for `decsg` and `pdegeom`.

Boundary Conditions

These are specified by either a Boundary Condition matrix, or a Boundary M-file. Boundary conditions are given as functions on boundary segments. A Boundary Condition matrix can be exported from the GUI by selecting the Export Decomposed Geometry, Boundary Cond's. . . option from the Boundary menu. A Boundary M-file equivalent to a given Boundary Condition matrix can be created using the `wbound` function. For a description of the data structures of the Boundary Condition matrix and Boundary M-file, see the respective reference pages for `assemb` and `pdebound`.

Equation Coefficients

The PDE is specified by either a Coefficient matrix or a Coefficient M-file for each of the PDE coefficients c, a, f, and d. The coefficients are functions on the subdomains. Coefficients can be exported from the GUI by selecting the Export PDE Coefficients. . . option from the PDE menu. For the details on the equation coefficient data structures, see the reference page for `assempde`.

Mesh

A triangular mesh is described by the mesh data which consists of a Point matrix, an Edge matrix, and a Triangle matrix. In the mesh, minimal regions are triangulated into subdomains, and border segments and boundary segments are broken up into edges. Mesh data is created from a decomposed geometry by the function `initmesh` and can be altered by the functions `refinemesh` and `jigglemesh`. The Export Mesh. . . option from the Mesh menu provides another way of creating mesh data. The `adaptmesh` function creates mesh data as part of the solution process. The mesh may be plotted with the `pdemesh` function. For details on the mesh data representation, see the reference page for `initmesh`.

Solution

The solution of a PDE problem is represented by the solution vector. A solution gives the value at each mesh point of each dependent variable, perhaps at several points in time, or connected with different eigenvalues. Solution vectors are produced from the mesh, the boundary conditions, and the equation coefficients by `assempde`, `pdenonlin`, `adaptmesh`, `parabolic`, `hyperbolic`, and `pdeeig`. The Export Solution. . . option from the Solve menu exports solutions to the workspace. Since the meaning of a solution vector is dependent on its corresponding mesh data, they are always used together when a solution is presented. For details on solution vectors, see the reference page for `assempde`.

Post Processing and Presentation

Given a solution/mesh pair, a variety of tools is provided for the visualization and processing of the data. `pdeintrp` and `pdeprtni` can be used to interpolate between functions defined at triangle nodes and functions defined at triangle midpoints. `tri2grid` interpolates a functions from a triangular mesh to a rectangular grid. `pdegrad` and `pdecgrad` compute gradients of the solution. `pdeplot` has a large number of options for plotting the solution. `pdecont` and `pdesurf` are convenient shorthands for `pdeplot`.

| Using Command-Line Functions |  | Hints and Suggestions for Using Command-Line Functions |