Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
c396867c
Commit
c396867c
authored
Aug 10, 2012
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kdtree
parent
c0dbb2af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
extensions/kdtree_nanoflann_mesh.h
extensions/kdtree_nanoflann_mesh.h
+7
-6
No files found.
extensions/kdtree_nanoflann_mesh.h
View file @
c396867c
...
...
@@ -37,6 +37,7 @@
#include "AMDiS.h"
#include "ElementFunction.h"
#include "GeometryTools.h"
using
namespace
nanoflann
;
using
namespace
AMDiS
;
...
...
@@ -220,22 +221,22 @@ typedef std::vector<DataType> VectorOfDataType;
DimVec
<
double
>
lambda
(
dim
,
NO_INIT
);
if
(
dim
==
1
)
{
double
len
d
th
=
abs
(
elInfo
->
getCoord
(
1
)
-
elInfo
->
getCoord
(
0
));
double
len
g
th
=
abs
(
elInfo
->
getCoord
(
1
)
[
0
]
-
elInfo
->
getCoord
(
0
)
[
0
]
);
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
lambda
[
i
]
=
abs
(
p
-
elInfo
->
getCoord
((
i
+
1
)
%
2
))
/
length
;
lambda
[
i
]
=
abs
(
x
[
0
]
-
elInfo
->
getCoord
((
i
+
1
)
%
2
)
[
0
]
)
/
length
;
}
else
if
(
dim
==
2
)
{
double
area
=
meshconv
::
triangle_area_3d
(
elInfo
->
getCoord
(
0
).
begin
(),
elInfo
->
getCoord
(
1
).
begin
(),
elInfo
->
getCoord
(
2
).
begin
())
elInfo
->
getCoord
(
1
).
begin
(),
elInfo
->
getCoord
(
2
).
begin
())
;
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
lambda
[
i
]
=
meshconv
::
triangle_area_3d
(
p
.
begin
(),
lambda
[
i
]
=
meshconv
::
triangle_area_3d
(
x
.
begin
(),
elInfo
->
getCoord
((
i
+
1
)
%
3
).
begin
(),
elInfo
->
getCoord
((
i
+
2
)
%
3
).
begin
())
/
area
;
}
else
if
(
dim
==
3
)
{
double
volume
=
meshconv
::
volume_tetrahedron
(
elInfo
->
getCoord
(
0
).
begin
(),
elInfo
->
getCoord
(
1
).
begin
(),
elInfo
->
getCoord
(
2
).
begin
(),
elInfo
->
getCoord
(
3
).
begin
())
elInfo
->
getCoord
(
1
).
begin
(),
elInfo
->
getCoord
(
2
).
begin
(),
elInfo
->
getCoord
(
3
).
begin
())
;
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
lambda
[
i
]
=
meshconv
::
volume_tetrahedron
(
p
.
begin
(),
lambda
[
i
]
=
meshconv
::
volume_tetrahedron
(
x
.
begin
(),
elInfo
->
getCoord
((
i
+
1
)
%
3
).
begin
(),
elInfo
->
getCoord
((
i
+
2
)
%
3
).
begin
(),
elInfo
->
getCoord
((
i
+
3
)
%
3
).
begin
())
/
volume
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment