The next step is to provide a function for the functional calculus of Section 5.1, where linearized equations are treated. For this reason the function lin() is introduced as higher order function in the context of the proposed DSEL.
In analogy to (5.1) the term Q is replaced by the functional expression lin(q, i), where the quantity i is the index function (Section 4.1.4), which yields the respective matrix column associated to the solution quantity. All further calculations are performed using the following notation:
quantity_accessor i("i"); quantity_accessor q("i"); Q = lin(q, i) R_FEM = sum<VC>(_v)[sum<CV>(_c)[ Q * K(_v, _c, _1) ]]; vertex v; linearized_equation<> eqn = R_FEM(v);
It can be seen that the function object Q is defined which yields a linearized expression for the solution quantity. Furthermore, the discretized differential operator R_FEM is specified as shown in Section 5.1. The function is evaluated on a vertex v and yields a linearized equation eqn.
This method can be repeated for all vertices and a set of linearized equations is retrieved. Then, each of the linearized expressions is inserted into the system matrix and the equation system is solved. Afterwards the solution is written back to the solution quantity as specified in Section 4.4.3.