OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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 (std::size_t iCell)
 
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 87 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 94 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 93 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 96 of file cell.h.

96 :
97 _lattice(nullptr),
98 _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 100 of file cell.h.

100 :
101 _lattice(&lattice),
102 _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 161 of file cell.h.

161 {
162 getDynamics().computeAllMomenta(*this, rho, u, pi);
163 }
Dynamics< T, DESCRIPTOR, PLATFORM > & getDynamics()
Definition cell.h:140

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 150 of file cell.h.

150 {
151 getDynamics().computeJ(*this, j);
152 }

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 144 of file cell.h.

144 {
145 return getDynamics().computeRho(*this);
146 }

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 153 of file cell.h.

153 {
154 getDynamics().computeRhoU(*this, rho, u);
155 }

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 156 of file cell.h.

156 {
157 T rho, u[DESCRIPTOR::d] { };
158 getDynamics().computeRhoU(*this, rho, u);
159 getDynamics().computeStress(*this, rho, u, pi);
160 }

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 147 of file cell.h.

147 {
148 getDynamics().computeU(*this, u);
149 }

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 174 of file cell.h.

174 {
175 getDynamics().defineAllMomenta(*this, rho, u, pi);
176 }

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 177 of file cell.h.

177 {
178 for (int iPop=0; iPop < descriptors::q<DESCRIPTOR>(); ++iPop) {
179 operator[](iPop) = f[iPop];
180 }
181 }
T & operator[](unsigned iPop)
Definition cell.h:112

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 165 of file cell.h.

165 {
166 getDynamics().defineRho(*this, rho);
167 }

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 171 of file cell.h.

171 {
172 getDynamics().defineRhoU(*this, rho, u);
173 }

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 168 of file cell.h.

168 {
169 getDynamics().defineU(*this, u);
170 }

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 104 of file cell.h.

104 {
105 return _iCell;
106 }
+ Here is the caller graph for this function:

◆ getDynamics()

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

Definition at line 140 of file cell.h.

140 {
141 return *getFieldComponent<DYNAMICS<T,DESCRIPTOR,PLATFORM>>(0);
142 }
+ 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 117 of file cell.h.

117 {
118 return _lattice->template getField<FIELD>().getRow(_iCell);
119 }

◆ 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 132 of file cell.h.

132 {
133 return _lattice->template getField<FIELD>()[iD][_iCell];
134 }

◆ getFieldPointer()

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

Definition at line 127 of file cell.h.

127 {
128 return _lattice->template getField<FIELD>().getRowPointer(_iCell);
129 }

◆ iniEquilibrium()

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

Definition at line 183 of file cell.h.

183 {
184 getDynamics().iniEquilibrium(*this, rho, u);
185 }

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 186 of file cell.h.

186 {
187 getDynamics().iniRegularized(*this, rho, u, pi);
188 }

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 189 of file cell.h.

189 {
190 getDynamics().inverseShiftRhoU(*this, rho, u);
191 }

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

+ 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 136 of file cell.h.

136 {
137 return {*_lattice, _iCell + _lattice->getNeighborDistance(offset)};
138 }
CellDistance getNeighborDistance(LatticeR< D > dir) const
Get 1D neighbor distance.

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 112 of file cell.h.

112 {
113 return _lattice->template getField<descriptors::POPULATION>()[iPop][_iCell];
114 }
+ Here is the caller graph for this function:

◆ setCellId()

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

Definition at line 108 of file cell.h.

108 {
109 _iCell = iCell;
110 }
+ 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 122 of file cell.h.

122 {
123 return _lattice->template getField<FIELD>().setRow(_iCell, v);
124 }

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