1 function res = add_integral_kernels(kernels, varargin)
2 %
function res = add_integral_kernels(kernels, varargin)
3 % Addition of integral kernel evaluations
5 % Integral kernels are evaluated at the same arguments and the
6 % results are added up. If the results are cell arrays, they are
7 % concatenated. This
function is used in
Fem.
Assembly.operator().
10 % kernels: cell array containing
function handles corresponding to
11 %
Fem integral kernels.
12 % varargin: inputs
for the integral kernels as variable-length
13 % input argument list.
16 % res: result of addition or cell concatenation.
18 res_tmp = cell(1, length(kernels));
20 for q = 1:length(kernels)
22 res_tmp{q} = kernels{q}(varargin{:});
26 for q = 1:length(res_tmp)
27 res_tmp{q} = res_tmp{q}(:)
';
34 for q = 2:length(res_tmp)
35 res = res + res_tmp{q};