Plugins
Loading...
Searching...
No Matches
ug::LevelSet::FV1LevelSetDisc< TGridFunction > Class Template Reference

#include <level_set.h>

Public Member Functions

bool advect_lsf (TGridFunction &uNew, TGridFunction &u)
 computes the time steps of the discretization of the level-set equation
 
bool compute_ddnormal (TGridFunction &ddnormal, TGridFunction &dnormal, TGridFunction &vx, TGridFunction &vy, TGridFunction &phi, TGridFunction &u)
 
bool compute_dnormal (TGridFunction &dnormal, TGridFunction &vx, TGridFunction &vy, TGridFunction &phi, TGridFunction &u)
 
bool compute_error (TGridFunction &numsol)
 computes error w.r.t. the analytical solution (taken from the dirichlet bc)
 
bool compute_normal (TGridFunction &vx, TGridFunction &vy, TGridFunction &u)
 
void create_ls_subsets (TGridFunction &phi)
 
 FV1LevelSetDisc ()
 Constructor.
 
number get_time ()
 
bool init_ls_subsets (TGridFunction &phi)
 subset handling methods:
 
bool overwrite (TGridFunction &, number, TGridFunction &, int)
 
bool overwrite (TGridFunction &, TGridFunction &, TGridFunction &, int)
 
bool runtimetest (TGridFunction &u)
 
void set_delta (number delta)
 
bool set_dirichlet_boundary (TGridFunction &uNew, const char *subsets)
 boundary condition subset handling
 
void set_dirichlet_data (number val)
 
void set_dirichlet_data (SmartPtr< CplUserData< number, dim > > d)
 
void set_divfree (bool b)
 
void set_dt (number deltaT)
 set time step
 
void set_elements_active (int sign)
 
void set_elements_active (int signi, int signj)
 
void set_elements_active (int signi, int signj, int signk)
 
void set_elements_inactive (int sign)
 
void set_elements_inactive (int signi, int signj)
 
void set_elements_inactive (int signi, int signj, int signk)
 
void set_gamma (number gamma)
 
void set_info (bool b)
 
void set_limiter (bool b)
 
void set_nodes_active (int sign)
 
void set_nodes_active (int signi, int signj)
 
void set_nodes_active (int signi, int signj, int signk)
 
void set_nodes_inactive (int sign)
 
void set_nodes_inactive (int signi, int signj)
 
void set_nodes_inactive (int signi, int signj, int signk)
 
void set_nr_of_steps (size_t n)
 set nr of time steps to perform in advect_lsf (default is 1)
 
bool set_outflow_boundary (TGridFunction &uNew, const char *subsets)
 
void set_reinit (size_t n)
 
void set_source (number val)
 
void set_source (SmartPtr< CplUserData< number, dim > > user)
 
void set_time (number t)
 
void set_timestep_nr (size_t n)
 
void set_velocity (number vel_x)
 
void set_velocity (number vel_x, number vel_y)
 
void set_velocity (number vel_x, number vel_y, number vel_z)
 
void set_velocity (SmartPtr< CplUserData< MathVector< dim >, dim > > user)
 
bool update_ls_subsets (TGridFunction &phi)
 
 ~FV1LevelSetDisc ()
 Destructor.
 

Protected Member Functions

template<typename TElem >
bool assemble_element (TElem &elem, DimFV1Geometry< dim > &geo, grid_type &grid, TGridFunction &uNew, const TGridFunction &uOld, aaGrad &aaGradient, aaVol &aaVolume)
 
bool assign_dirichlet (TGridFunction &)
 
bool calculate_vertex_grad_vol (TGridFunction &u, aaGrad &aaGradient, aaVol &aaVolume)
 
bool calculate_vertex_grad_vol_sign (TGridFunction &, aaGrad &, aaVol &, TGridFunction &, int)
 
bool calculate_vertex_vol (TGridFunction &u, aaVol &aaVolVolume)
 fills the scvVolume attachment for all element types
 
bool limit_grad (TGridFunction &uOld, aaGrad &aaGradient)
 

Private Types

typedef Grid::VertexAttachmentAccessor< Attachment< MathVector< dim > > > aaGrad
 type of gradient attachment
 
typedef Grid::VertexAttachmentAccessor< Attachment< number > > aaVol
 type of volume-size attachment
 
typedef TGridFunction::algebra_type algebra_type
 algebra type
 
