Loading [MathJax]/extensions/tex2jax.js
NiHu
2.0
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Typedefs
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
c
d
f
i
m
n
p
q
r
s
t
v
x
Typedefs
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
v
w
x
y
Enumerator
d
i
j
k
l
m
n
o
p
q
r
s
t
Files
File List
File Members
All
Functions
Macros
▼
NiHu
►
NiHu 2.0
►
Introduction
►
Installation
►
Theory
►
Applications
►
Tutorials
►
NiHu component library reference
►
Programming techniques
►
Benchmark problems
►
NiHu Publications
Todo List
►
Modules
►
Namespaces
►
Classes
▼
Files
►
File List
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
helmholtz_bem_3d_bm.mex.cpp
1
#include <mex.h>
2
3
#include "
core/weighted_residual.hpp
"
4
#include "
util/mex_matrix.hpp
"
5
#include "library/helmholtz_3d.hpp"
6
7
typedef
NiHu::mex::real_matrix<double>
dMatrix
;
8
typedef
NiHu::mex::complex_matrix<double>
cMatrix;
9
10
void
mexFunction(
int
nlhs, mxArray *lhs[],
int
nrhs, mxArray
const
*rhs[])
11
{
12
dMatrix
surf_nodes(rhs[0]), surf_elem(rhs[1]);
13
auto
surf_mesh =
NiHu::create_mesh
(surf_nodes, surf_elem,
NiHu::tria_1_tag
(),
NiHu::quad_1_tag
());
14
15
auto
const
&surf_sp =
NiHu::constant_view
(surf_mesh);
16
17
size_t
n = surf_sp.get_num_dofs();
18
cMatrix L_surf(n, n, lhs[0]), M_surf(n, n, lhs[1]),
19
Mt_surf(n, n, lhs[2]), N_surf(n, n, lhs[3]);
20
21
double
k = *mxGetPr(rhs[2]);
22
auto
L =
NiHu::create_integral_operator
(
NiHu::helmholtz_3d_SLP_kernel<double>
(k));;
23
auto
M =
NiHu::create_integral_operator
(
NiHu::helmholtz_3d_DLP_kernel<double>
(k));
24
auto
Mt =
NiHu::create_integral_operator
(
NiHu::helmholtz_3d_DLPt_kernel<double>
(k));
25
auto
N =
NiHu::create_integral_operator
(
NiHu::helmholtz_3d_HSP_kernel<double>
(k));
26
27
L_surf <<
dirac
(surf_sp) * L[surf_sp];
28
M_surf <<
dirac
(surf_sp) * M[surf_sp];
29
Mt_surf <<
dirac
(surf_sp) * Mt[surf_sp];
30
N_surf <<
dirac
(surf_sp) * N[surf_sp];
31
}
32
NiHu::create_integral_operator
integral_operator< Kernel > create_integral_operator(Kernel &&kernel)
factory function of an integral operator
Definition:
integral_operator.hpp:421
NiHu::mex::complex_matrix
Container class of a complex matrix stored in Matlab format.
Definition:
mex_matrix_separate.hpp:256
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::type2tag
Metafunction assigning a tag to a type.
Definition:
type2tag.hpp:17
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::normal_derivative_kernel
Normal derivative of a distance dependent kernel.
Definition:
normal_derivative_kernel.hpp:26
NiHu::dirac
const dirac_field< Field > & dirac(field_base< Field > const &f)
dirac field view factory
Definition:
field.hpp:629
src
tutorial
helmholtz_bem_3d_bm.mex.cpp
Generated on Thu Mar 20 2025 01:00:16 for NiHu by
1.8.18