# Bilinear and linear forms  a = dot(grad(v), grad(u))*dx + k*djump(v)*djump(u)*dc  L = v*f*dx
### Surface representation  
Surfaces across which finite element functions are discontinuous are represented by the Surface class. The interface to Surface is designed such that other parts of the library and the generated code are unaffected by the method with which a surface is represented internally. We presently work with simple representations of surfaces, with the initial discontinuity surface represented by a mathematical function. This is not the most general approach as surfaces cannot \"double back\", but it does permit a wide range of quite elaborate initial discontinuity paths to be considered. In two dimensions, a discontinuity surface (a line) is represented by a user-defined function and the start and end points. In three dimensions, the surface is represented using two level set functions, \(\phi\) and \(\psi\), where for a point on the surface \(\phi=0\) and \(\psi<0\). In both two and three dimensions, the functions used to describe the surface make use of the Function abstraction in DOLFIN. The interface to the class Surface is designed such that it is dimension-independent. Once a Surface has been created, it can perform a range of geometric tasks, such as determining on which side of the surface a given point lies, finding the intersection point of a straight line and the surface, determining whether a cell is intersected by the surface and computing the ratio between the volumes of an intersected cell on either side of the surface. The design can be extended as extra functionally is required. Multiple surfaces can be stored in standard STL containers, which is useful when dealing with multiple discontinuities. When a crack grows, the surface object which represents the crack surface simply needs to be updated. The Surface interface is not exposed in the generated code, which enforces the desirable separation between the generated code and the surface representation. Rather, only the GenericPUM interface, which is described below, is exposed in the generated code. Details of the surface representation can be changed without disruption to other parts of the code. A user can define their own surface representation without needing to modify the form compiler. Interface to the generated code and local extension of the finite element basis management  
The local extension of the finite element basis is controlled by an object derived from the abstract base class GenericPUM. Its task is to manage aspects related to the partition of unity approach. The base class GenericPUM provides an interface for interacting with the generate code. Key tasks of a GenericPUM-based object include the evaluation of the Heaviside function at arbitrary points, computing quadrature schemes for intersected elements based on an input reference scheme which is provided by the generated code and managing which nodes have enriched functions attached. Each discontinuous field in a problem has an associated GenericPUM object. For example, for a three-dimensional elasticity problem, there will be a GenericPUM object associated with each of the three fields If GenericPUM objects are the same for each field, then they can be shared. Partition of unity related data which is required by the generated code is accessed exclusively through the GenricPUM public interface. For modelling discontinuities, we define an object PUM, which is a subclass of GenericPUM and is initialised with the discontinuity surfaces, a mesh and the standard degree of freedom map (a map for the standard degrees of freedom),* std::vector<constSurface*>surfaces; PUMpum(surfaces,mesh, standard_dof_map);  
When a discontinuity surface evolves, the PUM object simply needs to be updated to reflect the change. An important feature of GenericPUM-based objects is that the public interface is designed such that it only involves arguments and return variables that are standard C++ types or part of the UFC specification. This is important as it allows a PUM object to act as the \"glue\" between the generated code and different finite element libraries.