typedef TGridFunction::domain_type domain_type
 domain type
 
typedef TGridFunction::template traits< Edge >::const_iterator EdgeConstIterator
 edge iterator
 
typedef TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
 grid element iterator
 
typedef TGridFunction::template dim_traits< dim >::grid_base_object ElemType
 type of base grid object
 
typedef domain_type::grid_type grid_type
 grid type
 
typedef domain_type::position_accessor_type position_accessor_type
 type of the position accessor
 
typedef TGridFunction::template traits< Vertex >::const_iterator VertexConstIterator
 vertex base iterator
 

Private Attributes

number m_delta
 
SubsetGroup m_dirichlet_sg
 
bool m_divFree
 
number m_dt
 
number m_gamma
 
SmartPtr< CplUserData< number, dim > > m_imDirichlet
 Data import for the Dirichlet values.
 
SmartPtr< CplUserData< number, dim > > m_imSource
 Data import for the right-hand side.
 
SmartPtr< CplUserData< MathVector< dim >, dim > > m_imVelocity
 Data import for the Velocity field.
 
SubsetGroup m_inactive_sg
 
int m_inside_elements_si
 
int m_inside_nodes_si
 
size_t m_limiter
 
number m_maxCFL
 
SubsetGroup m_neumann_sg
 
size_t m_nrOfSteps
 
int m_onls_elements_si
 
int m_onls_nodes_si
 
int m_outside_elements_si
 
int m_outside_nodes_si
 
bool m_print
 
number m_time
 
size_t m_timestep_nr
 

Static Private Attributes

static const int dim = domain_type::dim
 world dimension
 

Member Typedef Documentation

◆ aaGrad

template<typename TGridFunction >
typedef Grid::VertexAttachmentAccessor<Attachment<MathVector<dim> > > ug::LevelSet::FV1LevelSetDisc< TGridFunction >::aaGrad
private

type of gradient attachment

◆ aaVol

template<typename TGridFunction >
typedef Grid::VertexAttachmentAccessor<Attachment<number> > ug::LevelSet::FV1LevelSetDisc< TGridFunction >::aaVol
private

type of volume-size attachment

◆ algebra_type

template<typename TGridFunction >
typedef TGridFunction::algebra_type ug::LevelSet::FV1LevelSetDisc< TGridFunction >::algebra_type
private

algebra type

◆ domain_type

template<typename TGridFunction >
typedef TGridFunction::domain_type ug::LevelSet::FV1LevelSetDisc< TGridFunction >::domain_type
private

domain type

◆ EdgeConstIterator

template<typename TGridFunction >
typedef TGridFunction::template traits<Edge>::const_iterator ug::LevelSet::FV1LevelSetDisc< TGridFunction >::EdgeConstIterator
private

edge iterator

◆ ElemIterator

template<typename TGridFunction >
typedef TGridFunction::template dim_traits<dim>::const_iterator ug::LevelSet::FV1LevelSetDisc< TGridFunction >::ElemIterator
private

grid element iterator

◆ ElemType

template<typename TGridFunction >
typedef TGridFunction::template dim_traits<dim>::grid_base_object ug::LevelSet::FV1LevelSetDisc< TGridFunction >::ElemType
private

type of base grid object

◆ grid_type

template<typename TGridFunction >
typedef domain_type::grid_type ug::LevelSet::FV1LevelSetDisc< TGridFunction >::grid_type
private

grid type

◆ position_accessor_type

template<typename TGridFunction >
typedef domain_type::position_accessor_type ug::LevelSet::FV1LevelSetDisc< TGridFunction >::position_accessor_type
private

type of the position accessor

◆ VertexConstIterator

template<typename TGridFunction >
typedef TGridFunction::template traits<Vertex>::const_iterator ug::LevelSet::FV1LevelSetDisc< TGridFunction >::VertexConstIterator
private

vertex base iterator

Constructor & Destructor Documentation

◆ FV1LevelSetDisc()

template<typename TGridFunction >
ug::LevelSet::FV1LevelSetDisc< TGridFunction >::FV1LevelSetDisc ( )
inline

◆ ~FV1LevelSetDisc()

template<typename TGridFunction >
ug::LevelSet::FV1LevelSetDisc< TGridFunction >::~FV1LevelSetDisc ( )
inline

Destructor.

Member Function Documentation

