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
amdis
amdis-core
Commits
41cb8a31
Commit
41cb8a31
authored
Mar 20, 2019
by
Praetorius, Simon
Browse files
parametrize BasisCreator with Grid instead of GridView
parent
879cea41
Changes
12
Hide whitespace changes
Inline
Side-by-side
examples/cahn_hilliard.cc
View file @
41cb8a31
...
...
@@ -9,7 +9,7 @@
using
namespace
AMDiS
;
using
Grid
=
Dune
::
AlbertaGrid
<
GRIDDIM
,
WORLDDIM
>
;
using
Param
=
LagrangeBasis
<
typename
Grid
::
LeafGridView
,
1
,
1
>
;
using
Param
=
LagrangeBasis
<
Grid
,
1
,
1
>
;
int
main
(
int
argc
,
char
**
argv
)
{
...
...
examples/navier_stokes.cc
View file @
41cb8a31
...
...
@@ -8,7 +8,7 @@
using
namespace
AMDiS
;
using
Grid
=
Dune
::
YaspGrid
<
2
>
;
using
Basis
=
TaylorHoodBasis
<
Grid
::
LeafGridView
>
;
using
Basis
=
TaylorHoodBasis
<
Grid
>
;
int
main
(
int
argc
,
char
**
argv
)
{
...
...
examples/neumann.cc
View file @
41cb8a31
...
...
@@ -25,7 +25,7 @@ void run(Grid& grid)
{
grid
.
globalRefine
(
Grid
::
dimension
==
2
?
4
:
2
);
using
Traits
=
LagrangeBasis
<
typename
Grid
::
LeafGridView
,
2
>
;
using
Traits
=
LagrangeBasis
<
Grid
,
2
>
;
ProblemStat
<
Traits
>
prob
(
"ellipt"
,
grid
);
prob
.
initialize
(
INIT_ALL
);
prob
.
boundaryManager
().
setBoxBoundary
({
1
,
2
,
2
,
1
});
...
...
examples/periodic.cc
View file @
41cb8a31
...
...
@@ -54,7 +54,7 @@ void print(Grid const& grid)
template
<
class
Grid
>
void
run
(
Grid
&
grid
)
{
using
Traits
=
LagrangeBasis
<
typename
Grid
::
LeafGridView
,
1
>
;
using
Traits
=
LagrangeBasis
<
Grid
,
1
>
;
ProblemStat
<
Traits
>
prob
(
"ellipt"
,
grid
);
prob
.
initialize
(
INIT_ALL
);
...
...
examples/stokes0.cc
View file @
41cb8a31
...
...
@@ -5,7 +5,7 @@
using
namespace
AMDiS
;
using
Grid
=
Dune
::
YaspGrid
<
2
>
;
using
StokesParam
=
TaylorHoodBasis
<
Grid
::
LeafGridView
>
;
using
StokesParam
=
TaylorHoodBasis
<
Grid
>
;
using
StokesProblem
=
ProblemStat
<
StokesParam
>
;
int
main
(
int
argc
,
char
**
argv
)
...
...
examples/stokes1.cc
View file @
41cb8a31
...
...
@@ -5,7 +5,7 @@
using
namespace
AMDiS
;
using
Grid
=
Dune
::
YaspGrid
<
2
>
;
using
StokesParam
=
TaylorHoodBasis
<
Grid
::
LeafGridView
>
;
using
StokesParam
=
TaylorHoodBasis
<
Grid
>
;
using
StokesProblem
=
ProblemStat
<
StokesParam
>
;
int
main
(
int
argc
,
char
**
argv
)
...
...
examples/stokes3.cc
View file @
41cb8a31
...
...
@@ -6,7 +6,7 @@
using
namespace
AMDiS
;
using
Grid
=
Dune
::
YaspGrid
<
2
>
;
using
StokesParam
=
TaylorHoodBasis
<
Grid
::
LeafGridView
>
;
using
StokesParam
=
TaylorHoodBasis
<
Grid
>
;
using
StokesProblem
=
ProblemStat
<
StokesParam
>
;
int
main
(
int
argc
,
char
**
argv
)
...
...
examples/vecellipt.cc
View file @
41cb8a31
...
...
@@ -10,8 +10,6 @@
using
namespace
AMDiS
;
// 1 component with polynomial degree 1
//using Grid = Dune::AlbertaGrid<GRIDDIM, WORLDDIM>;
using
ElliptParam
=
YaspGridBasis
<
GRIDDIM
,
2
,
2
>
;
using
ElliptProblem
=
ProblemStat
<
ElliptParam
>
;
...
...
src/amdis/ProblemStatTraits.hpp
View file @
41cb8a31
...
...
@@ -64,9 +64,10 @@ namespace AMDiS
};
template
<
class
Grid
View
,
class
PreBasisCreator
>
template
<
class
Grid
,
class
PreBasisCreator
>
struct
DefaultBasisCreator
{
using
GridView
=
typename
Grid
::
LeafGridView
;
static
auto
create
(
GridView
const
&
gridView
)
{
using
namespace
Dune
::
Functions
::
BasisFactory
;
...
...
@@ -78,23 +79,23 @@ namespace AMDiS
/// \brief ProblemStatTraits for a (composite) basis composed of
/// lagrange bases of different degree.
template
<
class
Grid
View
,
int
...
degrees
>
template
<
class
Grid
,
int
...
degrees
>
struct
LagrangeBasis
:
public
DefaultBasisCreator
<
Grid
View
,
Impl
::
LagrangePreBasisCreator
<
degrees
...
>>
:
public
DefaultBasisCreator
<
Grid
,
Impl
::
LagrangePreBasisCreator
<
degrees
...
>>
{};
/// \brief Specialization of \ref LagrangeBasis for Grid type
/// \ref Dune::YaspGrid for a given dimension.
template
<
int
dim
,
int
...
degrees
>
struct
YaspGridBasis
:
public
LagrangeBasis
<
typename
Dune
::
YaspGrid
<
dim
>
::
LeafGridView
,
degrees
...
>
:
public
LagrangeBasis
<
Dune
::
YaspGrid
<
dim
>
,
degrees
...
>
{};
/// \brief ProblemStatTraits of Taylor-Hood basis of lagrange-type
/// with pressure degree k
template
<
class
Grid
View
,
int
k
=
1
>
template
<
class
Grid
,
int
k
=
1
>
struct
TaylorHoodBasis
:
public
DefaultBasisCreator
<
Grid
View
,
Impl
::
TaylorHoodPreBasisCreator
<
Grid
View
::
dimensionworld
,
k
>>
:
public
DefaultBasisCreator
<
Grid
,
Impl
::
TaylorHoodPreBasisCreator
<
Grid
::
dimensionworld
,
k
>>
{};
}
// end namespace AMDiS
test/DataTransferTest.hpp
View file @
41cb8a31
...
...
@@ -159,8 +159,8 @@ bool refine_test(Fcts<BasisCreator> const& funcs, bool simplex = true)
}
template
<
class
Grid
>
using
Lagrange3
=
LagrangeBasis
<
typename
Grid
::
LeafGridView
,
3
>
;
using
Lagrange3
=
LagrangeBasis
<
Grid
,
3
>
;
template
<
class
Grid
>
using
TaylorHood
=
TaylorHoodBasis
<
typename
Grid
::
LeafGridView
>
;
using
TaylorHood
=
TaylorHoodBasis
<
Grid
>
;
constexpr
double
pi
=
3.141592653589793238463
;
test/MarkerTest.cpp
View file @
41cb8a31
...
...
@@ -8,7 +8,7 @@ using namespace AMDiS;
static
const
int
d
=
2
;
// problem dimension
using
Grid
=
Dune
::
UGGrid
<
d
>
;
using
Basis
=
LagrangeBasis
<
Grid
::
LeafGridView
,
1
>
;
using
Basis
=
LagrangeBasis
<
Grid
,
1
>
;
using
Problem
=
ProblemStat
<
Basis
>
;
using
DomainType
=
typename
Dune
::
FieldVector
<
double
,
d
>
;
...
...
test/OperatorsTest.cpp
View file @
41cb8a31
...
...
@@ -10,7 +10,7 @@
using
namespace
AMDiS
;
using
Grid
=
Dune
::
YaspGrid
<
2
>
;
using
Param
=
TaylorHoodBasis
<
typename
Grid
::
LeafGridView
>
;
using
Param
=
TaylorHoodBasis
<
Grid
>
;
using
Problem
=
ProblemStat
<
Param
>
;
int
main
(
int
argc
,
char
**
argv
)
...
...
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