Example: Mesh Refinement

Consider the following mesh of a metallic interconnect:

Since electromigration is dominant near the round via connecting the two metal lines, the simulation of these effects aims at a high resolution in this area. One possibility is to use uniform mesh refinement, which is in ViennaGrid accomplished in a single line:

ViennaGrid code for uniform mesh refinement
cell_refine_uniformly(mesh_in, mesh_out);

Since a finer mesh is only required near the cylindrical via, it is more economical to refine the mesh only in that region. For this purpose, the edges or cells to be refined have to be tagged using ViennaData first. Then, the refinement process can be triggered:

Code for the local refinement of a mesh
typedef std::vector<bool>    MaskContainer;
MaskContainer cell_refinement_mask(edges.size());
typename result_of::field<MaskContainer,
                           CellType>::type cell_refinement_functor(cell_refinement_mask);
// tag a cell 'c' for refinement as follows:
cell_refinement_functor(c) = true;
// Repeat for all edges cells to be refined
// Start refinement process (CellType is the type of cells in the mesh):
MeshT mesh_refined;
viennagrid::cell_refine(mesh_in, mesh_refined, cell_refinement_functor);

Local refinement in a strip along the via leads to the following locally refined mesh: