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

The velocity is stored in the external field descriptors::VELOCITY. More...

#include <elements.h>

+ Collaboration diagram for olb::momenta::FixedVelocityMomentum:

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 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 , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
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

The velocity is stored in the external field descriptors::VELOCITY.

Definition at line 727 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::FixedVelocityMomentum::compute ( CELL & cell,
J & j )
inline

Definition at line 730 of file elements.h.

731 {
732 const V rho = TYPE().computeRho(cell);
733 auto uExt = cell.template getField<descriptors::VELOCITY>();
734 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
735 j[iD] = uExt[iD] * rho;
736 }
737 }

◆ computeU()

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

Definition at line 741 of file elements.h.

742 {
743 auto uExt = cell.template getField<descriptors::VELOCITY>();
744 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
745 u[iD] = uExt[iD];
746 }
747 }

◆ define()

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

Definition at line 751 of file elements.h.

752 {
753 cell.template setField<descriptors::VELOCITY>(u);
754 }

◆ getName()

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

Definition at line 766 of file elements.h.

766 {
767 return "FixedVelocityMomentum";
768 }

◆ initialize()

template<typename TYPE , typename CELL , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::FixedVelocityMomentum::initialize ( CELL & cell)
inline

Definition at line 757 of file elements.h.

758 {
759 const V u[DESCRIPTOR::d] = { V{} };
760 cell.template setField<descriptors::VELOCITY>(u);
761 }

◆ inverseShift()

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

Definition at line 764 of file elements.h.

764{};

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