OpenLB 1.7
Loading...
Searching...
No Matches
interface.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2021 Adrian Kummerlaender
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef DYNAMICS_INTERFACE_H
25#define DYNAMICS_INTERFACE_H
26
27#include "lbm.h"
28#include "core/concepts.h"
29#include "momenta/interface.h"
30
31#include <type_traits>
32
33namespace olb {
34
35template <typename T, typename DESCRIPTOR> class Cell;
36template <typename T, typename DESCRIPTOR> class ConstCell;
37
39
42template <typename T>
44 T rho;
46
47 operator bool() const any_platform {
48 return rho != T{-1} && uSqr != T{-1};
49 }
50};
51
53template <typename T, typename DESCRIPTOR>
54struct Dynamics {
55 using value_t = T;
56 using descriptor_t = DESCRIPTOR;
57
58 virtual ~Dynamics() any_platform { }
59
61 virtual std::type_index id() = 0;
63 virtual std::string getName() const {
64 return "Dynamics";
65 };
66
68 virtual void initialize(Cell<T,DESCRIPTOR>& cell) { };
69
72
75 throw std::bad_function_call();
76 };
77
79 virtual T computeRho(ConstCell<T,DESCRIPTOR>& cell) const = 0;
81 virtual void computeU(ConstCell<T,DESCRIPTOR>& cell, T u[DESCRIPTOR::d]) const = 0;
83 virtual void computeJ(ConstCell<T,DESCRIPTOR>& cell, T j[DESCRIPTOR::d]) const = 0;
86 T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal<DESCRIPTOR >::n]) const = 0;
88 virtual void computeRhoU(ConstCell<T,DESCRIPTOR>& cell, T& rho, T u[DESCRIPTOR::d]) const = 0;
91 T& rho, T u[DESCRIPTOR::d], T pi[util::TensorVal<DESCRIPTOR >::n]) const = 0;
92
94 virtual void defineRho(Cell<T,DESCRIPTOR>& cell, T rho) = 0;
96 virtual void defineU(Cell<T,DESCRIPTOR>& cell, const T u[DESCRIPTOR::d]) = 0;
98 virtual void defineRhoU(Cell<T,DESCRIPTOR>& cell, T rho, const T u[DESCRIPTOR::d]) = 0;
101 T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal<DESCRIPTOR >::n]) = 0;
102
104 virtual T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d]) const any_platform = 0;
106 void iniEquilibrium(Cell<T,DESCRIPTOR>& cell, T rho, const T u[DESCRIPTOR::d]) {
107 T rhoShift(rho);
108 T uShift[DESCRIPTOR::d];
109 util::copyN(uShift, u, DESCRIPTOR::d);
110 inverseShiftRhoU(cell, rhoShift, uShift);
111 for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
112 cell[iPop] = computeEquilibrium(iPop, rhoShift, uShift);
113 }
114 };
117 T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal<DESCRIPTOR>::n]) {
118 iniEquilibrium(cell, rho, u);
119 for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
120 cell[iPop] += equilibrium<DESCRIPTOR>::template fromPiToFneq<T>(iPop, pi);
121 }
122 };
124 // This is relevant for correct initialization for some forcing/ sourcing schemes
125 virtual void inverseShiftRhoU(ConstCell<T,DESCRIPTOR>& cell, T& rho, T u[DESCRIPTOR::d]) const { };
126
127};
128
129namespace dynamics {
130
132
136 static std::string getName() {
137 return "Default";
138 }
139
140 template <typename DESCRIPTOR, typename MOMENTA>
141 using combined_momenta = typename MOMENTA::template type<DESCRIPTOR>;
142
143 template <typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM>
144 using combined_equilibrium = typename EQUILIBRIUM::template type<DESCRIPTOR,MOMENTA>;
145
146 template <typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM, typename COLLISION>
147 using combined_collision = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>;
148
149 template <typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM, typename COLLISION>
150 using combined_parameters = typename COLLISION::parameters;
151};
152
153
155template <typename DYNAMICS, typename = void>
156struct is_vectorizable : std::true_type { };
157
159
162template <typename DYNAMICS>
164 DYNAMICS,
165 std::enable_if_t<!DYNAMICS::is_vectorizable>
166> : std::false_type { };
167
169template <typename DYNAMICS>
170static constexpr bool is_vectorizable_v = is_vectorizable<DYNAMICS>::value;
171
172
174
177template <
178 typename T, typename DESCRIPTOR,
179 typename MOMENTA, typename EQUILIBRIUM, typename COLLISION,
180 typename COMBINATION_RULE = DefaultCombination
181>
182struct Tuple final : public Dynamics<T,DESCRIPTOR> {
183 using MomentaF = typename COMBINATION_RULE::template combined_momenta<DESCRIPTOR,MOMENTA>;
184 using EquilibriumF = typename COMBINATION_RULE::template combined_equilibrium<DESCRIPTOR,MOMENTA,EQUILIBRIUM>;
185 using CollisionO = typename COMBINATION_RULE::template combined_collision<DESCRIPTOR,MOMENTA,EQUILIBRIUM,COLLISION>;
186
187 using parameters = typename COMBINATION_RULE::template combined_parameters<DESCRIPTOR,MOMENTA,EQUILIBRIUM,COLLISION>;
188
189 constexpr static bool is_vectorizable = is_vectorizable_v<CollisionO>;
190
191 template <typename NEW_MOMENTA>
193 T, DESCRIPTOR,
194 NEW_MOMENTA, EQUILIBRIUM, COLLISION,
195 COMBINATION_RULE
196 >;
197
198 template <typename NEW_RULE>
200 T, DESCRIPTOR,
201 MOMENTA, EQUILIBRIUM, COLLISION,
202 NEW_RULE
203 >;
204
205 template <template<typename> typename WRAPPER>
207 T, DESCRIPTOR,
208 MOMENTA, EQUILIBRIUM, WRAPPER<COLLISION>,
209 COMBINATION_RULE
210 >;
211
212 std::type_index id() override {
213 return typeid(Tuple);
214 }
215
216 std::string getName() const override {
217 return "dynamics::Tuple<"
218 + MomentaF().getName() + ","
219 + EQUILIBRIUM::getName() + ","
220 + COLLISION::getName() + ","
221 + COMBINATION_RULE::getName() +
222 ">";
223 };
224
226 template <typename FIELD>
227 constexpr bool hasParameter() const {
228 return parameters::template contains<FIELD>();
229 };
230
233 return block.template getData<OperatorParameters<Tuple>>();
234 }
235
237 void initialize(Cell<T,DESCRIPTOR>& cell) override {
238 MomentaF().initialize(cell);
239 };
240
242 template <CONCEPT(MinimalCell) CELL, typename PARAMETERS, typename V=typename CELL::value_t>
244 // Copy parameters to enable changes in composed dynamics
245 auto params = static_cast<
247 >(parameters).template copyAs<V>();
248 return CollisionO().apply(cell, params);
249 };
250
251 T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d]) const override any_platform {
252 return EquilibriumF().compute(iPop, rho, u);
253 };
254
255 T computeRho(ConstCell<T,DESCRIPTOR>& cell) const override {
256 return MomentaF().computeRho(cell);
257 };
258 void computeU(ConstCell<T,DESCRIPTOR>& cell, T u[DESCRIPTOR::d]) const override {
259 MomentaF().computeU(cell, u);
260 };
261 void computeJ(ConstCell<T,DESCRIPTOR>& cell, T j[DESCRIPTOR::d]) const override {
262 MomentaF().computeJ(cell, j);
263 };
265 T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal<DESCRIPTOR >::n]) const override {
266 MomentaF().computeStress(cell, rho, u, pi);
267 };
268 void computeRhoU(ConstCell<T,DESCRIPTOR>& cell, T& rho, T u[DESCRIPTOR::d]) const override {
269 MomentaF().computeRhoU(cell, rho, u);
270 };
272 T& rho, T u[DESCRIPTOR::d], T pi[util::TensorVal<DESCRIPTOR >::n]) const override {
273 MomentaF().computeAllMomenta(cell, rho, u, pi);
274 };
275
276 void defineRho(Cell<T,DESCRIPTOR>& cell, T rho) override {
277 MomentaF().defineRho(cell, rho);
278 };
279 void defineU(Cell<T,DESCRIPTOR>& cell, const T u[DESCRIPTOR::d]) override {
280 MomentaF().defineU(cell, u);
281 };
282 void defineRhoU(Cell<T,DESCRIPTOR>& cell, T rho, const T u[DESCRIPTOR::d]) override {
283 MomentaF().defineRhoU(cell, rho, u);
284 };
286 T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal<DESCRIPTOR >::n]) override {
287 MomentaF().defineAllMomenta(cell, rho, u, pi);
288 };
289 void inverseShiftRhoU(ConstCell<T,DESCRIPTOR>& cell, T& rho, T u[DESCRIPTOR::d]) const override {
290 MomentaF().inverseShiftRhoU(cell, rho, u);
291 }
292};
293
294template <typename T, typename DESCRIPTOR, typename MOMENTA>
295struct CustomCollision : public Dynamics<T,DESCRIPTOR> {
296 using value_t = T;
297 using descriptor_t = DESCRIPTOR;
298
299 using MomentaF = typename MOMENTA::template type<DESCRIPTOR>;
300
301 void initialize(Cell<T,DESCRIPTOR>& cell) override {
302 MomentaF().initialize(cell);
303 };
304
305 T computeRho(ConstCell<T,DESCRIPTOR>& cell) const override {
306 return MomentaF().computeRho(cell);
307 };
308 void computeU(ConstCell<T,DESCRIPTOR>& cell, T u[DESCRIPTOR::d]) const override {
309 MomentaF().computeU(cell, u);
310 };
311 void computeJ(ConstCell<T,DESCRIPTOR>& cell, T j[DESCRIPTOR::d]) const override {
312 MomentaF().computeJ(cell, j);
313 };
315 T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal<DESCRIPTOR >::n]) const override {
316 MomentaF().computeStress(cell, rho, u, pi);
317 };
318 void computeRhoU(ConstCell<T,DESCRIPTOR>& cell, T& rho, T u[DESCRIPTOR::d]) const override {
319 MomentaF().computeRhoU(cell, rho, u);
320 };
322 T& rho, T u[DESCRIPTOR::d], T pi[util::TensorVal<DESCRIPTOR >::n]) const override {
323 MomentaF().computeAllMomenta(cell, rho, u, pi);
324 };
325
326 void defineRho(Cell<T,DESCRIPTOR>& cell, T rho) override {
327 MomentaF().defineRho(cell, rho);
328 };
329 void defineU(Cell<T,DESCRIPTOR>& cell, const T u[DESCRIPTOR::d]) override {
330 MomentaF().defineU(cell, u);
331 };
332 void defineRhoU(Cell<T,DESCRIPTOR>& cell, T rho, const T u[DESCRIPTOR::d]) override {
333 MomentaF().defineRhoU(cell, rho, u);
334 };
336 T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal<DESCRIPTOR >::n]) override {
337 MomentaF().defineAllMomenta(cell, rho, u, pi);
338 };
339 void inverseShiftRhoU(ConstCell<T,DESCRIPTOR>& cell, T& rho, T u[DESCRIPTOR::d]) const override {
340 MomentaF().inverseShiftRhoU(cell, rho, u);
341 }
342};
343
345
356template <typename PARAMETER, typename DYNAMICS>
357struct ParameterFromCell final : public CustomCollision<
358 typename DYNAMICS::value_t,
359 typename DYNAMICS::descriptor_t,
360 typename DYNAMICS::MomentaF::abstract
361> {
362 using value_t = typename DYNAMICS::value_t;
363 using descriptor_t = typename DYNAMICS::descriptor_t;
364
365 using MomentaF = typename DYNAMICS::MomentaF;
366
367 using parameters = typename DYNAMICS::parameters;
368
369 template<typename M>
371
372 std::type_index id() override {
373 return typeid(ParameterFromCell);
374 };
375
378 return block.template getData<OperatorParameters<ParameterFromCell>>();
379 }
380
381 template <CONCEPT(MinimalCell) CELL, typename PARAMETERS, typename V=typename CELL::value_t>
383 parameters.template set<PARAMETER>(
384 cell.template getField<PARAMETER>());
385 return DYNAMICS().apply(cell, parameters);
386 };
387
388 value_t computeEquilibrium(int iPop, value_t rho, const value_t u[descriptor_t::d]) const override {
389 return DYNAMICS().computeEquilibrium(iPop, rho, u);
390 };
391
392 std::string getName() const override {
393 return "ParameterFromCell<" + DYNAMICS().getName() + ">";
394 };
395
396};
397
399template <typename DYNAMICS, typename CELL, typename PARAMETERS, typename = void>
400struct is_generic : std::false_type { };
401
403template <typename DYNAMICS, typename CELL, typename PARAMETERS>
405 DYNAMICS, CELL, PARAMETERS,
406 std::enable_if_t<std::is_member_function_pointer_v<decltype(&DYNAMICS::template apply<CELL,PARAMETERS>)>>
407> : std::true_type { };
408
410
413template <typename T, typename DESCRIPTOR, typename DYNAMICS>
414static constexpr bool is_generic_v = is_generic<DYNAMICS, Cell<T,DESCRIPTOR>, AbstractParameters<T,DESCRIPTOR>>::value;
415
417template <typename DYNAMICS, typename = void>
418struct has_parametrized_momenta : std::false_type { };
419
421
424template <typename DYNAMICS>
426 DYNAMICS,
427 std::enable_if_t<DYNAMICS::has_parametrized_momenta>
428> : std::true_type { };
429
431template <typename DYNAMICS>
432static constexpr bool has_parametrized_momenta_v = has_parametrized_momenta<DYNAMICS>::value;
433
434}
435
436}
437
438#endif
Platform-abstracted block lattice for external access and inter-block interaction.
Highest-level interface to Cell data.
Definition cell.h:148
Highest-level interface to read-only Cell data.
Definition cell.h:53
File provides a generic interface for the computation and definition of momenta (density,...
void copyN(T c[], const T a[], const unsigned dim) any_platform
Top level namespace for all of OpenLB.
typename ParametersD< T, DESCRIPTOR >::template include< typename OPERATOR::parameters > ParametersOfOperatorD
Deduce ParametersD of OPERATOR w.r.t. T and DESCRIPTOR.
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition platform.h:78
Dynamic access interface for FIELD-valued parameters.
Return value of any collision.
Definition interface.h:43
Interface for per-cell dynamics.
Definition interface.h:54
virtual void inverseShiftRhoU(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const
Calculate population momenta s.t. the physical momenta are reproduced by the computeRhoU.
Definition interface.h:125
virtual T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d]) const any_platform=0
Return iPop equilibrium for given first and second momenta.
virtual T computeRho(ConstCell< T, DESCRIPTOR > &cell) const =0
Compute particle density.
virtual std::type_index id()=0
Expose unique type-identifier for RTTI.
void iniRegularized(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal< DESCRIPTOR >::n])
Initialize cell to equilibrium and non-equilibrum part.
Definition interface.h:116
virtual void computeU(ConstCell< T, DESCRIPTOR > &cell, T u[DESCRIPTOR::d]) const =0
Compute fluid velocity.
DESCRIPTOR descriptor_t
Definition interface.h:56
virtual void computeStress(ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const =0
Compute stress tensor.
virtual void defineU(Cell< T, DESCRIPTOR > &cell, const T u[DESCRIPTOR::d])=0
Set fluid velocity.
virtual void defineRhoU(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d])=0
Define fluid velocity and particle density.
virtual std::string getName() const
Return human-readable name.
Definition interface.h:63
virtual void initialize(Cell< T, DESCRIPTOR > &cell)
Initialize dynamics-specific data for cell.
Definition interface.h:68
virtual ~Dynamics() any_platform
Definition interface.h:58
void iniEquilibrium(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d])
Initialize to equilibrium distribution.
Definition interface.h:106
virtual void computeRhoU(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const =0
Compute fluid velocity and particle density.
virtual AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block)=0
Parameters access for legacy post processors.
virtual void defineRho(Cell< T, DESCRIPTOR > &cell, T rho)=0
Set particle density.
virtual void computeAllMomenta(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const =0
Compute all momenta up to second order.
virtual void computeJ(ConstCell< T, DESCRIPTOR > &cell, T j[DESCRIPTOR::d]) const =0
Compute fluid momentum.
virtual void defineAllMomenta(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal< DESCRIPTOR >::n])=0
Define all momenta up to second order.
virtual CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell)
Perform purely-local collision step on Cell interface (legacy, to be deprecated)
Definition interface.h:74
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.
Definition interface.h:339
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Definition interface.h:299
void computeU(ConstCell< T, DESCRIPTOR > &cell, T u[DESCRIPTOR::d]) const override
Compute fluid velocity.
Definition interface.h:308
void initialize(Cell< T, DESCRIPTOR > &cell) override
Initialize dynamics-specific data for cell.
Definition interface.h:301
void defineAllMomenta(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal< DESCRIPTOR >::n]) override
Define all momenta up to second order.
Definition interface.h:335
void defineRhoU(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d]) override
Define fluid velocity and particle density.
Definition interface.h:332
void computeJ(ConstCell< T, DESCRIPTOR > &cell, T j[DESCRIPTOR::d]) const override
Compute fluid momentum.
Definition interface.h:311
void computeRhoU(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
Compute fluid velocity and particle density.
Definition interface.h:318
void computeStress(ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
Compute stress tensor.
Definition interface.h:314
T computeRho(ConstCell< T, DESCRIPTOR > &cell) const override
Compute particle density.
Definition interface.h:305
void computeAllMomenta(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
Compute all momenta up to second order.
Definition interface.h:321
void defineRho(Cell< T, DESCRIPTOR > &cell, T rho) override
Set particle density.
Definition interface.h:326
void defineU(Cell< T, DESCRIPTOR > &cell, const T u[DESCRIPTOR::d]) override
Set fluid velocity.
Definition interface.h:329
Default combination rule used by dynamics::Tuple.
Definition interface.h:135
static std::string getName()
Definition interface.h:136
typename EQUILIBRIUM::template type< DESCRIPTOR, MOMENTA > combined_equilibrium
Definition interface.h:144
typename COLLISION::parameters combined_parameters
Definition interface.h:150
typename MOMENTA::template type< DESCRIPTOR > combined_momenta
Definition interface.h:141
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > combined_collision
Definition interface.h:147
Set PARAMETER of DYNAMICS from CELL (for CustomCollision-based DYNAMICS)
Definition interface.h:361
typename DYNAMICS::descriptor_t descriptor_t
Definition interface.h:363
CellStatistic< V > apply(CELL &cell, PARAMETERS &parameters) any_platform
Definition interface.h:382
typename DYNAMICS::value_t value_t
Definition interface.h:362
std::string getName() const override
Return human-readable name.
Definition interface.h:392
typename DYNAMICS::parameters parameters
Definition interface.h:367
AbstractParameters< value_t, descriptor_t > & getParameters(BlockLattice< value_t, descriptor_t > &block) override
Definition interface.h:377
value_t computeEquilibrium(int iPop, value_t rho, const value_t u[descriptor_t::d]) const override
Definition interface.h:388
std::type_index id() override
Expose unique type-identifier for RTTI.
Definition interface.h:372
typename DYNAMICS::MomentaF MomentaF
Definition interface.h:365
Dynamics constructed as a tuple of momenta, equilibrium and collision.
Definition interface.h:182
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.
Definition interface.h:289
void defineU(Cell< T, DESCRIPTOR > &cell, const T u[DESCRIPTOR::d]) override
Set fluid velocity.
Definition interface.h:279
typename COMBINATION_RULE::template combined_momenta< DESCRIPTOR, MOMENTA > MomentaF
Definition interface.h:183
std::string getName() const override
Return human-readable name.
Definition interface.h:216
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d]) const override any_platform
Return iPop equilibrium for given first and second momenta.
Definition interface.h:251
void defineRhoU(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d]) override
Define fluid velocity and particle density.
Definition interface.h:282
T computeRho(ConstCell< T, DESCRIPTOR > &cell) const override
Compute particle density.
Definition interface.h:255
void computeStress(ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
Compute stress tensor.
Definition interface.h:264
void computeAllMomenta(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
Compute all momenta up to second order.
Definition interface.h:271
void defineAllMomenta(Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal< DESCRIPTOR >::n]) override
Define all momenta up to second order.
Definition interface.h:285
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Interim workaround for accessing dynamics parameters in legacy post processors.
Definition interface.h:232
void initialize(Cell< T, DESCRIPTOR > &cell) override
Initialize MOMENTA-specific data for cell.
Definition interface.h:237
constexpr bool hasParameter() const
Return true iff FIELD is a parameter.
Definition interface.h:227
typename COMBINATION_RULE::template combined_equilibrium< DESCRIPTOR, MOMENTA, EQUILIBRIUM > EquilibriumF
Definition interface.h:184
void defineRho(Cell< T, DESCRIPTOR > &cell, T rho) override
Set particle density.
Definition interface.h:276
void computeRhoU(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
Compute fluid velocity and particle density.
Definition interface.h:268
void computeJ(ConstCell< T, DESCRIPTOR > &cell, T j[DESCRIPTOR::d]) const override
Compute fluid momentum.
Definition interface.h:261
typename COMBINATION_RULE::template combined_parameters< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION > parameters
Definition interface.h:187
std::type_index id() override
Expose unique type-identifier for RTTI.
Definition interface.h:212
void computeU(ConstCell< T, DESCRIPTOR > &cell, T u[DESCRIPTOR::d]) const override
Compute fluid velocity.
Definition interface.h:258
typename COMBINATION_RULE::template combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION > CollisionO
Definition interface.h:185
CellStatistic< V > apply(CELL &cell, PARAMETERS &parameters) any_platform
Apply purely-local collision step to a generic CELL.
Definition interface.h:243
DYNAMICS is not explicitly marked as requiring parameters outside DYNAMICS::apply.
Definition interface.h:418
DYNAMICS doesn't provide apply method template.
Definition interface.h:400
DYNAMICS is not explicitly marked as unvectorizable.
Definition interface.h:156
Compute number of elements of a symmetric d-dimensional tensor.
Definition util.h:210