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
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
laplace_bem_3d_hyper.mex.cpp
1
// This file is a part of NiHu, a C++ BEM template library.
2
//
3
// Copyright (C) 2012-2014 Peter Fiala <fiala@hit.bme.hu>
4
// Copyright (C) 2012-2014 Peter Rucz <rucz@hit.bme.hu>
5
//
6
// This program is free software: you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation, either version 3 of the License, or
9
// (at your option) any later version.
10
//
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
15
//
16
// You should have received a copy of the GNU General Public License
17
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
20
#include "
util/mex_matrix.hpp
"
21
#include "
core/weighted_residual.hpp
"
22
#include "library/laplace_3d.hpp"
23
24
typedef
NiHu::mex::real_matrix<double>
dMatrix
;
26
27
void
mexFunction(
int
nlhs, mxArray *lhs[],
int
nrhs, mxArray
const
*rhs[])
28
{
30
dMatrix
surf_nodes(rhs[0]), surf_elem(rhs[1]);
31
auto
surf_mesh =
NiHu::create_mesh
(surf_nodes, surf_elem,
NiHu::tria_1_tag
(),
NiHu::quad_1_tag
());
33
35
auto
const
&surf_sp =
NiHu::constant_view
(surf_mesh);
37
39
size_t
n = surf_sp.get_num_dofs();
40
dMatrix
41
L_surf(n, n, lhs[0]), M_surf(n, n, lhs[1]),
42
Mt_surf(n, n, lhs[2]), N_surf(n, n, lhs[3]);
44
46
auto
I =
NiHu::identity_integral_operator
();
47
auto
L =
NiHu::create_integral_operator
(
NiHu::laplace_3d_SLP_kernel
());
48
auto
M =
NiHu::create_integral_operator
(
NiHu::laplace_3d_DLP_kernel
());
49
auto
Mt =
NiHu::create_integral_operator
(
NiHu::laplace_3d_DLPt_kernel
());
50
auto
N =
NiHu::create_integral_operator
(
NiHu::laplace_3d_HSP_kernel
());
52
54
// conventional equations
55
L_surf <<
dirac
(surf_sp) * L[surf_sp];
56
M_surf <<
dirac
(surf_sp) * M[surf_sp] +
dirac
(surf_sp) * (-.5*I)[surf_sp];
57
// hypersingular equations
58
Mt_surf <<
dirac
(surf_sp) * Mt[surf_sp] +
dirac
(surf_sp) * (.5*I)[surf_sp];
59
N_surf <<
dirac
(surf_sp) * N[surf_sp];
61
}
62
NiHu::create_integral_operator
integral_operator< Kernel > create_integral_operator(Kernel &&kernel)
factory function of an integral operator
Definition:
integral_operator.hpp:421
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::identity_integral_operator
The identity integral operator .
Definition:
integral_operator.hpp:310
NiHu::dirac
const dirac_field< Field > & dirac(field_base< Field > const &f)
dirac field view factory
Definition:
field.hpp:629
src
tutorial
laplace_bem_3d_hyper.mex.cpp
Generated on Fri Mar 21 2025 01:00:16 for NiHu by
1.8.18