22 #include "library/helmholtz_2d.hpp"
29 void mexFunction(
int nlhs, mxArray *lhs[],
int nrhs, mxArray
const *rhs[])
31 dMatrix surf_nodes(rhs[0]), surf_elem(rhs[1]);
34 dMatrix field_nodes(rhs[2]), field_elem(rhs[3]);
40 auto const &field_sp =
NiHu::dirac(NiHu::constant_view(field_mesh));
44 size_t n = surf_sp.get_num_dofs();
45 size_t m = field_sp.get_num_dofs();
46 cMatrix Ls(n, n, lhs[0]), Lf(m, n, lhs[2]);
47 cMatrix Ms(n, n, lhs[1]), Mf(m, n, lhs[3]);
51 double k = *mxGetPr(rhs[4]);
58 Ls <<
dirac(surf_sp) * L[surf_sp];
59 Ms <<
dirac(surf_sp) * (M[surf_sp] + (-.5*I)[surf_sp]);
60 Lf << field_sp * L[surf_sp];
61 Mf << field_sp * M[surf_sp];