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

#include <weightForce3D.h>

+ Inheritance diagram for olb::WeightForce3D< T, PARTICLETYPE >:
+ Collaboration diagram for olb::WeightForce3D< T, PARTICLETYPE >:

Public Member Functions

 WeightForce3D (std::vector< T > direction, T g=9.81)
 
 ~WeightForce3D () override
 
void applyForce (typename std::deque< PARTICLETYPE< T > >::iterator p, int pInt, ParticleSystem3D< T, PARTICLETYPE > &psSys) override
 
- Public Member Functions inherited from olb::Force3D< T, PARTICLETYPE >
 Force3D ()
 
 Force3D (Force3D< T, PARTICLETYPE > &)
 
 Force3D (const Force3D< T, PARTICLETYPE > &)
 
virtual ~Force3D ()
 

Additional Inherited Members

- Protected Attributes inherited from olb::Force3D< T, PARTICLETYPE >
OstreamManager clout
 

Detailed Description

template<typename T, template< typename U > class PARTICLETYPE>
class olb::WeightForce3D< T, PARTICLETYPE >

Definition at line 36 of file weightForce3D.h.

Constructor & Destructor Documentation

◆ WeightForce3D()

template<typename T , template< typename U > class PARTICLETYPE>
olb::WeightForce3D< T, PARTICLETYPE >::WeightForce3D ( std::vector< T > direction,
T g = 9.81 )

Definition at line 33 of file weightForce3D.hh.

33 : Force3D<T, PARTICLETYPE>(), _direction(direction), _g(g)
34{
35 T directionNorm = util::sqrt(util::pow(_direction[0], 2.)+util::pow(_direction[1], 2.)+util::pow(_direction[2], 2.));
36 for (int i=0; i<3; ++i) {
37 _direction[i]/=directionNorm;
38 }
39}
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

References olb::util::pow(), and olb::util::sqrt().

+ Here is the call graph for this function:

◆ ~WeightForce3D()

template<typename T , template< typename U > class PARTICLETYPE>
olb::WeightForce3D< T, PARTICLETYPE >::~WeightForce3D ( )
inlineoverride

Definition at line 40 of file weightForce3D.h.

40{};

Member Function Documentation

◆ applyForce()

template<typename T , template< typename U > class PARTICLETYPE>
void olb::WeightForce3D< T, PARTICLETYPE >::applyForce ( typename std::deque< PARTICLETYPE< T > >::iterator p,
int pInt,
ParticleSystem3D< T, PARTICLETYPE > & psSys )
overridevirtual

Implements olb::Force3D< T, PARTICLETYPE >.

Definition at line 42 of file weightForce3D.hh.

43{
44 for (int j=0; j<3; ++j) {
45 p->getForce()[j] += p->getMass() * _g * _direction[j];
46 }
47}

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