Research Article

Finite Element Assembly Using an Embedded Domain Specific Language

Algorithm 1

Element looping algorithm.
Require: Mesh with field data for variables
Require: A compile-time list of shape functions that may be used
Require: An expression
Ensure: Construction of context data of the correct type
for all shape functions do
if matches the geometry shape function then
  set geometry shape function: =
  for all variables do
  for all compatible with do
   if matches the variable shape function then
   set =
   end if
  end for
  end for
  create context data using known and ()
  for all elements do
  execute grammar
  end for
end if
end for