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 810 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 816 of file elements.h.
817 {
818 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
819 j[iD] = V{};
820 }
821 }
◆ 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 824 of file elements.h.
825 {
826 const auto distances = cell.template getFieldPointer<DISTANCES>();
827 const auto velocities = cell.template getFieldPointer<VELOCITY>();
828
829 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
830 u[iD] = V{};
831 }
832 unsigned counter = 0;
833 for (int iPop = 0; iPop < DESCRIPTOR::q; iPop++) {
835 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
836 u[iD] += velocities[3*iPop + iD];
837 }
838 counter++;
839 }
840 }
841 if (counter!=0) {
842 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
843 u[iD] /= counter;
844 }
845 }
846 }
bool nearZero(const ADf< T, DIM > &a)
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 849 of file elements.h.
850 {
851 const auto distances = cell.template getFieldPointer<DISTANCES>();
852 auto velocities = cell.template getFieldPointer<VELOCITY>();
853 auto velocityCoefficient = cell.template getFieldPointer<VELOCITY_COEFFICIENTS>();
854
855 for (int iPop = 0; iPop < DESCRIPTOR::q; iPop++) {
857 velocityCoefficient[iPop] = 0;
858
859 for (int sum = 0; sum < DESCRIPTOR::d; sum++) {
860 velocityCoefficient[iPop] -= descriptors::c<DESCRIPTOR>(iPop,sum)*u[sum];
861 }
862
863 velocityCoefficient[iPop] *= 2*descriptors::invCs2<V,DESCRIPTOR>() * descriptors::t<V,DESCRIPTOR>(iPop);
864
865 for (int iD = 0; iD < DESCRIPTOR::d; iD++) {
866 velocities[3 * iPop + iD] = u[iD];
867 }
868 }
869 }
870 }
References olb::util::nearZero().
◆ getName()
static std::string olb::momenta::OffBoundaryMomentum::getName |
( |
| ) |
|
|
inlinestatic |
Definition at line 884 of file elements.h.
884 {
885 return "OffBoundaryMomentum";
886 }
◆ initialize()
template<typename TYPE , typename CELL , typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::OffBoundaryMomentum::initialize |
( |
CELL & | cell | ) |
|
|
inline |
Definition at line 873 of file elements.h.
874 {
875 auto distances = cell.template getFieldPointer<DISTANCES>();
876 for (int iPop = 0; iPop < DESCRIPTOR::q; iPop++) {
877 distances[iPop] = -1;
878 }
879 }
◆ 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: