40template <
typename DYNAMICS>
42 template <concepts::Cell CELL, concepts::Parameters PARAMETERS, concepts::BaseType V=
typename CELL::value_t>
44 return DYNAMICS().collide(cell, parameters);
49template <
typename DYNAMICS>
52 !std::is_base_of_v<not_cse_optimized_tag, CSE<DYNAMICS>>
56template <
typename DYNAMICS>
62template <concepts::IntrospectableDynamics DYNAMICS>
64 typename DYNAMICS::descriptor_t> {
66 using T =
typename DYNAMICS::value_t;
67 using DESCRIPTOR =
typename DYNAMICS::descriptor_t;
70 using value_t =
typename DYNAMICS::value_t;
78 template <
typename NEW_T>
81 template <
typename NEW_MOMENTA>
85 constexpr static bool is_optimized = dynamics::is_cse_optimized_v<DYNAMICS>;
87 std::type_index
id()
override {
92 return "dynamics::cse<" + DYNAMICS().getName() +
">";
95 template <concepts::Cell CELL, concepts::Parameters PARAMETERS, concepts::BaseType V=
typename CELL::value_t>
101 template <
typename FIELD>
108 return DYNAMICS().getParameters(block);
112 DYNAMICS().initialize(cell);
115 DYNAMICS().computeEquilibrium(cell, rho, u, fEq);
118 return DYNAMICS().computeRho(cell);
121 DYNAMICS().computeU(cell, u);
124 DYNAMICS().computeJ(cell, j);
128 DYNAMICS().computeStress(cell, rho, u, pi);
131 DYNAMICS().computeRhoU(cell, rho, u);
135 DYNAMICS().computeAllMomenta(cell, rho, u, pi);
138 DYNAMICS().defineRho(cell, rho);
141 DYNAMICS().defineU(cell, u);
144 DYNAMICS().defineRhoU(cell, rho, u);
148 DYNAMICS().defineAllMomenta(cell, rho, u, pi);
151 DYNAMICS().inverseShiftRhoU(cell, rho, u);
165template <
typename OPERATOR,
typename DESCRIPTOR>
168template <
typename OPERATOR,
typename DESCRIPTOR>
171 template <concepts::
Cell CELL>
177template <
typename OPERATOR,
typename DESCRIPTOR>
178requires (OPERATOR::scope == OperatorScope::PerCellWithParameters)
180 template <concepts::Cell CELL, concepts::Parameters PARAMETERS>
187template <
typename OPERATOR,
typename DESCRIPTOR>
190 (!std::is_base_of_v<not_cse_optimized_tag, CSE_O<OPERATOR,DESCRIPTOR>> &&
195template <
typename OPERATOR,
typename DESCRIPTOR>
201template <
typename OPERATOR,
typename DESCRIPTOR>
204template <
typename OPERATOR,
typename DESCRIPTOR>
205requires (OPERATOR::scope == OperatorScope::PerCell)
213 template <concepts::Cell CELL>
219template <
typename OPERATOR,
typename DESCRIPTOR>
220requires (OPERATOR::scope == OperatorScope::PerCellWithParameters)
222 static constexpr OperatorScope scope = OperatorScope::PerCellWithParameters;
228 template <concepts::Cell CELL, concepts::Parameters PARAMETERS>
#define OPERATOR(OP, rhs)
Wrapper for auto-generated CSE-optimized DYNAMICS.
typename DYNAMICS::EquilibriumF EquilibriumF
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
std::type_index id() override
Expose unique type-identifier for RTTI.
typename DYNAMICS::parameters parameters
typename DYNAMICS::value_t value_t
void defineRho(Cell< T, DESCRIPTOR > &cell, T rho) override
Set particle density.
T computeRho(ConstCell< T, DESCRIPTOR > &cell) const override
Compute particle density.
void inverseShiftRhoU(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
Calculate population momenta s.t. the physical momenta are reproduced by the computeRhoU.
static constexpr bool is_vectorizable
constexpr bool hasParameter() const
Return true iff FIELD is a parameter.
void computeU(ConstCell< T, DESCRIPTOR > &cell, T u[DESCRIPTOR::d]) const override
Compute fluid velocity.
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Interim workaround for accessing dynamics parameters in legacy post processors.
void defineU(Cell< T, DESCRIPTOR > &cell, const T u[DESCRIPTOR::d]) override
Set fluid velocity.
typename DYNAMICS::MomentaF MomentaF
void computeJ(ConstCell< T, DESCRIPTOR > &cell, T j[DESCRIPTOR::d]) const override
Compute fluid momentum.
void computeStress(ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
typename DYNAMICS::descriptor_t descriptor_t
void computeAllMomenta(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
void initialize(Cell< T, DESCRIPTOR > &cell) override
Initialize dynamics-specific data for cell.
void computeRhoU(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
Compute fluid velocity and particle density.
void defineRhoU(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d]) override
Define fluid velocity and particle density.
static constexpr bool is_optimized
void computeEquilibrium(ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T fEq[DESCRIPTOR::q]) const override
Return iPop equilibrium for given first and second momenta.
std::string getName() const override
Return human-readable name.
void defineAllMomenta(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal< DESCRIPTOR >::n]) override
Highest-level interface to read-only Cell data.
Cell-wise operator with scope, priority and apply template.
std::integral_constant< bool, !std::is_base_of_v< not_cse_optimized_tag, CSE< DYNAMICS > > > is_cse_optimized
Exposes whether a auto-generated CSE specialization is available.
std::integral_constant< bool,(!std::is_base_of_v< not_cse_optimized_tag, CSE_O< OPERATOR, DESCRIPTOR > > && concepts::CellOperator< OPERATOR >) > is_cse_optimized
Exposes whether a auto-generated CSE specialization is available.
Top level namespace for all of OpenLB.
OperatorScope
Block-wide operator application scopes.
@ PerCell
Per-cell application, i.e. OPERATOR::apply is passed a CELL concept implementation.
Dynamic access interface for FIELD-valued parameters.
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
void apply(CELL &cell) any_platform
Wrapper for auto-generated CSE-optimized OPERATOR.
Return value of any collision.
Interface for per-cell dynamics.
To be specialized for automatically generated CSE-optimized DYNAMICS::collide.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
Marker for the default non-optimized specialization of olb::CSE<>
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
To be specialized for automatically generated CSE-optimized OPERATOR::apply.
Marker for the default non-optimized specialization of olb::CSE<>
Compute number of elements of a symmetric d-dimensional tensor.