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-vtk
Commits
eb5be127
Commit
eb5be127
authored
Jan 18, 2020
by
Praetorius, Simon
Browse files
moved sizeImpl into local static member function
parent
80c0ff52
Changes
4
Hide whitespace changes
Inline
Side-by-side
dune/vtk/vtkfunction.hh
View file @
eb5be127
...
...
@@ -16,24 +16,6 @@ namespace Dune
template
<
class
T
,
int
N
,
int
M
>
class
FieldMatrix
;
namespace
Impl
{
template
<
class
T
,
class
=
void
>
struct
SizeImpl
:
std
::
integral_constant
<
int
,
1
>
{};
template
<
class
T
,
int
N
>
struct
SizeImpl
<
FieldVector
<
T
,
N
>>
:
std
::
integral_constant
<
int
,
N
>
{};
template
<
class
T
,
int
N
,
int
M
>
struct
SizeImpl
<
FieldMatrix
<
T
,
N
,
M
>>
:
std
::
integral_constant
<
int
,
N
*
M
>
{};
}
template
<
class
T
>
constexpr
int
sizeOf
()
{
return
Impl
::
SizeImpl
<
std
::
decay_t
<
T
>>::
value
;
}
/// Wrapper class for functions allowing local evaluations.
template
<
class
GridView
>
...
...
@@ -47,6 +29,22 @@ namespace Dune
template
<
class
F
>
using
Range
=
std
::
decay_t
<
decltype
(
std
::
declval
<
F
>
()(
std
::
declval
<
Domain
>
()))
>
;
private:
template
<
class
T
,
int
N
>
static
auto
sizeOfImpl
(
FieldVector
<
T
,
N
>
const
&
)
->
std
::
integral_constant
<
int
,
N
>
{
return
{};
}
template
<
class
T
,
int
N
,
int
M
>
static
auto
sizeOfImpl
(
FieldMatrix
<
T
,
N
,
M
>
const
&
)
->
std
::
integral_constant
<
int
,
N
*
M
>
{
return
{};
};
static
auto
sizeOfImpl
(...)
->
std
::
integral_constant
<
int
,
1
>
{
return
{};
}
template
<
class
T
>
static
constexpr
int
sizeOf
()
{
return
decltype
(
sizeOfImpl
(
std
::
declval
<
T
>
()))
::
value
;
}
public:
/// Constructor VtkFunction from legacy VTKFunction
/**
...
...
src/test/mixed_element_test.cc
View file @
eb5be127
...
...
@@ -13,7 +13,10 @@
#include
<dune/common/filledarray.hh>
#include
<dune/common/test/testsuite.hh>
#if HAVE_UG
#include
<dune/grid/uggrid.hh>
#endif
#include
<dune/grid/yaspgrid.hh>
#include
<dune/grid/utility/structuredgridfactory.hh>
...
...
src/test/parallel_reader_writer_test.cc
View file @
eb5be127
...
...
@@ -14,7 +14,10 @@
#include
<dune/common/std/type_traits.hh>
#include
<dune/common/test/testsuite.hh>
#if HAVE_UG
#include
<dune/grid/uggrid.hh>
#endif
#include
<dune/grid/yaspgrid.hh>
#include
<dune/grid/utility/structuredgridfactory.hh>
...
...
src/test/reader_writer_test.cc
View file @
eb5be127
...
...
@@ -7,13 +7,17 @@
#include
<cstring>
#include
<iostream>
#include
<set>
#include
<vector>
#include
<dune/common/parallel/mpihelper.hh>
// An initializer of MPI
#include
<dune/common/filledarray.hh>
#include
<dune/common/test/testsuite.hh>
#if HAVE_UG
#include
<dune/grid/uggrid.hh>
#endif
#include
<dune/grid/yaspgrid.hh>
#include
<dune/grid/utility/structuredgridfactory.hh>
...
...
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