24#ifndef FIELD_PARAMETERS_D_H
25#define FIELD_PARAMETERS_D_H
34template <
typename T,
typename DESCRIPTOR,
typename FIELD>
38 DESCRIPTOR::template size<FIELD>() == 1,
39 typename FIELD::template value_type<T>,
61 if constexpr (DESCRIPTOR::template size<FIELD>() == 1) {
69 if constexpr (DESCRIPTOR::template size<FIELD>() == 1) {
78template <
typename T,
typename DESCRIPTOR>
82 template <
typename FIELD>
91 template <
typename FIELD>
94 return concrete->read();
96 throw std::invalid_argument(
"FIELD not provided by this parameter set");
100 template <
typename FIELD>
103 return concrete->read();
109 template <
typename FIELD>
112 return concrete->write(std::forward<
decltype(value)>(value));
114 throw std::invalid_argument(
"FIELD not provided by this parameter set");
118 template <
typename FIELD>
121 return concrete->write(value);
123 throw std::invalid_argument(
"FIELD not provided by this parameter set");
130template <
typename T,
typename DESCRIPTOR,
typename... FIELDS>
136 template <
typename... Fs>
139 template <
typename FIELD_LIST>
140 using include =
typename FIELD_LIST::template decompose_into<include_fields>;
144 template <
typename V>
149 template <
typename FIELD>
151 return fields_t::template contains<FIELD>();
154 template <
typename FIELD>
159 template <
typename V>
164 template <
typename FIELD>
169 template <
typename FIELD>
172 std::forward<
decltype(value)>(value));
175 template <
typename FIELD>
183template <
typename T,
typename DESCRIPTOR,
typename OPERATOR>
185 typename OPERATOR::parameters
189template <
typename DYNAMICS>
191 typename DYNAMICS::value_t,
192 typename DYNAMICS::descriptor_t
194 typename DYNAMICS::parameters
201template <
typename T,
typename DESCRIPTOR>
214template <
typename T,
typename DESCRIPTOR, Platform PLATFORM,
typename PARAMETERS>
235 bool*
getBlock(std::size_t iBlock, std::size_t& sizeBlock,
bool loadingMode)
override;
Storage of a single FIELD-valued parameter.
auto & read() any_platform
ParameterD(const ParameterD< V, DESCRIPTOR, FIELD > &rhs) any_platform
void write(const FieldD< T, DESCRIPTOR, FIELD > &value) any_platform
const auto & read() const any_platform
void write(FieldD< T, DESCRIPTOR, FIELD > &&value) any_platform
Base class for serializable objects of constant size. For dynamic size use BufferSerializable.
Top level namespace for all of OpenLB.
ProcessingContext
OpenLB processing contexts.
typename ParametersD< T, DESCRIPTOR >::template include< typename OPERATOR::parameters > ParametersOfOperatorD
Deduce ParametersD of OPERATOR w.r.t. T and DESCRIPTOR.
typename ParametersD< typename DYNAMICS::value_t, typename DYNAMICS::descriptor_t >::template include< typename DYNAMICS::parameters > ParametersOfDynamicsD
Deduce ParametersD of DYNAMICS w.r.t. its value type and descriptor.
Dynamic access interface for FIELD-valued parameters.
void set(const FieldD< T, DESCRIPTOR, FIELD > &value)
void set(FieldD< T, DESCRIPTOR, FIELD > &&value)
auto getOrFallback(typename ParameterD< T, DESCRIPTOR, FIELD >::data_t &&fallback) const
virtual ~AbstractParameters()=default
Abstract base of ConcreteParametersD.
virtual void setProcessingContext(ProcessingContext context)=0
virtual AbstractParameters< T, DESCRIPTOR > & asAbstract()=0
Concrete storage of ParametersD in olb::Data.
std::size_t getNblock() const override
Number of data blocks for the serializable interface.
AbstractParameters< T, DESCRIPTOR > & asAbstract() override
Return abstract interface to host-side parameters.
bool * getBlock(std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override
Return a pointer to the memory of the current block and its size for the serializable interface.
void setProcessingContext(ProcessingContext context) override
ConcreteParametersD(std::size_t)
ParametersD< T, DESCRIPTOR >::template include< PARAMETERS > parameters
std::size_t getSerializableSize() const override
Binary size for the serializer.
Set of FIELD-valued parameters.
bool provides() const any_platform
ParametersD< V, DESCRIPTOR, FIELDS... > copyAs() const any_platform
typename FIELD_LIST::template decompose_into< include_fields > include
Return ParametersD containing FIELDS in addition to all entries of FIELD_LIST.
const auto & get() const any_platform
auto & get() any_platform
void set(FieldD< T, DESCRIPTOR, FIELD > &&value) any_platform
void set(const FieldD< T, DESCRIPTOR, FIELD > &value) any_platform
ParametersD(const ParametersD< V, DESCRIPTOR, FIELDS... > &rhs) any_platform