◆ advect_lsf()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::advect_lsf ( TGridFunction &  uNew,
TGridFunction &  uOld 
)

computes the time steps of the discretization of the level-set equation

Computes the time steps of the discretization of the level-set equation.

Main function for assembling and solving ls equation as described in Frolkovic/Mikula, HIGH-RESOLUTION FLUX-BASED LEVEL SET METHOD, SIAM

References ug::DimFV1Geometry< int TDim, int TWorldDim >::add_boundary_subset(), ug::DoFRef(), grid(), ug::SetAttachmentValues(), UG_LOG, and ug::VecAssign().

◆ assemble_element()

template<typename TGridFunction >
template<typename TElem >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::assemble_element ( TElem &  elem,
DimFV1Geometry< dim > &  geo,
grid_type grid,
TGridFunction &  uNew,
const TGridFunction &  uOld,
aaGrad aaGradient,
aaVol aaVolume 
)
protected

◆ assign_dirichlet()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::assign_dirichlet ( TGridFunction &  numsol)
protected

sets Dirichlet values in solution vector for vertices in a given subset

References ug::DoFRef(), and UG_LOG.

◆ calculate_vertex_grad_vol()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::calculate_vertex_grad_vol ( TGridFunction &  u,
aaGrad aaGradient,
aaVol aaVolume 
)
protected

◆ calculate_vertex_grad_vol_sign()

◆ calculate_vertex_vol()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::calculate_vertex_vol ( TGridFunction &  u,
aaVol aaVolume 
)
protected

◆ compute_ddnormal()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::compute_ddnormal ( TGridFunction &  ddnormal,
TGridFunction &  dnormal,
TGridFunction &  vx,
TGridFunction &  vy,
TGridFunction &  phi,
TGridFunction &  u 
)

UG_LOG("#\n");

References ug::DoFRef(), grid(), ug::SetAttachmentValues(), and UG_LOG.

◆ compute_dnormal()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::compute_dnormal ( TGridFunction &  dnormal,
TGridFunction &  vx,
TGridFunction &  vy,
TGridFunction &  phi,
TGridFunction &  u 
)

◆ compute_error()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::compute_error ( TGridFunction &  numsol)

computes error w.r.t. the analytical solution (taken from the dirichlet bc)

computes error w.r.t. the analytical solution (taken from the dirichlet bc)

This is used in test cases.

References ug::DoFRef(), grid(), ug::SetAttachmentValues(), and UG_LOG.

◆ compute_normal()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::compute_normal ( TGridFunction &  vx,
TGridFunction &  vy,
TGridFunction &  u 
)

◆ create_ls_subsets()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::create_ls_subsets ( TGridFunction &  phi)

References UG_LOG.

◆ get_time()

template<typename TGridFunction >
number ug::LevelSet::FV1LevelSetDisc< TGridFunction >::get_time ( )
inline

◆ init_ls_subsets()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::init_ls_subsets ( TGridFunction &  phi)

subset handling methods:

◆ limit_grad()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::limit_grad ( TGridFunction &  uOld,
aaGrad aaGrad 
)
protected

limit previously computed gradient so that the control-volume-wise linear interpolation function does not introduce new maxima or minima into the data

References ug::DoFRef(), grid(), ug::VecAppend(), ug::VecScaleAdd(), ug::VecSubtract(), and ug::EdgeVertices::vertex().

◆ overwrite() [1/2]

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::overwrite ( TGridFunction &  unew,
number  value,
TGridFunction &  phi,
int  sign 
)

References ug::DoFRef().

◆ overwrite() [2/2]

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::overwrite ( TGridFunction &  unew,
TGridFunction &  uold,
TGridFunction &  phi,
int  sign 
)

References ug::DoFRef().

◆ runtimetest()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::runtimetest ( TGridFunction &  u)

◆ set_delta()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_delta ( number  delta)
inline

◆ set_dirichlet_boundary()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_dirichlet_boundary ( TGridFunction &  uNew,
const char *  subsets 
)
inline

boundary condition subset handling

References ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_dirichlet_sg, and UG_CATCH_THROW.

◆ set_dirichlet_data() [1/2]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_dirichlet_data ( number  val)
inline

◆ set_dirichlet_data() [2/2]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_dirichlet_data ( SmartPtr< CplUserData< number, dim > >  d)
inline

◆ set_divfree()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_divfree ( bool  b)
inline

