OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::equilibria::Chopard::type< DESCRIPTOR, MOMENTA > Struct Template Reference

#include <equilibrium.h>

+ Collaboration diagram for olb::equilibria::Chopard::type< DESCRIPTOR, MOMENTA >:

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 

Public Member Functions

template<typename CELL , typename RHO , typename U , typename FEQ , typename VS2 , typename V = typename CELL::value_t>
CellStatistic< V > compute (CELL &cell, RHO &rho, U &u, FEQ &fEq, VS2 vs2=V{1}/descriptors::invCs2< V, DESCRIPTOR >()) any_platform
 
template<typename CELL , typename PARAMETERS , typename FEQ , typename V = typename CELL::value_t>
CellStatistic< V > compute (CELL &cell, PARAMETERS &parameters, FEQ &fEq) any_platform
 

Detailed Description

template<typename DESCRIPTOR, typename MOMENTA>
struct olb::equilibria::Chopard::type< DESCRIPTOR, MOMENTA >

Definition at line 306 of file equilibrium.h.

Member Typedef Documentation

◆ MomentaF

template<typename DESCRIPTOR , typename MOMENTA >
using olb::equilibria::Chopard::type< DESCRIPTOR, MOMENTA >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 307 of file equilibrium.h.

Member Function Documentation

◆ compute() [1/2]

template<typename DESCRIPTOR , typename MOMENTA >
template<typename CELL , typename PARAMETERS , typename FEQ , typename V = typename CELL::value_t>
CellStatistic< V > olb::equilibria::Chopard::type< DESCRIPTOR, MOMENTA >::compute ( CELL & cell,
PARAMETERS & parameters,
FEQ & fEq )
inline

Definition at line 334 of file equilibrium.h.

334 {
335 V rho, u[DESCRIPTOR::d];
336 MomentaF().computeRhoU(cell, rho, u);
337 const V vs2 = parameters.template get<SPEED_OF_SOUND>();
338 const V uSqr = util::normSqr<V,DESCRIPTOR::d>(u);
339 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
340 if (iPop==0) {
341 return rho * (V{1} - vs2 * descriptors::invCs2<V,DESCRIPTOR>()*(V{1}-descriptors::t<V,DESCRIPTOR>(0))
344 }
345 else {
346 V c_u{};
347 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
348 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
349 }
351 * (vs2 + c_u
352 + descriptors::invCs2<V,DESCRIPTOR>() / V{2} * c_u*c_u
353 - uSqr / V{2})
355 }
356 }
357 return {rho, uSqr};
358 };
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Definition util.h:145
typename MOMENTA::template type< DESCRIPTOR > MomentaF
meta::list< SPEED_OF_SOUND > parameters

References olb::descriptors::c(), olb::descriptors::invCs2(), olb::util::normSqr(), and olb::descriptors::t().

+ Here is the call graph for this function:

◆ compute() [2/2]

template<typename DESCRIPTOR , typename MOMENTA >
template<typename CELL , typename RHO , typename U , typename FEQ , typename VS2 , typename V = typename CELL::value_t>
CellStatistic< V > olb::equilibria::Chopard::type< DESCRIPTOR, MOMENTA >::compute ( CELL & cell,
RHO & rho,
U & u,
FEQ & fEq,
VS2 vs2 = V{1} / descriptors::invCs2<V,DESCRIPTOR>() )
inline

Definition at line 310 of file equilibrium.h.

311 const V uSqr = util::normSqr<V,DESCRIPTOR::d>(u);
312 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
313 if (iPop==0) {
314 return rho * (V{1} - vs2 * descriptors::invCs2<V,DESCRIPTOR>()*(V{1}-descriptors::t<V,DESCRIPTOR>(0))
317 }
318 else {
319 V c_u{};
320 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
321 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
322 }
324 * (vs2 + c_u
325 + descriptors::invCs2<V,DESCRIPTOR>() / V{2} * c_u*c_u
326 - uSqr / V{2})
328 }
329 }
330 return {rho, uSqr};
331 };
#define any_platform
Define preprocessor macros for device-side functions, constant storage.
Definition platform.h:77

The documentation for this struct was generated from the following file: