OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::SuperLatticeParticleForce< T, DESCRIPTOR, PARTICLETYPE, BLOCKFUNCTOR > Class Template Referencefinal

Functor that returns forces acting on a particle surface, returns data in output for every particle in a row(described are return values for the first particle). More...

#include <latticeMomentumExchangeForce.h>

+ Inheritance diagram for olb::SuperLatticeParticleForce< T, DESCRIPTOR, PARTICLETYPE, BLOCKFUNCTOR >:
+ Collaboration diagram for olb::SuperLatticeParticleForce< T, DESCRIPTOR, PARTICLETYPE, BLOCKFUNCTOR >:

Public Member Functions

 SuperLatticeParticleForce (SuperLattice< T, DESCRIPTOR > &sLattice, const SuperGeometry< T, DESCRIPTOR::d > &superGeometry, particles::ParticleSystem< T, PARTICLETYPE > &particleSystem, const UnitConverter< T, DESCRIPTOR > &converter, Vector< bool, DESCRIPTOR::d > periodic=Vector< bool, DESCRIPTOR::d >(false), std::size_t iP0=0, const std::unordered_set< int > &ignoredMaterials=std::unordered_set< int >{}, const F f=[](auto &, const auto &, const auto &, const auto &){})
 
bool operator() (T output[], const int input[]) override
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename PARTICLETYPE, typename BLOCKFUNCTOR = BlockLatticeMomentumExchangeForce<T,DESCRIPTOR,PARTICLETYPE>>
class olb::SuperLatticeParticleForce< T, DESCRIPTOR, PARTICLETYPE, BLOCKFUNCTOR >

Functor that returns forces acting on a particle surface, returns data in output for every particle in a row(described are return values for the first particle).

Returns
output[0]-output[2] translational force - physical units
output[3]-output[5] torque - physical units
output[7] number of voxels

Definition at line 88 of file latticeMomentumExchangeForce.h.

Constructor & Destructor Documentation

◆ SuperLatticeParticleForce()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename BLOCKFUNCTOR >
olb::SuperLatticeParticleForce< T, DESCRIPTOR, PARTICLETYPE, BLOCKFUNCTOR >::SuperLatticeParticleForce ( SuperLattice< T, DESCRIPTOR > & sLattice,
const SuperGeometry< T, DESCRIPTOR::d > & superGeometry,
particles::ParticleSystem< T, PARTICLETYPE > & particleSystem,
const UnitConverter< T, DESCRIPTOR > & converter,
Vector< bool, DESCRIPTOR::d > periodic = Vector<bool,DESCRIPTOR::d> (false),
std::size_t iP0 = 0,
const std::unordered_set< int > & ignoredMaterials = std::unordered_set<int>{},
const F f = [](auto&, const auto&, const auto&, const auto&){} )

Definition at line 35 of file latticeMomentumExchangeForce.hh.

42 : SuperLatticePhysF<T,DESCRIPTOR>(sLattice,converter,
43 (DESCRIPTOR::d+utilities::dimensions::convert<DESCRIPTOR::d>::rotation+1)*(particleSystem.size()-iP0))
44{
45 constexpr unsigned D = DESCRIPTOR::d;
46
47 this->getName() = "physParticleForce";
48 int maxC = this->_sLattice.getLoadBalancer().size();
49 this->_blockF.reserve(maxC);
50 const PhysR<T,D> min = particles::communication::getCuboidMin<T,D>(
51 superGeometry.getCuboidGeometry());
52 const PhysR<T,D> max = particles::communication::getCuboidMax<T,D>(
53 superGeometry.getCuboidGeometry(), min);
54
55 for (int iC = 0; iC < maxC; ++iC) {
56 this->_blockF.emplace_back( new BLOCKFUNCTOR(
57 this->_sLattice.getBlock(iC),
58 superGeometry.getBlockGeometry(iC),
59 particleSystem, converter, min, max,
60 periodic, iP0, ignoredMaterials, f));
61 }
62}
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.
Pack< T > min(Pack< T > rhs, Pack< T > lhs)
Definition 256.h:406
Pack< T > max(Pack< T > rhs, Pack< T > lhs)
Definition 256.h:416

References olb::SuperGeometry< T, D >::getBlockGeometry(), and olb::SuperStructure< T, D >::getCuboidGeometry().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename BLOCKFUNCTOR >
bool olb::SuperLatticeParticleForce< T, DESCRIPTOR, PARTICLETYPE, BLOCKFUNCTOR >::operator() ( T output[],
const int input[] )
override

Definition at line 65 of file latticeMomentumExchangeForce.hh.

67{
68 for (int iS=0; iS<this->getTargetDim(); ++iS) {
69 output[iS] = 0.;
70 }
71 for (int iC = 0; iC < this->_sLattice.getLoadBalancer().size(); ++iC) {
72 this->getBlockF(iC)(output, &input[1]);
73 }
74
75#ifdef PARALLEL_MODE_MPI
76 for (int iS = 0; iS < this->getTargetDim(); ++iS) {
77 singleton::mpi().reduceAndBcast(output[iS], MPI_SUM);
78 }
79#endif
80 return true;
81
82}
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
MpiManager & mpi()

References olb::singleton::mpi(), and olb::singleton::MpiManager::reduceAndBcast().

+ Here is the call graph for this function:

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