Gyselalib++
BslAdvectionRTheta< FootFinder, Mapping > Class Template Reference

Define an advection operator on 2D \((r, \theta)\) index range. More...

Inheritance diagram for BslAdvectionRTheta< FootFinder, Mapping >:
IAdvectionRTheta

Public Member Functions

 BslAdvectionRTheta (PreallocatableSplineInterpolatorRTheta< ddc::NullExtrapolationRule > const &function_interpolator, FootFinder const &foot_finder, Mapping const &mapping)
 Instantiate an advection operator. More...
 
host_t< DFieldRTheta > operator() (host_t< DFieldRTheta > allfdistribu, host_t< DConstVectorFieldRTheta< X, Y >> advection_field_xy, double dt) const
 Allocate a Field of the advected function. More...
 
host_t< DFieldRTheta > operator() (host_t< DFieldRTheta > allfdistribu, host_t< DConstVectorFieldRTheta< R, Theta >> advection_field_rp, CoordXY const &advection_field_xy_center, double dt) const
 Allocate a Field to the advected function. More...
 

Detailed Description

template<class FootFinder, class Mapping>
class BslAdvectionRTheta< FootFinder, Mapping >

Define an advection operator on 2D \((r, \theta)\) index range.

The advection operator uses a semi-Lagrangian method. The method is based on the property that the solution is constant along the characteristics.

For the following equation: \(\partial_t f(t,x) + V(t, x) \cdot \nabla_x f(t,x) = 0, \)

we write the characteristics: \( \partial_t X(t; s, x) = V(t, X(t; s, x)), \qquad \text{ with } X(s; s, x) = x. \)

Then the property gives us: \( f(t, x) = f(0, X(t; 0, x)), \quad \forall t. \)

So the first step of the advection operator is to compute the characteristic feet \( X(t; t+dt, x_i) \) for each mesh point \( x_i \).

For the second step, we interpolate the function at the characteristic feet computed, and obtain the function at the next time step: \( f(t + dt, x) = f(t, X(t + dt; t, x))\).

Different time integration methods are implemented to solve the characteristic equation. They are defined in the IFootFinder class.

The feet can be advected on different domains. Theses domains are defined in the AdvectionDomain class.

The interpolation of the function is always done in the logical index range.

See also
IFootFinder
AdvectionDomain

Constructor & Destructor Documentation

◆ BslAdvectionRTheta()

template<class FootFinder , class Mapping >
BslAdvectionRTheta< FootFinder, Mapping >::BslAdvectionRTheta ( PreallocatableSplineInterpolatorRTheta< ddc::NullExtrapolationRule > const &  function_interpolator,
FootFinder const &  foot_finder,
Mapping const &  mapping 
)
inline

Instantiate an advection operator.

Parameters
[in]function_interpolatorThe polar interpolator to interpolate the function once the characteristic computed.
[in]foot_finderAn IFootFinder which computes the characteristic feet.
[in]mappingThe mapping function from the logical index range to the physical index range.
Template Parameters
IFootFinderA child class of IFootFinder.

Member Function Documentation

◆ operator()() [1/2]

template<class FootFinder , class Mapping >
host_t<DFieldRTheta> BslAdvectionRTheta< FootFinder, Mapping >::operator() ( host_t< DFieldRTheta >  allfdistribu,
host_t< DConstVectorFieldRTheta< X, Y >>  advection_field_xy,
double  dt 
) const
inlinevirtual

Allocate a Field of the advected function.

Parameters
[in,out]allfdistribuA Field containing the values of the function we want to advect.
[in]advection_field_xyA DConstVectorFieldRTheta containing the values of the advection field on the physical index range axes.
[in]dtA time step used.
Returns
A Field to allfdistribu advected on the time step given.

Implements IAdvectionRTheta.

◆ operator()() [2/2]

template<class FootFinder , class Mapping >
host_t<DFieldRTheta> BslAdvectionRTheta< FootFinder, Mapping >::operator() ( host_t< DFieldRTheta >  allfdistribu,
host_t< DConstVectorFieldRTheta< R, Theta >>  advection_field_rp,
CoordXY const &  advection_field_xy_center,
double  dt 
) const
inlinevirtual

Allocate a Field to the advected function.

Parameters
[in,out]allfdistribuA Field containing the values of the function we want to advect.
[in]advection_field_rpA DConstVectorFieldRTheta containing the values of the advection field on the logical index range axis.
[in]advection_field_xy_centerA CoordXY containing the value of the advection field on the physical index range axis at the O-point.
[in]dtA time step used.
Returns
A Field to allfdistribu advected on the time step given.

Implements IAdvectionRTheta.


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