Momentum computation for P1 dynamics.
More...
#include <elements.h>
|
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 |
|
Momentum computation for P1 dynamics.
Definition at line 891 of file elements.h.
◆ 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
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 |
◆ 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 |
◆ inverseShift()
template<typename TYPE , typename CELL , typename U >
void olb::momenta::P1Momentum::inverseShift |
( |
CELL & | cell, |
|
|
U & | u ) |
|
inline |
The documentation for this struct was generated from the following file: