Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
amdis
amdis-core
Commits
5e247bf0
Commit
5e247bf0
authored
6 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
added integrate tests
parent
144b36ba
Branches
Branches containing commit
Tags
Tags containing commit
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/amdis/gridfunctions/Integrate.hpp
+1
-1
1 addition, 1 deletion
src/amdis/gridfunctions/Integrate.hpp
test/CMakeLists.txt
+4
-0
4 additions, 0 deletions
test/CMakeLists.txt
test/IntegrateTest.cpp
+48
-0
48 additions, 0 deletions
test/IntegrateTest.cpp
with
53 additions
and
1 deletion
src/amdis/gridfunctions/Integrate.hpp
+
1
−
1
View file @
5e247bf0
...
...
@@ -61,7 +61,7 @@ namespace AMDiS
return
0.0
;
#else
return
Dune
::
Hybrid
::
ifElse
(
bool_
<
expr_has_order
>
,
[
&
](
auto
)
{
return
Impl
::
integrateImpl
(
std
::
forward
<
decltype
(
gridFct
)
>
(
gridFct
)
,
gridView
,
makeQuad
);
},
[
&
](
auto
)
{
return
Impl
::
integrateImpl
(
gridFct
,
gridView
,
makeQuad
);
},
[
](
auto
)
{
return
0.0
;
});
#endif
}
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
4
−
0
View file @
5e247bf0
...
...
@@ -24,6 +24,10 @@ dune_add_test(SOURCES FiniteElementTypeTest.cpp
dune_add_test
(
SOURCES FilesystemTest.cpp
LINK_LIBRARIES amdis
)
dune_add_test
(
SOURCES IntegrateTest.cpp
LINK_LIBRARIES amdis
CMD_ARGS
"
${
CMAKE_SOURCE_DIR
}
/examples/init/ellipt.dat.2d"
)
dune_add_test
(
SOURCES MarkerTest.cpp
LINK_LIBRARIES amdis
CMD_ARGS
"
${
CMAKE_SOURCE_DIR
}
/examples/init/marker.dat.2d"
)
...
...
This diff is collapsed.
Click to expand it.
test/IntegrateTest.cpp
0 → 100644
+
48
−
0
View file @
5e247bf0
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#include
<iostream>
#include
<dune/geometry/type.hh>
#include
<amdis/AMDiS.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/Operators.hpp>
#include
<amdis/common/Literals.hpp>
#include
<amdis/common/FieldMatVec.hpp>
#include
<amdis/gridfunctions/Integrate.hpp>
#include
"Tests.hpp"
using
namespace
AMDiS
;
using
ElliptParam
=
YaspGridBasis
<
2
,
2
>
;
using
ElliptProblem
=
ProblemStat
<
ElliptParam
>
;
int
main
(
int
argc
,
char
**
argv
)
{
AMDiS
::
init
(
argc
,
argv
);
ElliptProblem
prob
(
"ellipt"
);
prob
.
initialize
(
INIT_ALL
);
auto
u
=
prob
.
getSolution
(
0
);
auto
gv
=
u
.
basis
().
gridView
();
u
<<
1.0
;
auto
i1
=
integrate
(
1.0
,
gv
);
auto
i2
=
integrate
(
u
,
gv
);
auto
i3
=
integrate
([](
auto
const
&
x
)
{
return
1.0
;
},
gv
,
0
);
AMDIS_TEST
(
i1
==
1.0
);
AMDIS_TEST
(
i2
==
1.0
);
AMDIS_TEST
(
i3
==
1.0
);
auto
quad
=
Dune
::
QuadratureRules
<
double
,
2
>::
rule
(
Dune
::
GeometryTypes
::
quadrilateral
,
0
);
auto
i4
=
integrate
([](
auto
const
&
x
)
{
return
1.0
;
},
gv
,
quad
);
AMDIS_TEST
(
i4
==
1.0
);
AMDiS
::
finalize
();
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment