OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
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 891 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 893 of file elements.h.

894 {
895 std::array<V,DESCRIPTOR::q> cellShifted;
896 for (int iPop = 0; iPop <DESCRIPTOR::q; ++iPop) {
897 cellShifted[iPop] = cell[iPop] + descriptors::t<V,DESCRIPTOR>(iPop);
898 }
899 std::array<V,DESCRIPTOR::d> moment1;
900 moment1.fill( V(0) );
901 // sum_j v_j f_j
902 for (int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
903 for (int iDim = 0; iDim < DESCRIPTOR::d; ++iDim) {
904 moment1[iDim] += descriptors::c<DESCRIPTOR>(iPop,iDim)*cellShifted[iPop];
905 }
906 }
907 for (int iDim = 0; iDim < DESCRIPTOR::d; ++iDim) {
908 j[iDim] = moment1[iDim];
909 }
910 }

◆ 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 913 of file elements.h.

914 {
915 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
916 u[iD] = V{};
917 }
918 }

◆ define()

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

Definition at line 921 of file elements.h.

921{}

◆ getName()

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

Definition at line 929 of file elements.h.

929 {
930 return "P1Momentum";
931 }

◆ initialize()

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

Definition at line 924 of file elements.h.

924{}

◆ inverseShift()

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

Definition at line 927 of file elements.h.

927{}

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