ViennaLS
Loading...
Searching...
No Matches
viennals::Advect< T, D > Class Template Reference

This class is used to advance level sets over time. Level sets are passed to the constructor in an std::vector, with the last element being the level set to advect, or "top level set", while the others are then adjusted afterwards. In order to ensure that advection works correctly, the "top level set" has to include all lower level sets: LS_top = LS_top U LS_i for i = {0 ... n}, where n is the number of level sets. The velocities used to advect the level set are given in a concrete implementation of the lsVelocityField (check Advection examples for guidance) More...

#include <lsAdvect.hpp>

Public Member Functions

 Advect ()
 
 Advect (SmartPointer< Domain< T, D > > passedlsDomain)
 
 Advect (SmartPointer< Domain< T, D > > passedlsDomain, SmartPointer< VelocityField< T > > passedVelocities)
 
 Advect (std::vector< SmartPointer< Domain< T, D > > > passedlsDomains, SmartPointer< VelocityField< T > > passedVelocities)
 
void insertNextLevelSet (SmartPointer< Domain< T, D > > passedlsDomain)
 Pushes the passed level set to the back of the list of level sets used for advection.
 
void setVelocityField (SmartPointer< VelocityField< T > > passedVelocities)
 Set the velocity field used for advection. This should be a concrete implementation of lsVelocityField.
 
void setAdvectionTime (double time)
 Set the time until when the level set should be advected. If this takes more than one advection step, multiple will be performed. Defaults to 0, which means one advection step with the maximum time step possible according to the CFL condition(see setTimeStepRatio) will be performed.
 
void setSingleStep (bool singleStep)
 If set to true, only a single advection step will be performed, even if the advection time set with setAdvectionTime(double) would require several steps to pass. Defaults to false.
 
void setTimeStepRatio (const double &cfl)
 Set the CFL condition to use during advection. The CFL condition sets the maximum distance a surface can be moved during one advection step. It MUST be below 0.5 to guarantee numerical stability. Defaults to 0.4999.
 
void setCalculateNormalVectors (bool cnv)
 Set whether normal vectors should be calculated at each level set point. Defaults to true. If normal vectors are not required for velocity calculation, this can be set to false, in order to increase computational efficiency.
 
void setIgnoreVoids (bool iV)
 Set whether level set values, which are not part of the "top" geometrically connected part of values, should be advected. The "top" part is identified by the most positive part in the lowest dimension with INFINITE boundary conditions. Defaults to false. If set to true, only the "top" values will be advected. All others values are not changed.
 
void setSaveAdvectionVelocities (bool sAV)
 Set whether the velocities applied to each point should be saved in the level set for debug purposes.
 
double getAdvectedTime ()
 Get by how much the physical time was advanced during the last apply() call.
 
unsigned getNumberOfTimeSteps ()
 Get how many advection steps were performed during the last apply() call.
 
double getTimeStepRatio ()
 Get the value of the CFL number.
 
bool getCalculateNormalVectors ()
 Get whether normal vectors were caluclated.
 
void setIntegrationScheme (IntegrationSchemeEnum scheme)
 Set which integration scheme should be used out of the ones specified in IntegrationSchemeEnum.
 
void setDissipationAlpha (const double &a)
 Set the alpha dissipation coefficient. For lsLaxFriedrichs, this is used as the alpha value. For all other LaxFriedrichs schemes it is used as a scaling factor for the calculated alpha values.
 
void setUpdatePointData (bool update)
 Set whether the point data in the old LS should be translated to the advected LS. Defaults to true.
 
void prepareLS ()
 
void apply ()
 Perform the advection.
 

Static Public Attributes

static constexpr char velocityLabel [] = "AdvectionVelocities"
 

Detailed Description

template<class T, int D>
class viennals::Advect< T, D >

This class is used to advance level sets over time. Level sets are passed to the constructor in an std::vector, with the last element being the level set to advect, or "top level set", while the others are then adjusted afterwards. In order to ensure that advection works correctly, the "top level set" has to include all lower level sets: LS_top = LS_top U LS_i for i = {0 ... n}, where n is the number of level sets. The velocities used to advect the level set are given in a concrete implementation of the lsVelocityField (check Advection examples for guidance)

Constructor & Destructor Documentation

◆ Advect() [1/4]

template<class T , int D>
viennals::Advect< T, D >::Advect ( )
inline

◆ Advect() [2/4]

template<class T , int D>
viennals::Advect< T, D >::Advect ( SmartPointer< Domain< T, D > > passedlsDomain)
inline

◆ Advect() [3/4]

template<class T , int D>
viennals::Advect< T, D >::Advect ( SmartPointer< Domain< T, D > > passedlsDomain,
SmartPointer< VelocityField< T > > passedVelocities )
inline

