NiHu  2.0
laplace_bem_3d_full.mex.cpp
1 #include "util/mex_matrix.hpp"
3 #include "library/laplace_3d.hpp"
4 
6 
7 void mexFunction(int nlhs, mxArray *lhs[], int nrhs, mxArray const *rhs[])
8 {
9  dMatrix surf_nodes(rhs[0]), surf_elem(rhs[1]), field_nodes(rhs[2]), field_elem(rhs[3]);
10  auto surf_mesh = NiHu::create_mesh(surf_nodes, surf_elem, NiHu::tria_1_tag());
11  auto field_mesh = NiHu::create_mesh(field_nodes, field_elem, NiHu::quad_1_tag());
12 
13  auto const &surf_sp = NiHu::constant_view(surf_mesh);
14  auto const &field_sp = NiHu::constant_view(field_mesh);
15 
16  size_t n = surf_sp.get_num_dofs();
17  size_t m = field_sp.get_num_dofs();
18  dMatrix Ls(n, n, lhs[0]), Ms(n, n, lhs[1]), Mts(n, n, lhs[2]), Ds(n, n, lhs[3]),
19  Gxxs(n, n, lhs[4]),
20  Lf(m, n, lhs[5]), Mf(m, n, lhs[6]), Mtf(m, n, lhs[7]), Df(m, n, lhs[8]);
21 
27 
28  Ls << NiHu::dirac(surf_sp) * L[surf_sp];
29  Ms << NiHu::dirac(surf_sp) * M[surf_sp];
30  Mts << NiHu::dirac(surf_sp) * Mt[surf_sp];
31  Ds << NiHu::dirac(surf_sp) * D[surf_sp];
32  Gxxs << NiHu::dirac(surf_sp) * Gxx[surf_sp];
33 
34  Lf << NiHu::dirac(field_sp) * L[surf_sp];
35  Mf << NiHu::dirac(field_sp) * M[surf_sp];
36  Mtf << NiHu::dirac(field_sp) * Mt[surf_sp];
37  Df << NiHu::dirac(field_sp) * D[surf_sp];
38 }
39 
NiHu::create_integral_operator
integral_operator< Kernel > create_integral_operator(Kernel &&kernel)
factory function of an integral operator
Definition: integral_operator.hpp:421
NiHu::type2tag
Metafunction assigning a tag to a type.
Definition: type2tag.hpp:17
NiHu::create_mesh
mesh< tmp::vector< typename tag2type< Args >::type... > > create_mesh(nodes_t const &nodes, elements_t const &elements, Args...)
factory function to create a mesh from nodes and elements matrices
Definition: mesh.hpp:298
NiHu::constant_view
const function_space_view< Mesh, field_option::constant, Dimension > & constant_view(mesh_base< Mesh > const &msh, Dimension dim=Dimension())
factory function to transform a mesh into a constant function space
Definition: function_space.hpp:304
weighted_residual.hpp
declaration of class NiHu::weighted_residual
mex_matrix.hpp
A Matlab mex matrix interface.
NiHu::mex::real_matrix
Definition: mex_matrix_separate.hpp:133
NiHu::dirac
const dirac_space< FuncSpace > & dirac(function_space_base< FuncSpace > const &space)
factory function to convert a function space into a dirac space
Definition: function_space.hpp:400
NiHu::normal_derivative_kernel
Normal derivative of a distance dependent kernel.
Definition: normal_derivative_kernel.hpp:26