# 3 Model Construction and Mesh Generation

Once we have stated or derived the mathematical equations which define the physics of the system, we must figure out how to solve these equations for the particular domain we are interested in. Most numerical methods for solving partial differential equations break up the continuous domain into discrete elements and approximate the pde using the particular numerical technique (finite element, boundary element, finite difference, or multigrid) best suited to the particular problem.

The first problem we encounter is the discretization of the solution domain into polygons, or the mesh generation. Because of the complex geometries often associated with bioelectric field problems, construction of the polygonal mesh can turn out to be one of the most time consuming aspects of the modeling process. After deciding upon the particular approximation method to use (and the most appropriate type of element), we need to construct a mesh of the solution domain which matches the number of degrees of freedom of our fundamental element. For the sake of simplicity, we will assume that we will use linear elements, triangles for two-dimensional meshes and tetrahedrons for three-dimensional domains. If we chose to use the finite difference approach, we would need to use uniform squares of cubes.