◆ Advect() [4/4]

template<class T , int D>
viennals::Advect< T, D >::Advect ( std::vector< SmartPointer< Domain< T, D > > > passedlsDomains,
SmartPointer< VelocityField< T > > passedVelocities )
inline

Member Function Documentation

◆ apply()

template<class T , int D>
void viennals::Advect< T, D >::apply ( )
inline

Perform the advection.

◆ getAdvectedTime()

template<class T , int D>
double viennals::Advect< T, D >::getAdvectedTime ( )
inline

Get by how much the physical time was advanced during the last apply() call.

◆ getCalculateNormalVectors()

template<class T , int D>
bool viennals::Advect< T, D >::getCalculateNormalVectors ( )
inline

Get whether normal vectors were caluclated.

◆ getNumberOfTimeSteps()

template<class T , int D>
unsigned viennals::Advect< T, D >::getNumberOfTimeSteps ( )
inline

Get how many advection steps were performed during the last apply() call.

◆ getTimeStepRatio()

template<class T , int D>
double viennals::Advect< T, D >::getTimeStepRatio ( )
inline

Get the value of the CFL number.

◆ insertNextLevelSet()

template<class T , int D>
void viennals::Advect< T, D >::insertNextLevelSet ( SmartPointer< Domain< T, D > > passedlsDomain)
inline

Pushes the passed level set to the back of the list of level sets used for advection.

◆ prepareLS()

template<class T , int D>
void viennals::Advect< T, D >::prepareLS ( )
inline

◆ setAdvectionTime()

template<class T , int D>
void viennals::Advect< T, D >::setAdvectionTime ( double time)
inline

Set the time until when the level set should be advected. If this takes more than one advection step, multiple will be performed. Defaults to 0, which means one advection step with the maximum time step possible according to the CFL condition(see setTimeStepRatio) will be performed.

◆ setCalculateNormalVectors()

template<class T , int D>
void viennals::Advect< T, D >::setCalculateNormalVectors ( bool cnv)
inline

Set whether normal vectors should be calculated at each level set point. Defaults to true. If normal vectors are not required for velocity calculation, this can be set to false, in order to increase computational efficiency.

◆ setDissipationAlpha()

template<class T , int D>
void viennals::Advect< T, D >::setDissipationAlpha ( const double & a)
inline

Set the alpha dissipation coefficient. For lsLaxFriedrichs, this is used as the alpha value. For all other LaxFriedrichs schemes it is used as a scaling factor for the calculated alpha values.

◆ setIgnoreVoids()

template<class T , int D>
void viennals::Advect< T, D >::setIgnoreVoids ( bool iV)
inline

Set whether level set values, which are not part of the "top" geometrically connected part of values, should be advected. The "top" part is identified by the most positive part in the lowest dimension with INFINITE boundary conditions. Defaults to false. If set to true, only the "top" values will be advected. All others values are not changed.

◆ setIntegrationScheme()

template<class T , int D>
void viennals::Advect< T, D >::setIntegrationScheme ( IntegrationSchemeEnum scheme)
inline

Set which integration scheme should be used out of the ones specified in IntegrationSchemeEnum.

◆ setSaveAdvectionVelocities()

template<class T , int D>
void viennals::Advect< T, D >::setSaveAdvectionVelocities ( bool sAV)
inline

Set whether the velocities applied to each point should be saved in the level set for debug purposes.

◆ setSingleStep()

template<class T , int D>
void viennals::Advect< T, D >::setSingleStep ( bool singleStep)
inline

If set to true, only a single advection step will be performed, even if the advection time set with setAdvectionTime(double) would require several steps to pass. Defaults to false.

◆ setTimeStepRatio()

template<class T , int D>
void viennals::Advect< T, D >::setTimeStepRatio ( const double & cfl)
inline

Set the CFL condition to use during advection. The CFL condition sets the maximum distance a surface can be moved during one advection step. It MUST be below 0.5 to guarantee numerical stability. Defaults to 0.4999.

◆ setUpdatePointData()

template<class T , int D>
void viennals::Advect< T, D >::setUpdatePointData ( bool update)
inline

Set whether the point data in the old LS should be translated to the advected LS. Defaults to true.

◆ setVelocityField()

template<class T , int D>
void viennals::Advect< T, D >::setVelocityField ( SmartPointer< VelocityField< T > > passedVelocities)
inline

Set the velocity field used for advection. This should be a concrete implementation of lsVelocityField.

Member Data Documentation

◆ velocityLabel

template<class T , int D>
char viennals::Advect< T, D >::velocityLabel[] = "AdvectionVelocities"
staticconstexpr

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