LCS::Velocity< T, Dim > Class Template Reference

Field of particle velocities. More...

#include <field.hpp>

Public Types

using vec = LCS::Vector< T, Dim >
 

Public Member Functions

 Velocity (unsigned nx, unsigned ny, Position< T, Dim > &pos)
 
auto Get (const unsigned i, const unsigned j) const
 
auto & GetPosition ()
 
void InterpolateFrom (Velocity< T, Dim > &ref_vel)
 
- Public Member Functions inherited from LCS::Field< T, Dim, Dim >
 Field (unsigned nx, unsigned ny)
 
auto & GetAll () const
 
auto GetTime () const
 
void ReadFromFile (const std::string &file_name)
 
void SetAll (Tensor< Vector< T, Size >, Dim > &data)
 
void UpdateTime (const T time)
 
void WriteToFile (const std::string &file_name) const
 

Protected Attributes

Position< T, Dim > & pos_
 
- Protected Attributes inherited from LCS::Field< T, Dim, Dim >
const unsigned nx_
 
const unsigned ny_
 
Tensor< Vector< T, Size >, Dim > data_
 
time_
 

Detailed Description

template<typename T, unsigned Dim>
class LCS::Velocity< T, Dim >

Field of particle velocities.

This class is used for representing velocities of particles. It is a subclass of Field. A Position field is associated with each Velocity field.

Template Parameters
TNumeric data type of the field.
DimDimension of the field (2 or 3).
Inheritance diagram for LCS::Velocity< T, Dim >:
LCS::Field< T, Dim, Dim > LCS::ContinuousVelocity< T, Func, Dim >

Constructor & Destructor Documentation

template<typename T, unsigned Dim>
LCS::Velocity< T, Dim >::Velocity ( unsigned  nx,
unsigned  ny,
Position< T, Dim > &  pos 
)
inline

Constructor for initializating the velocity field.

Parameters
nxThe number of points in $x$-direction.
nyThe number of points in $y$-direction.
posThe Position field that associated with the Velocity field.

Member Function Documentation

template<typename T, unsigned Dim>
auto LCS::Velocity< T, Dim >::Get ( const unsigned  i,
const unsigned  j 
) const
inline

Get the velocities of a grid point.

Parameters
iIndex in $x$-coordinate.
jIndex in $y$-coordinate.
Returns
Tuple contains $x$- and $y$-coordinates of a given grid point.
template<typename T, unsigned Dim>
auto& LCS::Velocity< T, Dim >::GetPosition ( )
inline

Get the Position field that associated with the Velocity field.

Returns
Position field for this Velocity field.
template<typename T, unsigned Dim>
void LCS::Velocity< T, Dim >::InterpolateFrom ( Velocity< T, Dim > &  ref_vel)
inline

Interploate another Velocity field to set the velocities of this field.

Parameters
ref_velThe reference Velocity field.

Member Data Documentation

template<typename T, unsigned Dim>
Position<T, Dim>& LCS::Velocity< T, Dim >::pos_
protected

Position field associated with this Velocity field


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