41template<
typename T>
struct CellStatistic;
42template<
typename T>
class LatticeStatistics;
43template<
typename T,
typename DESCRIPTOR>
struct Dynamics;
44template<
typename T,
typename DESCRIPTOR>
class BlockLattice;
45template<
typename T,
typename DESCRIPTOR>
class Cell;
52template<
typename T,
typename DESCRIPTOR>
110 template <
typename FIELD>
113 template <
typename FIELD>
116 template <
typename FIELD>
117 auto getField(FIELD field = FIELD())
const;
123 template <
typename FIELD>
128 void computeU(T u[descriptors::d<DESCRIPTOR>()])
const;
130 void computeJ(T j[descriptors::d<DESCRIPTOR>()])
const;
134 void computeRhoU(T& rho, T u[descriptors::d<DESCRIPTOR>()])
const;
136 void computeFeq(T fEq[descriptors::q<DESCRIPTOR>()])
const;
138 void computeFneq(T fNeq[descriptors::q<DESCRIPTOR>()])
const;
141 T& rho, T u[descriptors::d<DESCRIPTOR>()],
147template<
typename T,
typename DESCRIPTOR>
164 template <
typename FIELD>
168 template <
typename FIELD>
171 template <
typename FIELD>
172 std::enable_if_t<(DESCRIPTOR::template size<FIELD>() == 1),
void>
173 setField(
typename FIELD::template value_type<T> value);
175 template <
typename FIELD>
176 void setFieldComponent(
unsigned iD,
typename FIELD::template value_type<T> value);
190 void defineU(
const T u[descriptors::d<DESCRIPTOR>()]);
192 void defineRhoU(T rho,
const T u[descriptors::d<DESCRIPTOR>()]);
196 void iniEquilibrium(T rho,
const T u[descriptors::d<DESCRIPTOR>()]);
Platform-abstracted block lattice for external access and inter-block interaction.
Highest-level interface to Cell data.
auto getFieldPointer(FIELD field=FIELD())
Return field accessor.
CellStatistic< T > collide()
Apply LB collision to the cell according to local dynamics.
void setField(const FieldD< T, DESCRIPTOR, FIELD > &field)
Set value of FIELD from a vector.
void definePopulations(const T *f_)
Define particle populations through the dynamics object.
Cell(BlockLattice< T, DESCRIPTOR > &block, std::size_t iCell)
Dynamics< T, DESCRIPTOR > * getDynamics()
Get a pointer to the dynamics.
void setFieldComponent(unsigned iD, typename FIELD::template value_type< T > value)
Cell< T, DESCRIPTOR > neighbor(Vector< int, DESCRIPTOR::d > c)
void defineU(const T u[descriptors::d< DESCRIPTOR >()])
Set fluid velocity on the cell.
void defineRho(T rho)
Set density on the cell.
void revert()
Revert ("bounce-back") the distribution functions.
T & operator[](unsigned iPop)
Read-write access to distribution functions.
void defineRhoU(T rho, const T u[descriptors::d< DESCRIPTOR >()])
Define fluid velocity and particle density on the cell.
void iniRegularized(T rho, const T u[descriptors::d< DESCRIPTOR >()], const T pi[util::TensorVal< DESCRIPTOR >::n])
Initialize all f values with local equilibrium and non equilibrium part.
void iniEquilibrium(T rho, const T u[descriptors::d< DESCRIPTOR >()])
Initialize all f values to their local equilibrium.
Highest-level interface to read-only Cell data.
BlockLattice< T, DESCRIPTOR > & _block
Underlying BlockLattice.
bool operator<=(ConstCell< T, DESCRIPTOR > &rhs) const
bool operator!=(ConstCell< T, DESCRIPTOR > &rhs) const
void computeJ(T j[descriptors::d< DESCRIPTOR >()]) const
Compute fluid momentum (j = rho * u) on the cell.
bool operator<(ConstCell< T, DESCRIPTOR > &rhs) const
bool operator==(ConstCell< T, DESCRIPTOR > &rhs) const
ConstCell< T, DESCRIPTOR > neighbor(Vector< int, DESCRIPTOR::d > c) const
void computeFeq(T fEq[descriptors::q< DESCRIPTOR >()]) const
Compute equilibrium part of cell distribution.
void computeAllMomenta(T &rho, T u[descriptors::d< DESCRIPTOR >()], T pi[util::TensorVal< DESCRIPTOR >::n]) const
Compute all momenta on the celll, up to second order.
T operator[](unsigned iPop) const
Read-only access to distribution functions.
T computeRho() const
Compute particle density on the cell.
std::size_t _iCell
Memory ID of currently represented cell.
void setCellId(std::size_t iCell)
Jump to arbitrary cell memory ID.
void computeFneq(T fNeq[descriptors::q< DESCRIPTOR >()]) const
Compute non-equilibrium part of cell distribution.
Vector< T *, DESCRIPTOR::q > _populations
Pointers to population values of current cell.
auto getFieldPointer(FIELD field=FIELD()) const
Return read-only field accessor.
const Dynamics< T, DESCRIPTOR > * getDynamics() const
Get a pointer to the dynamics.
void computeField(T *data) const
Copy FIELD content to given memory location.
void computeRhoU(T &rho, T u[descriptors::d< DESCRIPTOR >()]) const
Compute fluid velocity and particle density on the cell.
ConstCell(const BlockLattice< T, DESCRIPTOR > &block, std::size_t iCell)
auto getFieldComponent(unsigned iD) const
Return copy of field component.
void computeU(T u[descriptors::d< DESCRIPTOR >()]) const
Compute fluid velocity on the cell.
auto getField(FIELD field=FIELD()) const
Return copy of descriptor-declared FIELD as a vector.
std::size_t getCellId() const
Return memory ID of the currently represented cell.
void computeStress(T pi[util::TensorVal< DESCRIPTOR >::n]) const
Compute components of the stress tensor on the cell.
Top level namespace for all of OpenLB.
Return value of any collision.
Interface for per-cell dynamics.
Compute number of elements of a symmetric d-dimensional tensor.
Set of functions commonly used in LB computations – header file.