OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
olb::collision::TRT::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > Struct Template Reference

#include <collision.h>

+ Collaboration diagram for olb::collision::TRT::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >:

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using EquilibriumF = typename EQUILIBRIUM::template type<DESCRIPTOR,MOMENTA>
 

Public Member Functions

template<CONCEPT(MinimalCell) CELL, typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > apply (CELL &cell, PARAMETERS &parameters) any_platform
 

Detailed Description

template<typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM>
struct olb::collision::TRT::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >

Definition at line 215 of file collision.h.

Member Typedef Documentation

◆ EquilibriumF

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
using olb::collision::TRT::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::EquilibriumF = typename EQUILIBRIUM::template type<DESCRIPTOR,MOMENTA>

Definition at line 217 of file collision.h.

◆ MomentaF

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
using olb::collision::TRT::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 216 of file collision.h.

Member Function Documentation

◆ apply()

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
template<CONCEPT(MinimalCell) CELL, typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::collision::TRT::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 220 of file collision.h.

220 {
221 V fPlus[DESCRIPTOR::q], fMinus[DESCRIPTOR::q];
222 V fEq[DESCRIPTOR::q], fEqPlus[DESCRIPTOR::q], fEqMinus[DESCRIPTOR::q];
223 const auto statistic = EquilibriumF().compute(cell, parameters, fEq);
224 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
225 fPlus[iPop] = 0.5 * (cell[iPop] + cell[descriptors::opposite<DESCRIPTOR>(iPop)]);
226 fMinus[iPop] = 0.5 * (cell[iPop] - cell[descriptors::opposite<DESCRIPTOR>(iPop)]);
227 }
228 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
229 fEqPlus[iPop] = 0.5 * (fEq[iPop] + fEq[descriptors::opposite<DESCRIPTOR>(iPop)]);
230 fEqMinus[iPop] = 0.5 * (fEq[iPop] - fEq[descriptors::opposite<DESCRIPTOR>(iPop)]);
231 }
232
233 const V omega = parameters.template get<descriptors::OMEGA>();
234 const V magic = parameters.template get<MAGIC>();
235 const V omega2 = V{1} / (magic / (V{1} / omega - 0.5) + V{0.5});
236
237 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
238 cell[iPop] -= omega * (fPlus[iPop] - fEqPlus[iPop]) + omega2 * (fMinus[iPop] - fEqMinus[iPop]);
239 }
240 return statistic;
241 };
typename EQUILIBRIUM::template type< DESCRIPTOR, MOMENTA > EquilibriumF
Definition collision.h:217
typename meta::list< descriptors::OMEGA, MAGIC > parameters
Definition collision.h:208

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