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
dbb50889
Commit
dbb50889
authored
Aug 07, 2012
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signed dist functors and some other things
parent
880c8d64
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
35 deletions
+21
-35
extensions/SignedDistFunctors.h
extensions/SignedDistFunctors.h
+1
-0
extensions/VtuReader.h
extensions/VtuReader.h
+1
-28
extensions/kdtree_nanoflann_mesh.h
extensions/kdtree_nanoflann_mesh.h
+19
-7
No files found.
extensions/SignedDistFunctors.h
View file @
dbb50889
...
...
@@ -5,6 +5,7 @@
#include "VectorOperations.h"
#include "GeometryTools.h"
#include "Views.h"
using
namespace
std
;
using
namespace
AMDiS
;
...
...
extensions/VtuReader.h
View file @
dbb50889
...
...
@@ -29,6 +29,7 @@
#include "boost/filesystem.hpp"
#include "pugixml.hpp"
#include "kdtree_nanoflann.h"
#include "VectorOperations.h"
namespace
AMDiS
{
...
...
@@ -51,34 +52,6 @@ namespace AMDiS {
namespace
details
{
// num_rows for scalar types
template
<
typename
T
>
size_t
num_rows
(
T
&
v
)
{
return
1
;
};
// for WorldVectors print 3 components
template
<
typename
T
>
size_t
num_rows
(
WorldVector
<
T
>
&
v
)
{
return
static_cast
<
size_t
>
(
v
.
getSize
());
}
// num_rows for vector types
template
<
typename
T
>
size_t
num_rows
(
std
::
vector
<
T
>
&
v
)
{
return
v
.
size
();
};
template
<
typename
T
>
size_t
num_rows
(
const
std
::
vector
<
T
>
&
v
)
{
return
v
.
size
();
};
template
<
typename
T
>
size_t
num_rows
(
mtl
::
dense_vector
<
T
>
&
v
)
{
return
mtl
::
num_rows
(
v
);
};
template
<
typename
T
>
size_t
num_rows
(
const
mtl
::
dense_vector
<
T
>
&
v
)
{
return
mtl
::
num_rows
(
v
);
};
template
<
typename
T
>
struct
LessPairEps
{
...
...
extensions/kdtree_nanoflann_mesh.h
View file @
dbb50889
...
...
@@ -219,13 +219,25 @@ typedef std::vector<DataType> VectorOfDataType;
int
dim
=
vec
.
getFeSpace
()
->
getMesh
()
->
getDim
();
DimVec
<
double
>
lambda
(
dim
,
NO_INIT
);
double
area
=
meshconv
::
triangle_area_3d
(
elInfo
->
getCoord
(
0
).
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
(),
elInfo
->
getCoord
((
i
+
1
)
%
3
).
begin
(),
elInfo
->
getCoord
((
i
+
2
)
%
3
).
begin
())
/
area
;
if
(
dim
==
1
)
{
double
lendth
=
abs
(
elInfo
->
getCoord
(
1
)
-
elInfo
->
getCoord
(
0
));
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
lambda
[
i
]
=
abs
(
p
-
elInfo
->
getCoord
((
i
+
1
)
%
2
))
/
length
;
}
else
if
(
dim
==
2
)
{
double
area
=
meshconv
::
triangle_area_3d
(
elInfo
->
getCoord
(
0
).
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
(),
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
())
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
lambda
[
i
]
=
meshconv
::
volume_tetrahedron
(
p
.
begin
(),
elInfo
->
getCoord
((
i
+
1
)
%
3
).
begin
(),
elInfo
->
getCoord
((
i
+
2
)
%
3
).
begin
(),
elInfo
->
getCoord
((
i
+
3
)
%
3
).
begin
())
/
volume
;
}
ElementFunctionDOFVec
<
T
>
elFct
(
&
vec
);
elFct
.
setElInfo
(
elInfo
);
...
...
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