Skip to Main Content
The first task in developing three-dimensional (3d) finite element method (FEM) capability is to generate 3d meshes to describe the geometries. Fortunately, gmsh is well equipped to do this. There are many ways to generate a given geometry in three dimensions; this chapter discusses one such approach. The derivation of the coefficient matrix terms in three dimensions using tetrahedron elements and a four-point function is a direct extension of the derivations of the two-dimensional (2d) matrix terms. The chapter discusses parsing of the gmsh files, and setting of boundary conditions. The gmsh script struct16_4.geo, in the chapter, shows the construction of two cylinders and a surrounding sphere. The capacitance between the two cylinders, in an unbounded region, is approximated by setting the cylinder potentials to +0.5 and -0.5, setting the outer-sphere potential to 0, and increasing the sphere radius until the sphere no longer contributes to the capacitance.