Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
fub::FluxMethod< BaseMethod > Class Template Reference

This class applies a base flux nethod on a view of states. More...

#include <FluxMethod.hpp>

Public Types

using Equation = meta::Equation< const BaseMethod & >
 
using Complete = ::fub::Complete< Equation >
 
using Conservative = ::fub::Conservative< Equation >
 
using CompleteArray = ::fub::CompleteArray< Equation >
 
using ConservativeArray = ::fub::ConservativeArray< Equation >
 

Public Member Functions

 FluxMethod ()=default
 
 ~FluxMethod ()=default
 
 FluxMethod (const FluxMethod &)=default
 
 FluxMethod (FluxMethod &&)=default
 
FluxMethodoperator= (const FluxMethod &)=default
 
FluxMethodoperator= (FluxMethod &&)=default
 
template<typename... Args>
 FluxMethod (Args &&... args)
 
const BaseMethod & Base () const noexcept
 Returns the Implementation class which will be used to compute single fluxes. More...
 
BaseMethod & Base () noexcept
 Returns the Implementation class which will be used to compute single fluxes. More...
 
void ComputeNumericFluxes (const View< Conservative > &fluxes, const View< const Complete > &states, Duration dt, double dx, Direction dir)
 This function computes numerical fluxes. More...
 
void ComputeNumericFluxes (execution::SequentialTag, const View< Conservative > &fluxes, const View< const Complete > &states, Duration dt, double dx, Direction dir)
 This function computes numerical fluxes. More...
 
void ComputeNumericFluxes (execution::SimdTag, const View< Conservative > &fluxes, const View< const Complete > &states, Duration dt, double dx, Direction dir)
 This function computes numerical fluxes. More...
 
void ComputeNumericFluxes (execution::OpenMpTag, const View< Conservative > &fluxes, const View< const Complete > &states, Duration dt, double dx, Direction dir)
 This function computes numerical fluxes. More...
 
void ComputeNumericFluxes (execution::OpenMpSimdTag, const View< Conservative > &fluxes, const View< const Complete > &states, Duration dt, double dx, Direction dir)
 This function computes numerical fluxes. More...
 
double ComputeStableDt (const View< const Complete > &states, double dx, Direction dir)
 This function computes a time step size such that no signal will leave any cell covered by this view. More...
 
double ComputeStableDt (execution::SequentialTag, const View< const Complete > &states, double dx, Direction dir)
 This function computes a time step size such that no signal will leave any cell covered by this view. More...
 
double ComputeStableDt (execution::SimdTag, const View< const Complete > &states, double dx, Direction dir)
 This function computes a time step size such that no signal will leave any cell covered by this view. More...
 
double ComputeStableDt (execution::OpenMpTag, const View< const Complete > &states, double dx, Direction dir)
 This function computes a time step size such that no signal will leave any cell covered by this view. More...
 
double ComputeStableDt (execution::OpenMpSimdTag, const View< const Complete > &states, double dx, Direction dir)
 This function computes a time step size such that no signal will leave any cell covered by this view. More...
 

Static Public Member Functions

static constexpr int GetStencilWidth () noexcept
 Returns the stencil width of this flux method. More...
 
static constexpr int GetStencilSize () noexcept
 Returns the number of elements in a stencil of this flux method. More...
 

Public Attributes

std::array< Complete, StencilSizestencil_
 
Conservative numeric_flux_
 
std::array< CompleteArray, StencilSizestencil_array_
 
ConservativeArray numeric_flux_array_
 

Static Public Attributes

static constexpr int Rank
 
static constexpr std::size_t StencilSize
 Returns the number of elements in a stencil of this flux method (std::size_t version). More...
 

Detailed Description

template<typename BaseMethod>
class fub::FluxMethod< BaseMethod >

This class applies a base flux nethod on a view of states.

The base class only needs to define its logic on single states or state arrays instead of on a multi dimensional arrray. By using this class the developer does not need to repeat the logic which might involve iterating through all indices of a patch, loading the states and applying the base method.

There are in total two strategies implemented, a cell-wise and a simdified one. The sequential strategy is easier to debug but less performant. The simd version does use the spatial grid index. This class also assumes that base class does not use the local coordinates.

