OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::momenta::P1Momentum Struct Reference

Momentum computation for P1 dynamics. More...

#include <elements.h>

+ Collaboration diagram for olb::momenta::P1Momentum:

Public Member Functions

template<typename TYPE , typename CELL , typename J , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void compute (CELL &cell, J &j) any_platform
 
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void computeU (CELL &cell, U &u) any_platform
 
template<typename TYPE , typename CELL , typename U >
void define (CELL &cell, const U &u) any_platform
 
template<typename TYPE , typename CELL >
void initialize (CELL &cell) any_platform
 
template<typename TYPE , typename CELL , typename U >
void inverseShift (CELL &cell, U &u) any_platform
 

Static Public Member Functions

static std::string getName ()
 

Detailed Description

Momentum computation for P1 dynamics.

Definition at line 1132 of file elements.h.

Member Function Documentation

◆ compute()

template<typename TYPE , typename CELL , typename J , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::P1Momentum::compute ( CELL & cell,
J & j )
inline

Definition at line 1134 of file elements.h.

1135 {
1136 std::array<V,DESCRIPTOR::q> cellShifted;
1137 for (int iPop = 0; iPop <DESCRIPTOR::q; ++iPop) {
1138 cellShifted[iPop] = cell[iPop] + descriptors::t<V,DESCRIPTOR>(iPop);
1139 }
1140 std::array<V,DESCRIPTOR::d> moment1;
1141 moment1.fill( V(0) );
1142 // sum_j v_j f_j
1143 for (int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
1144 for (int iDim = 0; iDim < DESCRIPTOR::d; ++iDim) {
1145 moment1[iDim] += descriptors::c<DESCRIPTOR>(iPop,iDim)*cellShifted[iPop];
1146 }
1147 }
1148 for (int iDim = 0; iDim < DESCRIPTOR::d; ++iDim) {
1149 j[iDim] = moment1[iDim];
1150 }
1151 }
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

References olb::descriptors::c(), and olb::descriptors::t().

+ Here is the call graph for this function:

◆ computeU()

template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::P1Momentum::computeU ( CELL & cell,
U & u )
inline

Definition at line 1154 of file elements.h.

1155 {
1156 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
1157 u[iD] = V{};
1158 }
1159 }

◆ define()

template<typename TYPE , typename CELL , typename U >
void olb::momenta::P1Momentum::define ( CELL & cell,
const U & u )
inline

Definition at line 1162 of file elements.h.

1162{}

◆ getName()

static std::string olb::momenta::P1Momentum::getName ( )
inlinestatic

Definition at line 1170 of file elements.h.

1170 {
1171 return "P1Momentum";
1172 }

◆ initialize()

template<typename TYPE , typename CELL >
void olb::momenta::P1Momentum::initialize ( CELL & cell)
inline

Definition at line 1165 of file elements.h.

1165{}

◆ inverseShift()

template<typename TYPE , typename CELL , typename U >
void olb::momenta::P1Momentum::inverseShift ( CELL & cell,
U & u )
inline

Definition at line 1168 of file elements.h.

1168{}

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