Research Article

Finite Element Assembly Using an Embedded Domain Specific Language

Listing 14

The mesh data structure.
(/// Unstructured mesh data
()  struct mesh_data
()  {
()   // Construct using a number of nodes and element properties
()   mesh_data(const int nb_nodes, const int nb_elems, const int nb_nodes_per_elem, const int
     dimension):
()    coordinates(boost::extents[nb_nodes][dimension]),
()    connectivity(boost::extents[nb_elems][nb_nodes_per_elem])
()   {
()   }
()  
() // Global coordinates array
() boost::multi_array<double, 2> coordinates;
() // Global connectivity array
() boost::multi_array<int, 2> connectivity;
() };