Member Typedef Documentation

◆ Complete

template<typename BaseMethod >
using fub::FluxMethod< BaseMethod >::Complete = ::fub::Complete<Equation>

◆ CompleteArray

template<typename BaseMethod >
using fub::FluxMethod< BaseMethod >::CompleteArray = ::fub::CompleteArray<Equation>

◆ Conservative

template<typename BaseMethod >
using fub::FluxMethod< BaseMethod >::Conservative = ::fub::Conservative<Equation>

◆ ConservativeArray

template<typename BaseMethod >
using fub::FluxMethod< BaseMethod >::ConservativeArray = ::fub::ConservativeArray<Equation>

◆ Equation

template<typename BaseMethod >
using fub::FluxMethod< BaseMethod >::Equation = meta::Equation<const BaseMethod&>

Constructor & Destructor Documentation

◆ FluxMethod() [1/4]

template<typename BaseMethod >
fub::FluxMethod< BaseMethod >::FluxMethod ( )
default

◆ ~FluxMethod()

template<typename BaseMethod >
fub::FluxMethod< BaseMethod >::~FluxMethod ( )
default

◆ FluxMethod() [2/4]

template<typename BaseMethod >
fub::FluxMethod< BaseMethod >::FluxMethod ( const FluxMethod< BaseMethod > &  )
default

◆ FluxMethod() [3/4]

template<typename BaseMethod >
fub::FluxMethod< BaseMethod >::FluxMethod ( FluxMethod< BaseMethod > &&  )
default

◆ FluxMethod() [4/4]

template<typename BaseMethod >
template<typename... Args>
fub::FluxMethod< BaseMethod >::FluxMethod ( Args &&...  args)

Member Function Documentation

◆ Base() [1/2]

template<typename BaseMethod >
const BaseMethod& fub::FluxMethod< BaseMethod >::Base ( ) const
noexcept

Returns the Implementation class which will be used to compute single fluxes.

◆ Base() [2/2]

template<typename BaseMethod >
BaseMethod& fub::FluxMethod< BaseMethod >::Base ( )
noexcept

Returns the Implementation class which will be used to compute single fluxes.

◆ ComputeNumericFluxes() [1/5]

template<typename BaseMethod >
void fub::FluxMethod< BaseMethod >::ComputeNumericFluxes ( const View< Conservative > &  fluxes,
const View< const Complete > &  states,
Duration  dt,
double  dx,
Direction  dir 
)

This function computes numerical fluxes.

Parameters
[out]fluxesThe destination view where numeric fluxes will be stored at.
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dtThe time step size which will be used to compute the numerical flux.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeNumericFluxes() [2/5]

template<typename BaseMethod >
void fub::FluxMethod< BaseMethod >::ComputeNumericFluxes ( execution::OpenMpSimdTag  ,
const View< Conservative > &  fluxes,
const View< const Complete > &  states,
Duration  dt,
double  dx,
Direction  dir 
)

This function computes numerical fluxes.

Parameters
[out]fluxesThe destination view where numeric fluxes will be stored at.
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dtThe time step size which will be used to compute the numerical flux.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeNumericFluxes() [3/5]

template<typename BaseMethod >
void fub::FluxMethod< BaseMethod >::ComputeNumericFluxes ( execution::OpenMpTag  ,
const View< Conservative > &  fluxes,
const View< const Complete > &  states,
Duration  dt,
double  dx,
Direction  dir 
)

This function computes numerical fluxes.

Parameters
[out]fluxesThe destination view where numeric fluxes will be stored at.
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dtThe time step size which will be used to compute the numerical flux.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeNumericFluxes() [4/5]

template<typename BaseMethod >
void fub::FluxMethod< BaseMethod >::ComputeNumericFluxes ( execution::SequentialTag  ,
const View< Conservative > &  fluxes,
const View< const Complete > &  states,
Duration  dt,
double  dx,
Direction  dir 
)

This function computes numerical fluxes.

