Commit a9923132 authored by Markus Holzer's avatar Markus Holzer
Browse files

Fixed things

parent 77cb8284
Pipeline #38607 failed with stages
in 6 minutes and 56 seconds
......@@ -67,12 +67,12 @@ BlockDataID addFlagFieldToStorage( const shared_ptr< BlockStorage_T > & blocks,
{
if( alwaysInitialize )
{
auto dataHandling = make_shared< field::AlwaysInitializeBlockDataHandling< FlagField_T > >( blocks, nrOfGhostLayers );
auto dataHandling = make_shared< field::AlwaysInitializeBlockDataHandling< FlagField_T > >( blocks, uint_t(1), nrOfGhostLayers );
dataHandling->addInitializationFunction( initFunction );
return blocks->addBlockData( dataHandling, identifier, requiredSelectors, incompatibleSelectors );
}
auto dataHandling = make_shared< field::DefaultBlockDataHandling< FlagField_T > >( blocks, nrOfGhostLayers );
auto dataHandling = make_shared< field::DefaultBlockDataHandling< FlagField_T > >( blocks, uint_t(1), nrOfGhostLayers );
dataHandling->addInitializationFunction( initFunction );
return blocks->addBlockData( dataHandling, identifier, requiredSelectors, incompatibleSelectors );
}
......@@ -155,6 +155,22 @@ struct AddToStorage< GhostLayerField_T, BlockStorage_T,
} // namespace internal
template< typename GhostLayerField_T, typename BlockStorage_T >
BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks,
const std::string & identifier,
const typename GhostLayerField_T::value_type & initValue = typename GhostLayerField_T::value_type(),
const Layout layout = zyxf,
const uint_t nrOfGhostLayers = uint_t(1),
const bool alwaysInitialize = false,
const std::function< void ( GhostLayerField_T * field, IBlock * const block ) > & initFunction =
std::function< void ( GhostLayerField_T * field, IBlock * const block ) >(),
const Set<SUID> & requiredSelectors = Set<SUID>::emptySet(),
const Set<SUID> & incompatibleSelectors = Set<SUID>::emptySet())
{
return internal::AddToStorage< GhostLayerField_T, BlockStorage_T >::add( blocks, identifier, GhostLayerField_T::F_SIZE, initValue, layout, nrOfGhostLayers,
alwaysInitialize, initFunction, requiredSelectors, incompatibleSelectors );
}
template< typename GhostLayerField_T, typename BlockStorage_T >
BlockDataID addToStorage( const shared_ptr< BlockStorage_T > & blocks,
......
......@@ -74,6 +74,8 @@ namespace field {
//** Type Definitions *******************************************************************************************
/*! \name Type Definitions */
//@{
// TODO remove when old field class is removed
static constexpr bool OLD = false;
using value_type = T;
using iterator = ForwardFieldIterator<T>;
using const_iterator = ForwardFieldIterator<const T>;
......@@ -396,6 +398,7 @@ class Field<T, fSize_> : public Field<T> {
: Field<T>::Field(field)
{}
static const uint_t F_SIZE = fSize_;
static constexpr bool OLD = true;
typedef typename std::conditional<VectorTrait<T>::F_SIZE!=0,
Field<typename VectorTrait<T>::OutputType, VectorTrait<T>::F_SIZE*fSize_>,
......
......@@ -59,6 +59,7 @@ class GhostLayerField<T> : public Field<T>
//** Type Definitions *******************************************************************************************
/*! \name Type Definitions */
//@{
static constexpr bool OLD = false;
using value_type = typename Field< T >::value_type;
using iterator = typename Field< T >::iterator;
......@@ -230,6 +231,7 @@ class GhostLayerField<T, fSize_> : public GhostLayerField<T> {
{}
static const uint_t F_SIZE = fSize_;
static constexpr bool OLD = true;
typedef typename std::conditional<VectorTrait<T>::F_SIZE!=0,
GhostLayerField<typename VectorTrait<T>::OutputType, VectorTrait<T>::F_SIZE*fSize_>,
......
This diff is collapsed.
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