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
Core Modules
dune-localfunctions
Commits
8a26ac50
Commit
8a26ac50
authored
May 18, 2021
by
Oliver Sander
Browse files
Merge branch 'feature/avoid-ifgeometry' into 'master'
Replace IfGeometry by toGeometryTypeIdConstant See merge request
!193
parents
9b7cf76c
39d3bd9d
Pipeline
#36548
passed with stage
in 8 minutes and 26 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dune/localfunctions/raviartthomas/raviartthomassimplex/raviartthomassimplexinterpolation.hh
View file @
8a26ac50
...
...
@@ -11,6 +11,7 @@
#include <dune/geometry/quadraturerules.hh>
#include <dune/geometry/referenceelements.hh>
#include <dune/geometry/type.hh>
#include <dune/geometry/typeindex.hh>
#include <dune/localfunctions/common/localkey.hh>
#include <dune/localfunctions/utility/interpolationhelper.hh>
...
...
@@ -171,7 +172,9 @@ namespace Dune
* And depending on the dynamic face index a different face geometry is needed.
*
*/
TestFaceBasis
*
faceBasis
=
Impl
::
IfGeometryType
<
CreateFaceBasis
,
dimension
-
1
>::
apply
(
refElement
.
type
(
face
,
1
),
order
);
TestFaceBasis
*
faceBasis
=
Impl
::
toGeometryTypeIdConstant
<
dimension
-
1
>
(
refElement
.
type
(
face
,
1
),
[
&
](
auto
faceGeometryTypeId
)
{
return
TestFaceBasisFactory
::
template
create
<
decltype
(
faceGeometryTypeId
)
::
value
>(
order
);
});
faceStructure_
.
emplace_back
(
faceBasis
,
refElement
.
integrationOuterNormal
(
face
)
);
}
assert
(
faceStructure_
.
size
()
==
faceSize_
);
...
...
@@ -188,12 +191,6 @@ namespace Dune
const
Dune
::
FieldVector
<
Field
,
dimension
>
*
normal_
;
};
template
<
GeometryType
::
Id
faceGeometryId
>
struct
CreateFaceBasis
{
static
TestFaceBasis
*
apply
(
std
::
size_t
order
)
{
return
TestFaceBasisFactory
::
template
create
<
faceGeometryId
>(
order
);
}
};
std
::
vector
<
FaceStructure
>
faceStructure_
;
TestBasis
*
testBasis_
=
nullptr
;
GeometryType
geometry_
;
...
...
dune/localfunctions/utility/localfiniteelement.hh
View file @
8a26ac50
...
...
@@ -4,6 +4,7 @@
#define DUNE_GENERIC_LOCALFINITEELEMENT_HH
#include <dune/geometry/type.hh>
#include <dune/geometry/typeindex.hh>
#include <dune/localfunctions/common/localfiniteelementtraits.hh>
#include <dune/localfunctions/utility/l2interpolation.hh>
...
...
@@ -43,7 +44,9 @@ namespace Dune
key_
(
key
),
finiteElement_
()
{
Impl
::
IfGeometryType
<
FiniteElement
::
template
Maker
,
dimDomain
>
::
apply
(
type
(),
key_
,
finiteElement_
);
Impl
::
toGeometryTypeIdConstant
<
dimDomain
>
(
type
(),
[
&
](
auto
geometryTypeId
)
{
finiteElement_
.
template
create
<
decltype
(
geometryTypeId
)
::
value
>(
key_
);
});
}
/** \todo Please doc me */
...
...
@@ -52,7 +55,9 @@ namespace Dune
key_
(
other
.
key_
),
finiteElement_
()
{
Impl
::
IfGeometryType
<
FiniteElement
::
template
Maker
,
dimDomain
>
::
apply
(
type
(),
key_
,
finiteElement_
);
Impl
::
toGeometryTypeIdConstant
<
dimDomain
>
(
type
(),
[
&
](
auto
geometryTypeId
)
{
finiteElement_
.
template
create
<
decltype
(
geometryTypeId
)
::
value
>(
key_
);
});
}
~
GenericLocalFiniteElement
()
...
...
@@ -118,14 +123,6 @@ namespace Dune
coeff_
=
0
;
interpol_
=
0
;
}
template
<
GeometryType
::
Id
geometryId
>
struct
Maker
{
static
void
apply
(
const
Key
&
key
,
FiniteElement
&
finiteElement
)
{
finiteElement
.
template
create
<
geometryId
>(
key
);
};
};
typename
Traits
::
LocalBasisType
*
basis_
;
typename
Traits
::
LocalCoefficientsType
*
coeff_
;
typename
Traits
::
LocalInterpolationType
*
interpol_
;
...
...
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