Parameters
[out]fluxesThe destination view where numeric fluxes will be stored at.
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dtThe time step size which will be used to compute the numerical flux.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeNumericFluxes() [5/5]

template<typename BaseMethod >
void fub::FluxMethod< BaseMethod >::ComputeNumericFluxes ( execution::SimdTag  ,
const View< Conservative > &  fluxes,
const View< const Complete > &  states,
Duration  dt,
double  dx,
Direction  dir 
)

This function computes numerical fluxes.

Parameters
[out]fluxesThe destination view where numeric fluxes will be stored at.
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dtThe time step size which will be used to compute the numerical flux.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeStableDt() [1/5]

template<typename BaseMethod >
double fub::FluxMethod< BaseMethod >::ComputeStableDt ( const View< const Complete > &  states,
double  dx,
Direction  dir 
)

This function computes a time step size such that no signal will leave any cell covered by this view.

Parameters
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeStableDt() [2/5]

template<typename BaseMethod >
double fub::FluxMethod< BaseMethod >::ComputeStableDt ( execution::OpenMpSimdTag  ,
const View< const Complete > &  states,
double  dx,
Direction  dir 
)

This function computes a time step size such that no signal will leave any cell covered by this view.

Parameters
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeStableDt() [3/5]

template<typename BaseMethod >
double fub::FluxMethod< BaseMethod >::ComputeStableDt ( execution::OpenMpTag  ,
const View< const Complete > &  states,
double  dx,
Direction  dir 
)

This function computes a time step size such that no signal will leave any cell covered by this view.

Parameters
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeStableDt() [4/5]

template<typename BaseMethod >
double fub::FluxMethod< BaseMethod >::ComputeStableDt ( execution::SequentialTag  ,
const View< const Complete > &  states,
double  dx,
Direction  dir 
)

This function computes a time step size such that no signal will leave any cell covered by this view.

Parameters
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ ComputeStableDt() [5/5]

template<typename BaseMethod >
double fub::FluxMethod< BaseMethod >::ComputeStableDt ( execution::SimdTag  ,
const View< const Complete > &  states,
double  dx,
Direction  dir 
)

This function computes a time step size such that no signal will leave any cell covered by this view.

Parameters
[in]statesA view over cell states which will be used to fill the stencil for this method.
[in]dirThe direction parameter specifies which directional flux method to use.
[in]dxThe cell width size which will be used to compute the numerical flux.

◆ GetStencilSize()

template<typename BaseMethod >
constexpr int fub::FluxMethod< BaseMethod >::GetStencilSize
staticconstexprnoexcept

Returns the number of elements in a stencil of this flux method.

◆ GetStencilWidth()

template<typename BaseMethod >
constexpr int fub::FluxMethod< BaseMethod >::GetStencilWidth
staticconstexprnoexcept

Returns the stencil width of this flux method.

◆ operator=() [1/2]

template<typename BaseMethod >
FluxMethod& fub::FluxMethod< BaseMethod >::operator= ( const FluxMethod< BaseMethod > &  )
default

◆ operator=() [2/2]

template<typename BaseMethod >
FluxMethod& fub::FluxMethod< BaseMethod >::operator= ( FluxMethod< BaseMethod > &&  )
default

Member Data Documentation

◆ numeric_flux_

template<typename BaseMethod >
Conservative fub::FluxMethod< BaseMethod >::numeric_flux_

◆ numeric_flux_array_

template<typename BaseMethod >
ConservativeArray fub::FluxMethod< BaseMethod >::numeric_flux_array_

◆ Rank

template<typename BaseMethod >
constexpr int fub::FluxMethod< BaseMethod >::Rank
staticconstexpr

◆ stencil_

template<typename BaseMethod >
std::array<Complete, StencilSize> fub::FluxMethod< BaseMethod >::stencil_

◆ stencil_array_

template<typename BaseMethod >
std::array<CompleteArray, StencilSize> fub::FluxMethod< BaseMethod >::stencil_array_

◆ StencilSize

template<typename BaseMethod >
constexpr std::size_t fub::FluxMethod< BaseMethod >::StencilSize
staticconstexpr

Returns the number of elements in a stencil of this flux method (std::size_t version).


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