24#ifndef CORE_PLATFORM_CPU_CELL_H
25#define CORE_PLATFORM_CPU_CELL_H
34template <
typename T,
typename DESCRIPTOR, Platform PLATFORM>
38template <
typename T,
typename DESCRIPTOR, Platform PLATFORM>
61 for (
unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
69 for (
unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
79template <
typename T,
typename DESCRIPTOR, Platform PLATFORM>
86template <
typename T,
typename DESCRIPTOR, Platform PLATFORM>
113 return _lattice->template getField<descriptors::POPULATION>()[iPop][_iCell];
116 template <
typename FIELD>
118 return _lattice->template getField<FIELD>().getRow(_iCell);
121 template <
typename FIELD>
123 return _lattice->template getField<FIELD>().setRow(_iCell, v);
126 template <
typename FIELD>
128 return _lattice->template getField<FIELD>().getRowPointer(_iCell);
131 template <
typename FIELD>
133 return _lattice->template getField<FIELD>()[iD][_iCell];
141 return *getFieldComponent<DYNAMICS<T,DESCRIPTOR,PLATFORM>>(0);
157 T rho, u[DESCRIPTOR::d] { };
162 getDynamics().computeAllMomenta(*
this, rho, u, pi);
178 for (
int iPop=0; iPop < descriptors::q<DESCRIPTOR>(); ++iPop) {
CellDistance getNeighborDistance(LatticeR< D > dir) const
Get 1D neighbor distance.
Implementation of BlockLattice on a concrete PLATFORM.
Cell concept for concrete block lattices on CPU platforms.
void defineAllMomenta(T rho, T *u, T *pi)
auto & getFieldComponent(unsigned iD)
void computeRhoU(T &rho, T *u)
void iniEquilibrium(T rho, T *u)
Cell< T, DESCRIPTOR, PLATFORM > neighbor(LatticeR< DESCRIPTOR::d > offset)
void computeAllMomenta(T &rho, T *u, T *pi)
void definePopulations(const T *f)
void defineRhoU(T rho, T *u)
Dynamics< T, DESCRIPTOR, PLATFORM > & getDynamics()
void setCellId(std::size_t iCell)
T & operator[](unsigned iPop)
void computeStress(T *pi)
Cell(ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &lattice, std::size_t iCell=0)
void setField(const FieldD< T, DESCRIPTOR, FIELD > &v)
void iniRegularized(T rho, T *u, T *pi)
void inverseShiftRhoU(T &rho, T *u)
Top level namespace for all of OpenLB.
std::uint32_t CellID
Type for sequential block-local cell indices.
Return value of any collision.
CPU specific field mirroring BlockDynamicsMap.
Virtual interface for dynamically-dispatched dynamics access on CPU targets.
virtual T computeEquilibrium(int iPop, T rho, T *u)=0
void iniEquilibrium(Cell< T, DESCRIPTOR, PLATFORM > &cell, T rho, T *u)
virtual void defineRho(Cell< T, DESCRIPTOR, PLATFORM > &cell, T &rho)=0
virtual void inverseShiftRhoU(Cell< T, DESCRIPTOR, PLATFORM > &cell, T &rho, T *u)=0
void iniRegularized(Cell< T, DESCRIPTOR, PLATFORM > &cell, T rho, T *u, T *pi)
virtual void defineU(Cell< T, DESCRIPTOR, PLATFORM > &cell, T *u)=0
virtual void computeU(Cell< T, DESCRIPTOR, PLATFORM > &cell, T *u)=0
virtual void computeStress(Cell< T, DESCRIPTOR, PLATFORM > &cell, T &rho, T *u, T *pi)=0
virtual void defineRhoU(Cell< T, DESCRIPTOR, PLATFORM > &cell, T &rho, T *u)=0
virtual void computeRhoU(Cell< T, DESCRIPTOR, PLATFORM > &cell, T &rho, T *u)=0
virtual void defineAllMomenta(Cell< T, DESCRIPTOR, PLATFORM > &cell, T &rho, T *u, T *pi)=0
virtual void computeJ(Cell< T, DESCRIPTOR, PLATFORM > &cell, T *j)=0
virtual void computeAllMomenta(Cell< T, DESCRIPTOR, PLATFORM > &cell, T &rho, T *u, T *pi)=0
virtual T getOmegaOrFallback(T fallback)=0
virtual T computeRho(Cell< T, DESCRIPTOR, PLATFORM > &cell)=0
virtual CellStatistic< T > collide(Cell< T, DESCRIPTOR, PLATFORM > &cell)=0
Base of a descriptor field of scalar TYPE with dimensions A*B + B*Q + C.