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

Class for flow field. More...

#include <flow.hpp>

Public Member Functions

 FlowField (unsigned nx, unsigned ny)
 
auto & InitialPosition ()
 
auto & CurrentPosition ()
 
virtual Velocity< T, Dim > & CurrentVelocity ()
 
auto GetTime ()
 
auto GetDirection ()
 
virtual void CopyInitialPositionToCurrentPosition ()
 
void SetDelta (const T delta)
 
void SetStep (const unsigned step)
 
virtual void SetCurrentVelocity ()
 
virtual void SetDirection (const Direction direction)
 
void SetInitialTime (const T time)
 
void UpdateTime ()
 
void UpdateTime (const T time)
 
void Run ()
 

Protected Attributes

const unsigned nx_
 
const unsigned ny_
 
delta_
 
initial_time_
 
current_time_
 
unsigned step_
 
Direction direction_ = Forward
 
std::unique_ptr< Position< T,
Dim > > 
initial_pos_
 
std::unique_ptr< Position< T,
Dim > > 
current_pos_
 
std::shared_ptr< Velocity< T,
Dim > > 
current_vel_
 

Detailed Description

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

Class for flow field.

This class is used for representing flow fields, which contains many information (such as positions and velocities for all fluid particles) about the flow field.

Template Parameters
TNumeric data type of all the numeric values in the flow.
DimDimension of the flow field (2 or 3).
Inheritance diagram for LCS::FlowField< T, Dim >:
LCS::ContinuousFlowField< T, Func, Dim > LCS::DiscreteFlowField< T, Dim >

Constructor & Destructor Documentation

template<typename T, unsigned Dim>
LCS::FlowField< T, Dim >::FlowField ( unsigned  nx,
unsigned  ny 
)
inline

Constructor for initializating the flow field.

Parameters
nxThe number of grid points in $x$-direction.
nyThe number of grid points in $y$-direction.

Member Function Documentation

template<typename T, unsigned Dim>
virtual void LCS::FlowField< T, Dim >::CopyInitialPositionToCurrentPosition ( )
inlinevirtual

Copy the initial position to the current position. It is used before particle advection. The actual implementaions are in the subclasses.

Reimplemented in LCS::ContinuousFlowField< T, Func, Dim >, and LCS::DiscreteFlowField< T, Dim >.

template<typename T, unsigned Dim>
auto& LCS::FlowField< T, Dim >::CurrentPosition ( )
inline

Get the current positions of all particles.

Returns
Position field associated with the current time of the flow.
template<typename T, unsigned Dim>
virtual Velocity<T, Dim>& LCS::FlowField< T, Dim >::CurrentVelocity ( )
inlinevirtual

Get the current velocities of all particles.

Returns
Velocity field associated with the current time of the flow.

Reimplemented in LCS::ContinuousFlowField< T, Func, Dim >.

template<typename T, unsigned Dim>
auto LCS::FlowField< T, Dim >::GetDirection ( )
inline

Get the direction associated with the flow field.

Returns
Direction that shows that the flow advection is forward or backward.
template<typename T, unsigned Dim>
auto LCS::FlowField< T, Dim >::GetTime ( )
inline

Get the current time of the flow.

Returns
Current time of the flow.
template<typename T, unsigned Dim>
auto& LCS::FlowField< T, Dim >::InitialPosition ( )
inline

Get the initial positions of all particles.

Returns
Position field associated with the initial time of the flow.
template<typename T, unsigned Dim>
void LCS::FlowField< T, Dim >::Run ( )
inline

Particle advection (calculating particle trajectories).

template<typename T, unsigned Dim>
virtual void LCS::FlowField< T, Dim >::SetCurrentVelocity ( )
inlinevirtual

Set the current velocity. The actual implementations are in the subclasses.

Reimplemented in LCS::ContinuousFlowField< T, Func, Dim >, and LCS::DiscreteFlowField< T, Dim >.

template<typename T, unsigned Dim>
void LCS::FlowField< T, Dim >::SetDelta ( const T  delta)
inline

Set the time step for particle advection.

Parameters
deltaTime step for advection.
template<typename T, unsigned Dim>
virtual void LCS::FlowField< T, Dim >::SetDirection ( const Direction  direction)
inlinevirtual

Set the advection direction. The actual implementations are in the subclesses.

Parameters
directionDirection for particle advection.

Reimplemented in LCS::ContinuousFlowField< T, Func, Dim >, and LCS::DiscreteFlowField< T, Dim >.

template<typename T, unsigned Dim>
void LCS::FlowField< T, Dim >::SetInitialTime ( const T  time)
inline

Set the initial time.

Parameters
timeInitial time of calculation.
template<typename T, unsigned Dim>
void LCS::FlowField< T, Dim >::SetStep ( const unsigned  step)
inline

Set the number of steps for particle advection.

Parameters
stepNumber of total advection steps.
template<typename T, unsigned Dim>
void LCS::FlowField< T, Dim >::UpdateTime ( )
inline

Update time of the flow field using the time step.

template<typename T, unsigned Dim>
void LCS::FlowField< T, Dim >::UpdateTime ( const T  time)
inline

Update time of the flow field using the provided time.

Parameters
timeNew time for the flow field.

Member Data Documentation

template<typename T, unsigned Dim>
std::unique_ptr<Position<T, Dim> > LCS::FlowField< T, Dim >::current_pos_
protected

Pointer to the Position field at the current time.

template<typename T, unsigned Dim>
T LCS::FlowField< T, Dim >::current_time_
protected

Current time of the calculation.

template<typename T, unsigned Dim>
std::shared_ptr<Velocity<T, Dim> > LCS::FlowField< T, Dim >::current_vel_
protected

Pointer to the Velocity field at the current time.

template<typename T, unsigned Dim>
T LCS::FlowField< T, Dim >::delta_
protected

Time step for integration.

template<typename T, unsigned Dim>
Direction LCS::FlowField< T, Dim >::direction_ = Forward
protected

Direction of the calculation.

template<typename T, unsigned Dim>
std::unique_ptr<Position<T, Dim> > LCS::FlowField< T, Dim >::initial_pos_
protected

Pointer to the Position field at the initial time.

template<typename T, unsigned Dim>
T LCS::FlowField< T, Dim >::initial_time_
protected

Initial time of the calculation.

template<typename T, unsigned Dim>
const unsigned LCS::FlowField< T, Dim >::nx_
protected

The number of grid points in $x$-direction.

template<typename T, unsigned Dim>
const unsigned LCS::FlowField< T, Dim >::ny_
protected

The number of grid points in $y$-direction.

template<typename T, unsigned Dim>
unsigned LCS::FlowField< T, Dim >::step_
protected

Number of calculation steps.


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