Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-curvedgrid
Commits
c131e6d1
Commit
c131e6d1
authored
May 07, 2020
by
Praetorius, Simon
Browse files
tests extended to some polynomial orders
parent
8d20c4e7
Pipeline
#3855
failed with stage
in 6 minutes and 27 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dune/curvedsurfacegrid/gridfunctions/discretegridviewfunction.hh
View file @
c131e6d1
...
...
@@ -212,7 +212,7 @@ private:
DerivativeRange
<
1
>
J
(
0
);
for
(
std
::
size_t
i
=
0
;
i
<
localCoords_
.
size
();
++
i
)
for
(
in
t
j
=
0
;
j
<
J
.
N
();
++
j
)
for
(
std
::
size_
t
j
=
0
;
j
<
J
.
N
();
++
j
)
J
[
j
].
axpy
(
localCoords_
[
i
][
j
],
gradients_
[
i
]);
return
J
;
...
...
dune/curvedsurfacegrid/test/CMakeLists.txt
View file @
c131e6d1
foreach
(
geometry RANGE 1 3
)
dune_add_test
(
NAME convergence-
${
geometry
}
SOURCES convergence.cc
COMPILE_DEFINITIONS
GEOMETRY_TYPE=
${
geometry
}
DUNE_GRID_PATH=\"
${
PROJECT_SOURCE_DIR
}
/doc/grids/\"
CMAKE_GUARD
dune-foamgrid_FOUND
dune-localfunctions_FOUND
)
foreach
(
order RANGE 1 3
)
dune_add_test
(
NAME convergence-g
${
geometry
}
-p
${
order
}
SOURCES convergence.cc
COMPILE_DEFINITIONS
GEOMETRY_TYPE=
${
geometry
}
GEOMETRY_ORDER=
${
order
}
DUNE_GRID_PATH=\"
${
PROJECT_SOURCE_DIR
}
/doc/grids/\"
CMAKE_GUARD
dune-foamgrid_FOUND
dune-localfunctions_FOUND
)
endforeach
(
order
)
endforeach
(
geometry
)
dune_add_test
(
SOURCES discretegridviewfunction.cc
...
...
dune/curvedsurfacegrid/test/convergence.cc
View file @
c131e6d1
...
...
@@ -42,9 +42,14 @@
#error "Unknown GEOMETRY_TYPE. Must bei either 1, 2, or 3"
#endif
const
int
order
=
3
;
// polynomial order of geometry
#ifndef GEOMETRY_ORDER
#define GEOMETRY_ORDER 3
#endif
const
int
order
=
GEOMETRY_ORDER
;
const
int
quad_order
=
order
+
6
;
const
int
num_levels
=
4
;
const
int
num_levels
=
5
;
// Test Hausdorf-distance
template
<
class
Grid
>
...
...
@@ -256,21 +261,20 @@ int main (int argc, char** argv)
};
auto
print_break
=
[]
{
std
::
cout
.
width
(
8
+
8
*
16
);
std
::
cout
.
width
(
8
+
9
*
16
);
std
::
cout
.
fill
(
'-'
);
std
::
cout
<<
'-'
<<
std
::
endl
;
std
::
cout
.
fill
(
' '
);
};
std
::
cout
.
setf
(
std
::
ios
::
scientific
);
print_line
(
"level"
,
std
::
vector
<
std
::
string
>
{
"err_inf"
,
"eoc_inf"
,
"err_L2"
,
"eoc_L2"
,
"err_norm"
,
"eoc_norm"
,
"err_curv"
,
"eoc_curv"
},
[](
auto
&&
)
{
return
true
;
});
print_line
(
"level"
,
std
::
vector
<
std
::
string
>
{
"h "
,
"err_inf"
,
"eoc_inf"
,
"err_L2"
,
"eoc_L2"
,
"err_norm"
,
"eoc_norm"
,
"err_curv"
,
"eoc_curv"
},
[](
auto
&&
)
{
return
true
;
});
print_break
();
for
(
int
i
=
0
;
i
<
num_levels
;
++
i
)
print_line
(
i
,
std
::
vector
<
typename
Grid
::
ctype
>
{
inf_errors
[
i
],
eocInf
[
i
],
L2_errors
[
i
],
eocL2
[
i
],
normal_errors
[
i
],
eocNormal
[
i
],
curvature_errors
[
i
],
eocCurvature
[
i
]},
[](
auto
const
&
v
)
{
return
v
!=
0.0
;
});
print_break
();
print_line
(
i
,
std
::
vector
<
typename
Grid
::
ctype
>
{
edge_lengths
[
i
],
inf_errors
[
i
],
eocInf
[
i
],
L2_errors
[
i
],
eocL2
[
i
],
normal_errors
[
i
],
eocNormal
[
i
],
curvature_errors
[
i
],
eocCurvature
[
i
]},
[](
auto
&&
)
{
return
true
;
});
return
test
.
exit
();
}
dune/curvedsurfacegrid/test/discretegridviewfunction.cc
View file @
c131e6d1
...
...
@@ -177,7 +177,6 @@ int main (int argc, char** argv)
using
HostGrid
=
FoamGrid
<
2
,
3
,
ctype
>
;
std
::
unique_ptr
<
HostGrid
>
hostGrid
=
GmshReader
<
HostGrid
>::
read
(
DUNE_GRID_PATH
"sphere.msh"
);
using
Signature
=
FieldVector
<
ctype
,
3
>
(
FieldVector
<
ctype
,
3
>
);
auto
sphere
=
[](
const
auto
&
x
)
{
return
x
/
x
.
two_norm
();
};
auto
sphereGridFct
=
discreteGridViewFunction
<
3
,
-
1
,
ctype
>
(
hostGrid
->
leafGridView
(),
order
);
...
...
Write
Preview
Supports
Markdown
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