Skip to content
Snippets Groups Projects
Commit 9a5d22bf authored by René Fritze's avatar René Fritze
Browse files

move of tuple serializer from navier to stuff

parent edefc42f
No related branches found
No related tags found
No related merge requests found
#ifndef DUNE_STUFF_TUPLE_HH
#define DUNE_STUFF_TUPLE_HH
namespace Stuff {
template <class T1, class T2 = T1, class T3 = T2, class T4 = T3>
struct TupleSerializer
{
typedef Dune::
Tuple<const typename T1::DiscreteVelocityFunctionType*, const typename T1::DiscretePressureFunctionType*,
const typename T2::DiscreteVelocityFunctionType*, const typename T2::DiscretePressureFunctionType*,
const typename T3::DiscreteVelocityFunctionType*, const typename T3::DiscretePressureFunctionType*,
const typename T4::DiscreteVelocityFunctionType*, const typename T4::DiscretePressureFunctionType*>
TupleType;
static TupleType& getTuple(T1& t1, T2& t2, T3& t3, T4& t4)
{
// yay for dangling pointers, but using a local static here fubared sequential runs with diff grid
TupleType* t = new TupleType(&(t1.discreteVelocity()),
&(t1.discretePressure()),
&(t2.discreteVelocity()),
&(t2.discretePressure()),
&(t3.discreteVelocity()),
&(t3.discretePressure()),
&(t4.discreteVelocity()),
&(t4.discretePressure()));
return *t;
}
static TupleType& getTuple(T1& t1, T2& t2, T3& t3)
{
// yay for dangling pointers, but using a local static here fubared sequential runs with diff grid
TupleType* t = new TupleType(&(t1.discreteVelocity()),
&(t1.discretePressure()),
&(t2.discreteVelocity()),
&(t2.discretePressure()),
&(t3.discreteVelocity()),
&(t3.discretePressure()),
NULL,
NULL);
return *t;
}
static TupleType& getTuple(T1& t1, T2& t2)
{
// yay for dangling pointers, but using a local static here fubared sequential runs with diff grid
TupleType* t = new TupleType(&(t1.discreteVelocity()),
&(t1.discretePressure()),
&(t2.discreteVelocity()),
&(t2.discretePressure()),
NULL,
NULL,
NULL,
NULL);
return *t;
}
static TupleType& getTuple(T1& t1)
{
// yay for dangling pointers, but using a local static here fubared sequential runs with diff grid
TupleType* t =
new TupleType(&(t1.discreteVelocity()), &(t1.discretePressure()), NULL, NULL, NULL, NULL, NULL, NULL);
return *t;
}
};
} // namespace Stuff {
#endif // DUNE_STUFF_TUPLE_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment