mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-20 11:48:25 -06:00
eclmpiserializer: improve set handler
use has_serializeOp trait
This commit is contained in:
parent
a372a4d09e
commit
2dd6433f16
@ -64,8 +64,8 @@ using remove_cvr_t = std::remove_const_t<std::remove_reference_t<T>>;
|
|||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
/*! \brief Class for (de-)serializing and broadcasting data in parallel.
|
/*! \brief Class for (de-)serializing and broadcasting data in parallel.
|
||||||
*! \details Can be called on any class with a serializeOp member. Such classes
|
*! \details If the class has a serializeOp member this is used,
|
||||||
*! are referred to as 'complex types' in the documentation.
|
* if not it is passed on to the underlying primitive serializer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class EclMpiSerializer {
|
class EclMpiSerializer {
|
||||||
@ -286,7 +286,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Set, bool complexType = true>
|
template<class Set>
|
||||||
void set(Set& data)
|
void set(Set& data)
|
||||||
{
|
{
|
||||||
using Data = typename Set::value_type;
|
using Data = typename Set::value_type;
|
||||||
@ -297,7 +297,7 @@ public:
|
|||||||
this->vector(d);
|
this->vector(d);
|
||||||
else if constexpr (is_ptr<Data>::value)
|
else if constexpr (is_ptr<Data>::value)
|
||||||
ptr(d);
|
ptr(d);
|
||||||
else if constexpr (complexType)
|
else if constexpr (has_serializeOp<Data>::value)
|
||||||
d.serializeOp(*this);
|
d.serializeOp(*this);
|
||||||
else
|
else
|
||||||
(*this)(d);
|
(*this)(d);
|
||||||
|
Loading…
Reference in New Issue
Block a user