Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
ab13dac3
Commit
ab13dac3
authored
Jan 11, 2021
by
Praetorius, Simon
Browse files
Test more grids in gradient test
parent
67f217bb
Changes
13
Hide whitespace changes
Inline
Side-by-side
amdis/PeriodicBC.inc.hpp
View file @
ab13dac3
...
...
@@ -20,7 +20,7 @@ init()
{
if
(
!
bool
(
hasConnectedIntersections_
))
{
hasConnectedIntersections_
=
true
;
const
auto
&
gridView
=
basis_
.
gridView
()
.
grid
().
levelGridView
(
0
)
;
const
auto
&
gridView
=
basis_
.
gridView
();
for
(
auto
const
&
element
:
elements
(
gridView
))
{
for
(
const
auto
&
intersection
:
intersections
(
gridView
,
element
))
{
if
(
!
boundarySubset_
(
intersection
))
...
...
amdis/ProblemInstat.cpp
View file @
ab13dac3
...
...
@@ -2,10 +2,12 @@
#include
"ProblemInstat.hpp"
#include
<dune/grid/yaspgrid.hh>
namespace
AMDiS
{
// explicit template instatiation
template
class
ProblemInstat
<
YaspGrid
Basis
<
2
,
1
>
>
;
template
class
ProblemInstat
<
YaspGridBasis
<
2
,
2
>
>
;
template
class
ProblemInstat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>
,
1
>>
;
template
class
ProblemInstat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>,
1
,
1
>>
;
}
// end namespace AMDiS
amdis/ProblemInstat.hpp
View file @
ab13dac3
...
...
@@ -6,6 +6,8 @@
#include
<amdis/ProblemStat.hpp>
#include
<amdis/common/TypeTraits.hpp>
#include
<dune/grid/yaspgrid.hh>
namespace
AMDiS
{
// forward declarations
...
...
@@ -101,8 +103,8 @@ namespace AMDiS
// mark template as explicitly instantiated in cpp file
extern
template
class
ProblemInstat
<
YaspGrid
Basis
<
2
,
1
>
>
;
extern
template
class
ProblemInstat
<
YaspGridBasis
<
2
,
2
>
>
;
extern
template
class
ProblemInstat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>
,
1
>>
;
extern
template
class
ProblemInstat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>,
1
,
1
>>
;
}
// end namespace AMDiS
...
...
amdis/ProblemStat.cpp
View file @
ab13dac3
...
...
@@ -2,10 +2,12 @@
#include
"ProblemStat.hpp"
#include
<dune/grid/yaspgrid.hh>
namespace
AMDiS
{
// explicit template instatiation
template
class
ProblemStat
<
YaspGrid
Basis
<
2
,
1
>
>
;
template
class
ProblemStat
<
YaspGridBasis
<
2
,
2
>
>
;
template
class
ProblemStat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>
,
1
>>
;
template
class
ProblemStat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>,
1
,
1
>>
;
}
// end namespace AMDiS
amdis/ProblemStat.hpp
View file @
ab13dac3
...
...
@@ -591,8 +591,8 @@ namespace AMDiS
// mark templates as explicitly instantiated in cpp file
extern
template
class
ProblemStat
<
YaspGrid
Basis
<
2
,
1
>
>
;
extern
template
class
ProblemStat
<
YaspGridBasis
<
2
,
2
>
>
;
extern
template
class
ProblemStat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>
,
1
>>
;
extern
template
class
ProblemStat
<
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>,
1
,
1
>>
;
}
// end namespace AMDiS
...
...
test/AdaptiveGridTest.cpp
View file @
ab13dac3
#include
<config.h>
#include
<dune/
grid/yaspgrid
.hh>
#include
<dune/
common/filledarray
.hh>
#include
<dune/grid/test/gridcheck.hh>
#include
<amdis/AdaptiveGrid.hpp>
#if HAVE_DUNE_UGGRID
#include
<dune/grid/uggrid.hh>
#else
#include
<dune/grid/yaspgrid.hh>
#endif
#include
"Tests.hpp"
using
namespace
AMDiS
;
// test IdentityGrid for given dimension
template
<
int
dim
>
void
test
Dim
(
)
template
<
class
HostGrid
>
void
test
Grid
(
HostGrid
&
grid
)
{
using
HostGrid
=
Dune
::
YaspGrid
<
dim
>
;
std
::
array
<
int
,
dim
>
n
;
std
::
fill
(
n
.
begin
(),
n
.
end
(),
1
<<
(
5
-
dim
));
Dune
::
FieldVector
<
double
,
dim
>
extension
(
1.0
);
HostGrid
grid
(
extension
,
n
);
grid
.
globalRefine
(
1
);
AdaptiveGrid
<
HostGrid
>
adaptiveGrid
(
grid
);
...
...
@@ -32,8 +31,49 @@ int main(int argc, char** argv)
{
Environment
env
(
argc
,
argv
);
testDim
<
2
>
();
testDim
<
3
>
();
#if HAVE_DUNE_UGGRID
std
::
cout
<<
std
::
endl
<<
"UGGrid<2,Simplex>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
UGGrid
<
2
>
;
auto
hostGridPtr
=
Dune
::
StructuredGridFactory
<
HostGrid
>::
createSimplexGrid
({
0.0
,
0.0
},
{
1.0
,
1.0
},
{
8u
,
8u
});
testGrid
(
*
hostGridPtr
);
}
std
::
cout
<<
std
::
endl
<<
"UGGrid<2,Cube>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
UGGrid
<
2
>
;
auto
hostGridPtr
=
Dune
::
StructuredGridFactory
<
HostGrid
>::
createCubeGrid
({
0.0
,
0.0
},
{
1.0
,
1.0
},
{
8u
,
8u
});
testGrid
(
*
hostGridPtr
);
}
std
::
cout
<<
std
::
endl
<<
"UGGrid<3,Simplex>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
UGGrid
<
3
>
;
auto
hostGridPtr
=
Dune
::
StructuredGridFactory
<
HostGrid
>::
createSimplexGrid
({
0.0
,
0.0
,
0.0
},
{
1.0
,
1.0
,
1.0
},
{
4u
,
4u
,
4u
});
testGrid
(
*
hostGridPtr
);
}
std
::
cout
<<
std
::
endl
<<
"UGGrid<3,Cube>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
UGGrid
<
3
>
;
auto
hostGridPtr
=
Dune
::
StructuredGridFactory
<
HostGrid
>::
createCubeGrid
({
0.0
,
0.0
,
0.0
},
{
1.0
,
1.0
,
1.0
},
{
4u
,
4u
,
4u
});
testGrid
(
*
hostGridPtr
);
}
#else
std
::
cout
<<
"YaspGrid<2>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
YaspGrid
<
2
>
;
HostGrid
hostGrid
({
1.0
,
1.0
},
{
8
,
8
});
testGrid
(
hostGrid
);
}
std
::
cout
<<
"YaspGrid<3>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
YaspGrid
<
3
>
;
HostGrid
hostGrid
({
1.0
,
1.0
,
1.0
},
{
4
,
4
,
4
});
testGrid
(
hostGrid
);
}
#endif
return
report_errors
();
}
test/CMakeLists.txt
View file @
ab13dac3
# set(DUNE_MAX_TEST_CORES 4)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_COMPILE
"
${
CMAKE_COMMAND
}
-E time"
)
# additional compiler option for CMAKE_BUILD_TYPE=RelWithDebInfo only for gcc
set
(
NoVarTrackingAssignments $<$<AND:$<CONFIG:RelWithDebInfo>,$<CXX_COMPILER_ID:GNU>>:-fno-var-tracking-assignments>
)
...
...
test/DataTransferTest2d.cpp
View file @
ab13dac3
...
...
@@ -6,7 +6,7 @@ int main(int argc, char** argv)
{
Environment
env
(
argc
,
argv
);
#if
def
HAVE_DUNE_UGGRID
#if HAVE_DUNE_UGGRID
using
Grid
=
Dune
::
UGGrid
<
2
>
;
#else
using
Grid
=
Dune
::
YaspGrid
<
2
>
;
...
...
test/DataTransferTest3d.cpp
View file @
ab13dac3
...
...
@@ -6,7 +6,7 @@ int main(int argc, char** argv)
{
Environment
env
(
argc
,
argv
);
#if
def
HAVE_DUNE_UGGRID
#if HAVE_DUNE_UGGRID
using
Grid
=
Dune
::
UGGrid
<
3
>
;
#else
using
Grid
=
Dune
::
YaspGrid
<
3
>
;
...
...
test/DiscreteFunctionTest.cpp
View file @
ab13dac3
...
...
@@ -15,7 +15,7 @@
using
namespace
AMDiS
;
using
ElliptParam
=
YaspGridBasis
<
2
,
2
,
2
>
;
using
ElliptParam
=
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>
,
1
,
1
>
;
using
ElliptProblem
=
ProblemStat
<
ElliptParam
>
;
template
<
class
T
,
...
...
test/ExpressionsTest.cpp
View file @
ab13dac3
...
...
@@ -9,10 +9,11 @@
#include
<amdis/ProblemStat.hpp>
#include
<amdis/common/FieldMatVec.hpp>
#include
<dune/grid/yaspgrid.hh>
using
namespace
AMDiS
;
using
ElliptParam
=
YaspGridBasis
<
2
,
2
>
;
using
ElliptParam
=
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>
,
1
>
;
using
ElliptProblem
=
ProblemStat
<
ElliptParam
>
;
int
main
(
int
argc
,
char
**
argv
)
...
...
test/GradientTest.cpp
View file @
ab13dac3
...
...
@@ -11,17 +11,23 @@
#include
<amdis/Integrate.hpp>
#include
<amdis/gridfunctions/DiscreteFunction.hpp>
#if HAVE_DUNE_UGGRID
#include
<dune/grid/uggrid.hh>
#else
#include
<dune/grid/yaspgrid.hh>
#endif
#include
<dune/grid/utility/structuredgridfactory.hh>
#include
"Tests.hpp"
using
namespace
AMDiS
;
template
<
std
::
size_t
p
>
void
test
()
template
<
std
::
size_t
p
,
class
HostGrid
>
void
test
(
HostGrid
&
hostGrid
)
{
using
HostGrid
=
Dune
::
YaspGrid
<
2
>
;
std
::
cout
<<
"[p = "
<<
p
<<
"]"
<<
std
::
endl
;
using
Basis1
=
LagrangeBasis
<
HostGrid
,
p
,
p
>
;
HostGrid
hostGrid
({
1.0
,
1.0
},
{
16
,
16
});
AdaptiveGrid
<
HostGrid
>
grid
(
hostGrid
);
auto
const
&
gridView
=
grid
.
leafGridView
();
...
...
@@ -91,9 +97,42 @@ int main(int argc, char** argv)
{
Environment
env
(
argc
,
argv
);
test
<
1u
>
();
test
<
2u
>
();
test
<
3u
>
();
#if HAVE_DUNE_UGGRID
std
::
cout
<<
std
::
endl
<<
"UGGrid<Simplex>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
UGGrid
<
2
>
;
auto
numElements
=
Dune
::
filledArray
<
2
,
unsigned
int
>
(
16
);
auto
hostGridPtr
=
Dune
::
StructuredGridFactory
<
HostGrid
>::
createSimplexGrid
({
0.0
,
0.0
},
{
1.0
,
1.0
},
numElements
);
test
<
1u
>
(
*
hostGridPtr
);
test
<
2u
>
(
*
hostGridPtr
);
test
<
3u
>
(
*
hostGridPtr
);
test
<
4u
>
(
*
hostGridPtr
);
}
std
::
cout
<<
std
::
endl
<<
"UGGrid<Cube>..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
UGGrid
<
2
>
;
auto
numElements
=
Dune
::
filledArray
<
2
,
unsigned
int
>
(
16
);
auto
hostGridPtr
=
Dune
::
StructuredGridFactory
<
HostGrid
>::
createCubeGrid
({
0.0
,
0.0
},
{
1.0
,
1.0
},
numElements
);
test
<
1u
>
(
*
hostGridPtr
);
test
<
2u
>
(
*
hostGridPtr
);
test
<
3u
>
(
*
hostGridPtr
);
test
<
4u
>
(
*
hostGridPtr
);
}
#else
std
::
cout
<<
"YaspGrid..."
<<
std
::
endl
;
{
using
HostGrid
=
Dune
::
YaspGrid
<
2
>
;
HostGrid
hostGrid
({
1.0
,
1.0
},
{
16
,
16
});
test
<
1u
>
(
hostGrid
);
test
<
2u
>
(
hostGrid
);
test
<
3u
>
(
hostGrid
);
test
<
4u
>
(
hostGrid
);
}
#endif
return
report_errors
();
}
test/IntegrateTest.cpp
View file @
ab13dac3
...
...
@@ -11,9 +11,11 @@
#include
"Tests.hpp"
#include
<dune/grid/yaspgrid.hh>
using
namespace
AMDiS
;
using
ElliptParam
=
YaspGrid
Basis
<
2
,
2
>
;
using
ElliptParam
=
LagrangeBasis
<
Dune
::
YaspGrid
<
2
>
,
1
>
;
using
ElliptProblem
=
ProblemStat
<
ElliptParam
>
;
int
main
(
int
argc
,
char
**
argv
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment