25#ifndef LATTICE_PHYS_EXTERNAL_PARTICLE_VELOCITY_3D_HH
26#define LATTICE_PHYS_EXTERNAL_PARTICLE_VELOCITY_3D_HH
44template<
typename T,
typename DESCRIPTOR>
49 this->
getName() =
"ExtPartVelField";
60template<
typename T,
typename DESCRIPTOR>
62 T output[],
const int input[])
64 auto& load = this->_sLattice.getLoadBalancer();
65 const int& globIC = input[0];
68 return this->getBlockF(load.loc(globIC))(output, input+1);
75template <
typename T,
typename DESCRIPTOR>
80 this->
getName() =
"ExtParticleVelocityField";
83template <
typename T,
typename DESCRIPTOR>
86 auto velocity_numerator = this->blockLattice.get(input).template getFieldPointer<descriptors::VELOCITY_NUMERATOR>();
87 auto velocity_denominator = this->blockLattice.get(input).template getFieldPointer<descriptors::VELOCITY_DENOMINATOR>();
89 if (velocity_denominator[0] > std::numeric_limits<T>::epsilon()) {
90 output[0]=this->_converter.getPhysVelocity(velocity_numerator[0]/velocity_denominator[0]);
91 output[1]=this->_converter.getPhysVelocity(velocity_numerator[1]/velocity_denominator[0]);
92 output[2]=this->_converter.getPhysVelocity(velocity_numerator[2]/velocity_denominator[0]);
95 output[0]=this->_converter.getPhysVelocity(velocity_numerator[0]);
96 output[1]=this->_converter.getPhysVelocity(velocity_numerator[1]);
97 output[2]=this->_converter.getPhysVelocity(velocity_numerator[2]);
BlockLatticePhysExternalParticleVelocity3D(BlockLattice< T, DESCRIPTOR > &blockLattice, const UnitConverter< T, DESCRIPTOR > &converter)
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
represents all functors that operate on a DESCRIPTOR with output in Phys, e.g. physVelocity(),...
Platform-abstracted block lattice for external access and inter-block interaction.
std::string & getName()
read and write access to name
std::vector< std::unique_ptr< BlockF3D< T > > > _blockF
Super functors may consist of several BlockF3D<W> derived functors.
bool operator()(T output[], const int input[])
SuperLatticePhysExternalParticleVelocity3D(SuperLattice< T, DESCRIPTOR > &blockLattice, const UnitConverter< T, DESCRIPTOR > &converter)
represents all functors that operate on a DESCRIPTOR with output in Phys, e.g. physVelocity(),...
Super class maintaining block lattices for a cuboid decomposition.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
Conversion between physical and lattice units, as well as discretization.
int getRank() const
Returns the process ID.
Wrapper functions that simplify the use of MPI.
Top level namespace for all of OpenLB.
Representation of a parallel 2D geometry – header file.