Commit 2b3d27c9 authored by Marcus Mohr's avatar Marcus Mohr
Browse files

Changes to typedefs/using statements in some function classes

The FunctionWrapper class no longer typedefs FunctionType to its
func_t argument. IMHO that was pretty useless. Instead we get a
```
template< typename VType >
using WrappedFuncKind =
typename WrappedFuncType::template FunctionType< VType >;
```
For this to work functions the get wrapped need to provide a templated
FunctionType. So this is added to
- DGFunction
- and all already exisiting children of the BlockFunction class.
parent 11449739
......@@ -30,6 +30,10 @@ template < typename value_t >
class P2P1TaylorHoodBlockFunction : public BlockFunction< value_t >
{
public:
template < typename VType >
using FunctionType = P2P1TaylorHoodBlockFunction< VType >;
P2P1TaylorHoodBlockFunction( const std::string& name,
const std::shared_ptr< PrimitiveStorage >& storage,
size_t minLevel,
......
......@@ -37,6 +37,11 @@ template < typename ValueType >
class DGFunction final : public Function< DGFunction< ValueType > >
{
public:
typedef ValueType valueType;
template < typename VType >
using FunctionType = DGFunction< VType >;
DGFunction( const std::string& name, const std::shared_ptr< PrimitiveStorage >& storage, uint_t minLevel, uint_t maxLevel )
: DGFunction( name, storage, minLevel, maxLevel, BoundaryCondition::create0123BC() )
{}
......
......@@ -36,7 +36,13 @@ class FunctionWrapper final : public GenericFunction< typename FunctionTrait< fu
public:
typedef typename FunctionTrait< func_t >::ValueType value_t;
typedef typename FunctionTrait< func_t >::Tag Tag;
typedef func_t FunctionType;
// is this really helpful, as it is not templated?
// typedef func_t FunctionType;
// how about this instead:
using WrappedFuncType = func_t;
template< typename VType >
using WrappedFuncKind = typename WrappedFuncType::template FunctionType< VType >;
/// No need for this one, if we do not implement a setter method for wrappedFunc_;
FunctionWrapper() = delete;
......@@ -165,6 +171,18 @@ class FunctionWrapper final : public GenericFunction< typename FunctionTrait< fu
return numberOfLocalDoFs< typename FunctionType::Tag >( *( getStorage() ), level );
}
/// conversion to/from linear algebra representation
/// @{
#if 0
#ifdef HYTEG_BUILD_WITH_PETSC
void toVector( const P2VectorFunction< PetscInt >& numerator,
const std::shared_ptr< VectorProxy >& vec,
uint_t level,
DoFType flag );
/// @}
#endif
#endif
private:
std::unique_ptr< func_t > wrappedFunc_;
};
......
......@@ -39,6 +39,10 @@ template < typename value_t >
class TestBlockFunction : public BlockFunction< value_t >
{
public:
template < typename VType >
using FunctionType = TestBlockFunction< VType >;
TestBlockFunction( const std::string& name,
const std::shared_ptr< PrimitiveStorage >& storage,
size_t minLevel,
......
......@@ -528,6 +528,9 @@ template < typename value_t >
class P1CahnHilliardFunction : public BlockFunction< value_t >
{
public:
template < typename VType >
using FunctionType = P1CahnHilliardFunction< VType >;
P1CahnHilliardFunction( const std::string& name,
const std::shared_ptr< PrimitiveStorage >& storage,
size_t minLevel,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment