For offLattice boundary conditions.
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 , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t> |
| void | define (CELL &cell, const U &u) any_platform |
| |
| template<typename TYPE , typename CELL , 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 |
| |
For offLattice boundary conditions.
Definition at line 1051 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::OffBoundaryMomentum::compute |
( |
CELL & | cell, |
|
|
J & | j ) |
|
inline |
Definition at line 1057 of file elements.h.
1058 {
1059 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
1060 j[iD] = V{};
1061 }
1062 }
◆ computeU()
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
| void olb::momenta::OffBoundaryMomentum::computeU |
( |
CELL & | cell, |
|
|
U & | u ) |
|
inline |
Definition at line 1065 of file elements.h.
1066 {
1067 const auto distances = cell.template getFieldPointer<DISTANCES>();
1068 const auto velocities = cell.template getFieldPointer<VELOCITY>();
1069
1070 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
1071 u[iD] = V{};
1072 }
1073 unsigned counter = 0;
1074 for (int iPop = 0; iPop < DESCRIPTOR::q; iPop++) {
1076 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
1077 u[iD] += velocities[3*iPop + iD];
1078 }
1079 counter++;
1080 }
1081 }
1082 if (counter!=0) {
1083 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
1084 u[iD] /= counter;
1085 }
1086 }
1087 }
bool nearZero(T a) any_platform
return true if a is close to zero
References olb::util::nearZero().
◆ define()
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
| void olb::momenta::OffBoundaryMomentum::define |
( |
CELL & | cell, |
|
|
const U & | u ) |
|
inline |
Definition at line 1090 of file elements.h.
1091 {
1092 const auto distances = cell.template getFieldPointer<DISTANCES>();
1093 auto velocities = cell.template getFieldPointer<VELOCITY>();
1094 auto velocityCoefficient = cell.template getFieldPointer<VELOCITY_COEFFICIENTS>();
1095
1096 for (int iPop = 0; iPop < DESCRIPTOR::q; iPop++) {
1098 velocityCoefficient[iPop] = 0;
1099
1100 for (int sum = 0; sum < DESCRIPTOR::d; sum++) {
1102 }
1103
1105
1106 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
1107 velocities[3 * iPop + iD] = u[iD];
1108 }
1109 }
1110 }
1111 }
constexpr T invCs2() any_platform
constexpr T t(unsigned iPop, tag::CUM) any_platform
constexpr int c(unsigned iPop, unsigned iDim) any_platform
References olb::descriptors::c(), olb::descriptors::invCs2(), olb::util::nearZero(), and olb::descriptors::t().
◆ getName()
| static std::string olb::momenta::OffBoundaryMomentum::getName |
( |
| ) |
|
|
inlinestatic |
Definition at line 1125 of file elements.h.
1125 {
1126 return "OffBoundaryMomentum";
1127 }
◆ initialize()
template<typename TYPE , typename CELL , typename DESCRIPTOR = typename CELL::descriptor_t>
| void olb::momenta::OffBoundaryMomentum::initialize |
( |
CELL & | cell | ) |
|
|
inline |
Definition at line 1114 of file elements.h.
1115 {
1116 auto distances = cell.template getFieldPointer<DISTANCES>();
1117 for (int iPop = 0; iPop < DESCRIPTOR::q; iPop++) {
1118 distances[iPop] = -1;
1119 }
1120 }
◆ inverseShift()
template<typename TYPE , typename CELL , typename U >
| void olb::momenta::OffBoundaryMomentum::inverseShift |
( |
CELL & | cell, |
|
|
U & | u ) |
|
inline |
The documentation for this struct was generated from the following file: