OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::cpu::Cell< T, DESCRIPTOR, PLATFORM > Class Template Reference

Cell concept for concrete block lattices on CPU platforms. More...

#include <cell.h>

+ Collaboration diagram for olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >:

Public Types

using value_t = T
 
using descriptor_t = DESCRIPTOR
 

Public Member Functions

 Cell ()
 
 Cell (ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &lattice, std::size_t iCell=0)
 
CellID getCellId () const
 
void setCellId (CellID iCell)
 
void setLatticeR (LatticeR< DESCRIPTOR::d > latticeR)
 
bool isPadding () const
 
T & operator[] (unsigned iPop)
 
template<typename FIELD >
auto getField () const
 
template<typename FIELD >
void setField (const FieldD< T, DESCRIPTOR, FIELD > &v)
 
template<typename FIELD >
auto getFieldPointer ()
 
template<typename FIELD >
auto & getFieldComponent (unsigned iD)
 
Cell< T, DESCRIPTOR, PLATFORM > neighbor (LatticeR< DESCRIPTOR::d > offset)
 
Dynamics< T, DESCRIPTOR, PLATFORM > & getDynamics ()
 
computeRho ()
 
void computeU (T *u)
 
void computeJ (T *j)
 
void computeRhoU (T &rho, T *u)
 
void computeStress (T *pi)
 
void computeAllMomenta (T &rho, T *u, T *pi)
 
void defineRho (T &rho)
 
void defineU (T *u)
 
void defineRhoU (T rho, T *u)
 
void defineAllMomenta (T rho, T *u, T *pi)
 
void definePopulations (const T *f)
 
void iniEquilibrium (T rho, T *u)
 
void iniRegularized (T rho, T *u, T *pi)
 
void inverseShiftRhoU (T &rho, T *u)
 

Detailed Description

template<typename T, typename DESCRIPTOR, Platform PLATFORM>
class olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >

Cell concept for concrete block lattices on CPU platforms.

Used for generic operators and non-legacy post processors

Definition at line 141 of file cell.h.

Member Typedef Documentation

◆ descriptor_t

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
using olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::descriptor_t = DESCRIPTOR

Definition at line 148 of file cell.h.

◆ value_t

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
using olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::value_t = T

Definition at line 147 of file cell.h.

Constructor & Destructor Documentation

◆ Cell() [1/2]

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::Cell ( )
inline

Definition at line 150 of file cell.h.

150 :
151 _lattice(nullptr),
152 _iCell(0) { }

◆ Cell() [2/2]

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::Cell ( ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > & lattice,
std::size_t iCell = 0 )
inline

Definition at line 154 of file cell.h.

154 :
155 _lattice(&lattice),
156 _iCell(iCell) { }

Member Function Documentation

◆ computeAllMomenta()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::computeAllMomenta ( T & rho,
T * u,
T * pi )
inline

Definition at line 223 of file cell.h.

223 {
224 getDynamics().computeAllMomenta(*this, rho, u, pi);
225 }
Dynamics< T, DESCRIPTOR, PLATFORM > & getDynamics()
Definition cell.h:202

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ computeJ()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::computeJ ( T * j)
inline

Definition at line 212 of file cell.h.

212 {
213 getDynamics().computeJ(*this, j);
214 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ computeRho()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
T olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::computeRho ( )
inline

Definition at line 206 of file cell.h.

206 {
207 return getDynamics().computeRho(*this);
208 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ computeRhoU()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::computeRhoU ( T & rho,
T * u )
inline

Definition at line 215 of file cell.h.

215 {
216 getDynamics().computeRhoU(*this, rho, u);
217 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ computeStress()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::computeStress ( T * pi)
inline

Definition at line 218 of file cell.h.

218 {
219 T rho, u[DESCRIPTOR::d] { };
220 getDynamics().computeRhoU(*this, rho, u);
221 getDynamics().computeStress(*this, rho, u, pi);
222 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ computeU()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::computeU ( T * u)
inline

Definition at line 209 of file cell.h.

209 {
210 getDynamics().computeU(*this, u);
211 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ defineAllMomenta()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::defineAllMomenta ( T rho,
T * u,
T * pi )
inline

Definition at line 236 of file cell.h.

236 {
237 getDynamics().defineAllMomenta(*this, rho, u, pi);
238 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ definePopulations()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::definePopulations ( const T * f)
inline

Definition at line 239 of file cell.h.

239 {
240 for (int iPop=0; iPop < descriptors::q<DESCRIPTOR>(); ++iPop) {
241 operator[](iPop) = f[iPop];
242 }
243 }
T & operator[](unsigned iPop)
Definition cell.h:174

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::operator[]().

+ Here is the call graph for this function:

◆ defineRho()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::defineRho ( T & rho)
inline

Definition at line 227 of file cell.h.

227 {
228 getDynamics().defineRho(*this, rho);
229 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ defineRhoU()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::defineRhoU ( T rho,
T * u )
inline

Definition at line 233 of file cell.h.

233 {
234 getDynamics().defineRhoU(*this, rho, u);
235 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ defineU()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::defineU ( T * u)
inline

Definition at line 230 of file cell.h.

230 {
231 getDynamics().defineU(*this, u);
232 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ getCellId()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
CellID olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getCellId ( ) const
inline

Definition at line 158 of file cell.h.

158 {
159 return _iCell;
160 }

◆ getDynamics()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
Dynamics< T, DESCRIPTOR, PLATFORM > & olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics ( )
inline

Definition at line 202 of file cell.h.

202 {
204 }
auto & getFieldComponent(unsigned iD)
Definition cell.h:194

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getFieldComponent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getField()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
template<typename FIELD >
auto olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getField ( ) const
inline

Definition at line 179 of file cell.h.

179 {
180 return _lattice->template getField<FIELD>().getRow(_iCell);
181 }
auto getField() const
Definition cell.h:179

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFieldComponent()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
template<typename FIELD >
auto & olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getFieldComponent ( unsigned iD)
inline

Definition at line 194 of file cell.h.

194 {
195 return _lattice->template getField<FIELD>()[iD][_iCell];
196 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFieldPointer()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
template<typename FIELD >
auto olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getFieldPointer ( )
inline

Definition at line 189 of file cell.h.

189 {
190 return _lattice->template getField<FIELD>().getRowPointer(_iCell);
191 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getField().

+ Here is the call graph for this function:

◆ iniEquilibrium()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::iniEquilibrium ( T rho,
T * u )
inline

Definition at line 245 of file cell.h.

245 {
246 getDynamics().iniEquilibrium(*this, rho, u);
247 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ iniRegularized()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::iniRegularized ( T rho,
T * u,
T * pi )
inline

Definition at line 248 of file cell.h.

248 {
249 getDynamics().iniRegularized(*this, rho, u, pi);
250 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ inverseShiftRhoU()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::inverseShiftRhoU ( T & rho,
T * u )
inline

Definition at line 251 of file cell.h.

251 {
252 getDynamics().inverseShiftRhoU(*this, rho, u);
253 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getDynamics().

+ Here is the call graph for this function:

◆ isPadding()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
bool olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::isPadding ( ) const
inline

Definition at line 170 of file cell.h.

170 {
171 return _lattice->isPadding(_iCell);
172 }

References olb::BlockStructureD< D >::isPadding().

+ Here is the call graph for this function:

◆ neighbor()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
Cell< T, DESCRIPTOR, PLATFORM > olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::neighbor ( LatticeR< DESCRIPTOR::d > offset)
inline

Definition at line 198 of file cell.h.

198 {
199 return {*_lattice, static_cast<std::size_t>(_iCell + _lattice->getNeighborDistance(offset))};
200 }

References olb::BlockStructureD< D >::getNeighborDistance().

+ Here is the call graph for this function:

◆ operator[]()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
T & olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::operator[] ( unsigned iPop)
inline

Definition at line 174 of file cell.h.

174 {
175 return _lattice->template getField<descriptors::POPULATION>()[iPop][_iCell];
176 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCellId()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::setCellId ( CellID iCell)
inline

Definition at line 162 of file cell.h.

162 {
163 _iCell = iCell;
164 }
+ Here is the caller graph for this function:

◆ setField()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
template<typename FIELD >
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::setField ( const FieldD< T, DESCRIPTOR, FIELD > & v)
inline

Definition at line 184 of file cell.h.

184 {
185 return _lattice->template getField<FIELD>().setRow(_iCell, v);
186 }

References olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::getField().

+ Here is the call graph for this function:

◆ setLatticeR()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::setLatticeR ( LatticeR< DESCRIPTOR::d > latticeR)
inline

Definition at line 166 of file cell.h.

166 {
167 _iCell = _lattice->getCellId(latticeR);
168 }

References olb::BlockStructureD< D >::getCellId().

+ Here is the call graph for this function:

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