◆ set_dt()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_dt ( number  deltaT)
inline

◆ set_elements_active() [1/3]

◆ set_elements_active() [2/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_elements_active ( int  signi,
int  signj 
)
inline

◆ set_elements_active() [3/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_elements_active ( int  signi,
int  signj,
int  signk 
)
inline

◆ set_elements_inactive() [1/3]

◆ set_elements_inactive() [2/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_elements_inactive ( int  signi,
int  signj 
)
inline

◆ set_elements_inactive() [3/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_elements_inactive ( int  signi,
int  signj,
int  signk 
)
inline

◆ set_gamma()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_gamma ( number  gamma)
inline

◆ set_info()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_info ( bool  b)
inline

◆ set_limiter()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_limiter ( bool  b)
inline

◆ set_nodes_active() [1/3]

◆ set_nodes_active() [2/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_nodes_active ( int  signi,
int  signj 
)
inline

◆ set_nodes_active() [3/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_nodes_active ( int  signi,
int  signj,
int  signk 
)
inline

◆ set_nodes_inactive() [1/3]

◆ set_nodes_inactive() [2/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_nodes_inactive ( int  signi,
int  signj 
)
inline

◆ set_nodes_inactive() [3/3]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_nodes_inactive ( int  signi,
int  signj,
int  signk 
)
inline

◆ set_nr_of_steps()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_nr_of_steps ( size_t  n)
inline

set nr of time steps to perform in advect_lsf (default is 1)

References ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_nrOfSteps.

◆ set_outflow_boundary()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_outflow_boundary ( TGridFunction &  uNew,
const char *  subsets 
)
inline

◆ set_reinit()

◆ set_source() [1/2]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_source ( number  val)
inline

◆ set_source() [2/2]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_source ( SmartPtr< CplUserData< number, dim > >  user)
inline

◆ set_time()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_time ( number  t)
inline

◆ set_timestep_nr()

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_timestep_nr ( size_t  n)
inline

◆ set_velocity() [1/4]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_velocity ( number  vel_x)
inline

◆ set_velocity() [2/4]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_velocity ( number  vel_x,
number  vel_y 
)
inline

◆ set_velocity() [3/4]

template<typename TGridFunction >
void ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_velocity ( number  vel_x,
number  vel_y,
number  vel_z 
)
inline

◆ set_velocity() [4/4]

◆ update_ls_subsets()

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::update_ls_subsets ( TGridFunction &  phi)

References ug::DoFRef(), num_subsets(), and UG_LOG.

Member Data Documentation

◆ dim

◆ m_delta

◆ m_dirichlet_sg

template<typename TGridFunction >
SubsetGroup ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_dirichlet_sg
private

◆ m_divFree

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_divFree
private

◆ m_dt

template<typename TGridFunction >
number ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_dt
private

◆ m_gamma

◆ m_imDirichlet

template<typename TGridFunction >
SmartPtr<CplUserData<number,dim> > ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_imDirichlet
private

Data import for the Dirichlet values.

Referenced by ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_dirichlet_data().

◆ m_imSource

template<typename TGridFunction >
SmartPtr<CplUserData<number,dim> > ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_imSource
private

Data import for the right-hand side.

Referenced by ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_source().

◆ m_imVelocity

template<typename TGridFunction >
SmartPtr<CplUserData<MathVector<dim>, dim> > ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_imVelocity
private

Data import for the Velocity field.

Referenced by ug::LevelSet::FV1LevelSetDisc< TGridFunction >::set_velocity().

◆ m_inactive_sg

◆ m_inside_elements_si

◆ m_inside_nodes_si

◆ m_limiter

template<typename TGridFunction >
size_t ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_limiter
private

◆ m_maxCFL

template<typename TGridFunction >
number ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_maxCFL
private

◆ m_neumann_sg

template<typename TGridFunction >
SubsetGroup ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_neumann_sg
private

◆ m_nrOfSteps

template<typename TGridFunction >
size_t ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_nrOfSteps
private

◆ m_onls_elements_si

◆ m_onls_nodes_si

◆ m_outside_elements_si

◆ m_outside_nodes_si

◆ m_print

template<typename TGridFunction >
bool ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_print
private

◆ m_time

◆ m_timestep_nr

template<typename TGridFunction >
size_t ug::LevelSet::FV1LevelSetDisc< TGridFunction >::m_timestep_nr
private

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