36#ifndef __H__UG__PLUGINS__LEVEL_SET__HR_FB_LSM_DISCR_H__
37#define __H__UG__PLUGINS__LEVEL_SET__HR_FB_LSM_DISCR_H__
86template<
typename TGr
idFunction>
97 static const int dim = domain_type::dim;
121 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
ElemType;
130 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
476 TGridFunction * pLSF = NULL,
510 TGridFunction& numsol
Definition hrfblsm_discr.h:89
void set_vel_potential(SmartPtr< TGridFunction > spVelPot)
set the potential for the computation of the velocity
Definition hrfblsm_discr.h:178
static const int dim
world dimension
Definition hrfblsm_discr.h:97
number m_source_pos
Values of the source for the positive and negative values of the LSF. (If no LSF, only the former is ...
Definition hrfblsm_discr.h:556
void set_velocity(SmartPtr< CplUserData< MathVector< dim >, dim > > vel)
set velocity vector field
Definition hrfblsm_discr.h:234
void compare_lsf_with(SmartPtr< TGridFunction > spLSF2, number eps)
compare the solution with a given level-set function
Definition hrfblsm_discr_impl.h:2055
void assign_dirichlet(TGridFunction &numsol)
assign Dirichlet values
Definition hrfblsm_discr_impl.h:1101
void set_solutions(SmartPtr< TGridFunction > uOld, SmartPtr< TGridFunction > uNew)
set the grid functions for the old and new solutions
Definition hrfblsm_discr.h:163
number m_delta
scaling factor for the gradient of the potential in the velocity (if it is used for the velocity)
Definition hrfblsm_discr.h:537
void set_delta(number delta)
set scaling factor for the gradient in the velocity (if it is used for the velocity)
Definition hrfblsm_discr.h:207
void sol_update(bool redOrder, const MathVector< dim > &ip, const MathVector< dim > &x_up, number u_up, const MathVector< dim > &grad_up, const MathVector< dim > &vel_up, const MathVector< dim > &x_down, number u_down, const MathVector< dim > &grad_down, const MathVector< dim > &vel_down, number &corr_up, number &curr_down, number &src_up, number &src_down)
computes the scvf-update of the solution in an element
Definition hrfblsm_discr_impl.h:166
void set_dt(number dt)
set time step
Definition hrfblsm_discr.h:181
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
grid element iterator
Definition hrfblsm_discr.h:130
bool m_limiter
whether to use the slope limiter
Definition hrfblsm_discr.h:545
void assemble_element(ElemType *elem, DimFV1Geometry< dim > &geo, domain_type &grid, LocalVector &uOld, t_aaGrad &aaGradient, t_aaGrad &aaVelGrad, t_aaVol &aaVolume, int sign, t_aaUpd &aaUpdate, t_aaUpd *aaSrc)
assemble local contributions of one element
Definition hrfblsm_discr_impl.h:348
int assemble_cut_element(ElemType *elem, DimFV1Geometry< dim > &geo, domain_type &domain, LocalVector &uOld, LocalVector &locLSF, LocalVector &locVelPot, t_aaGrad &aaGradient, t_aaGrad &aaVelGrad, t_aaVol &aaVolume, t_aaUpd &aaUpdate, t_aaUpd *aaSrc, CplUserData< number, dim > *if_val_data, int si)
assemble an element intersected by the interface
Definition hrfblsm_discr_impl.h:619
bool m_elem_vel_vec
for the normal velocity, take the elem.-centered velocity
Definition hrfblsm_discr.h:543
number get_time()
get the current time argument
Definition hrfblsm_discr.h:199
SmartPtr< TGridFunction > m_oldSol
solution at the old time step
Definition hrfblsm_discr.h:517
void set_source_pos(number val)
set the source only for the subdomain with the positive values of the LSF
Definition hrfblsm_discr.h:231
void compute_vertex_grad(TGridFunction &u, DimFV1Geometry< dim > &geo, t_aaVol &aaVolume, ADimVector &aGradient, t_aaGrad &aaGradient, TGridFunction *pLSF=NULL, CplUserData< number, dim > *if_val_data=NULL)
compute gradients and volumes
Definition hrfblsm_discr_impl.h:984
void set_time(number t)
set the time argument
Definition hrfblsm_discr.h:197
void set_dirichlet_boundary(const char *subsets)
boundary condition subset handling: dirichlet boundary
Definition hrfblsm_discr_impl.h:2017
TGridFunction::template traits< Edge >::const_iterator EdgeConstIterator
edge iterator
Definition hrfblsm_discr.h:124
number m_gamma
scaling factor for the user-given velocity (if it is given by the user data)
Definition hrfblsm_discr.h:536
void get_bf_vel_on_if(DimFV1Geometry< dim > &geo, const typename DimFV1Geometry< dim >::BF &bf, number u[], MathVector< dim > grad[], number lsf[], MathVector< dim > &co_vel, number &flux)
get the velocity for a given BF in an element intersected by the interface
Definition hrfblsm_discr_impl.h:576
void set_source(number val)
set a constant source term (both the values)
Definition hrfblsm_discr.h:225
void prepare_for_SDF(SmartPtr< TGridFunction > uOld, SmartPtr< TGridFunction > uNew)
prerapre the object for the computation of the SDF
Definition hrfblsm_discr.h:271
Grid::VertexAttachmentAccessor< ANumber > t_aaUpd
type of the attachment accessor for the updates
Definition hrfblsm_discr.h:115
number m_maxCFL
max. allowed Courant number in a time step
Definition hrfblsm_discr.h:533
void set_elem_vel_vec(bool b)
sets the interpretation of the vector velocity
Definition hrfblsm_discr.h:219
Attachment< MathVector< dim > > ADimVector
type of gradient attachment
Definition hrfblsm_discr.h:106
SmartPtr< TGridFunction > m_spVelPot
vert.-centred potential for the computation of the velocity (or SPNULL)
Definition hrfblsm_discr.h:522
number m_time
current time
Definition hrfblsm_discr.h:560
bool m_divFree
if the velocity field is divergence free
Definition hrfblsm_discr.h:538
void set_gamma(number gamma)
set scaling factor for the user-given velocity (if it is given by the user data)
Definition hrfblsm_discr.h:204
number get_dt()
get time step
Definition hrfblsm_discr.h:184
SmartPtr< CplUserData< number, dim > > m_imNormalVel
data import for the normal velocity field (if used)
Definition hrfblsm_discr.h:551
void advect()
computes the time steps of the discretization of the level-set equation
Definition hrfblsm_discr_impl.h:1343
void compute_volumes(TGridFunction &u, DimFV1Geometry< dim > &geo, ANumber &aVolume, t_aaVol &aaVolume)
compute CV volumes
Definition hrfblsm_discr_impl.h:865
static const size_t maxNumIP
Definition hrfblsm_discr.h:134
SubsetGroup m_dirichlet_sg
subsets with the Dirichlet BC
Definition hrfblsm_discr.h:548
void set_first_order(bool b)
switches the first order upwind method on/off
Definition hrfblsm_discr.h:213
number get_CFL()
get the max. CFL
Definition hrfblsm_discr.h:201
Grid::VertexAttachmentAccessor< ADimVector > t_aaGrad
type of gradient attachment accessor
Definition hrfblsm_discr.h:112
void set_LSF(SmartPtr< TGridFunction > spLSF)
set level-set function to specify the interface
Definition hrfblsm_discr.h:172
void compute_normal_vel(SmartPtr< CplUserData< MathVector< dim >, dim > > spVelField, SmartPtr< TGridFunction > spNormVel)
compute the normal velocity using a user-data object
Definition hrfblsm_discr_impl.h:1738
HiResFluxBasedLSM()
Constructor.
Definition hrfblsm_discr.h:142
void set_nr_of_steps(size_t n)
set nr of time steps to perform
Definition hrfblsm_discr.h:194
bool m_time_control
whether to compute the appropriate time step
Definition hrfblsm_discr.h:532
domain_type::grid_type grid_type
grid type
Definition hrfblsm_discr.h:100
number m_minCFL
min. allowed Courant number in a time step
Definition hrfblsm_discr.h:534
static const size_t maxNumCo
max. number of corners and subcontrol volume faces
Definition hrfblsm_discr.h:133
SmartPtr< TGridFunction > m_newSol
computed solution at the new time step
Definition hrfblsm_discr.h:518
number m_CFL
max. Courant number achieved in all the computed steps
Definition hrfblsm_discr.h:561
SmartPtr< TGridFunction > m_spCourant
a grid function for the local Courant numbers (optional)
Definition hrfblsm_discr.h:524
void mark_CoIE(grid_type &grid, ABool &aCoIE, t_aaCoIE &aaCoIE)
mark corners at the interface
Definition hrfblsm_discr_impl.h:81
void bnd_sol_update(bool redOrder, const MathVector< dim > &bip, const MathVector< dim > &x, number u, const MathVector< dim > &grad, const MathVector< dim > &vel, number &curr)
computes the bf-update of the solution in an element
Definition hrfblsm_discr_impl.h:236
void set_outflow_boundary(const char *subsets)
boundary condition subset handling: outflow boundary
Definition hrfblsm_discr_impl.h:2036
void get_nodal_vel(ElemType *elem, MathVector< dim > coCoord[], DimFV1Geometry< dim > &geo, LocalVector &u, MathVector< dim > grad[], MathVector< dim > co_vel[], int lsf_sign)
gets corner velocity and source
Definition hrfblsm_discr_impl.h:280
void append_vertical_to_normal_vel(SmartPtr< TGridFunction > spNVelGF, const char *cmp, SmartPtr< TGridFunction > spNormVel)
appends a vertical vector the the normal velocity (using a user-data object)
Definition hrfblsm_discr.h:305
static number lsf_threshold()
threshold for the level-set-function
Definition hrfblsm_discr.h:137
bool m_antiderivSrc
if to use the antiderivative to discretize the source
Definition hrfblsm_discr.h:541
int lsf_sign(size_t noc, number lsf[])
sign of the LSF
Definition hrfblsm_discr_impl.h:60
void set_antideriv_src(bool b)
sets the use of the antiderivative in the discretization of the source term
Definition hrfblsm_discr.h:216
void set_verbose(bool b)
set the output level
Definition hrfblsm_discr.h:159
void set_time_control_off()
switch the time control off
Definition hrfblsm_discr.h:191
SmartPtr< CplUserData< MathVector< dim >, dim > > m_imVelocity
data import for the velocity field (if used)
Definition hrfblsm_discr.h:550
SmartPtr< TGridFunction > m_spSDF
Signed-Distance Function (for computations of the eff. dt at the interface)
Definition hrfblsm_discr.h:521
void set_normal_velocity(SmartPtr< CplUserData< number, dim > > vel)
set normal velocity field
Definition hrfblsm_discr.h:241
void compute_elem_grad(DimFV1Geometry< dim > &geo, number uValue[], MathVector< dim > co_grad[], number *lsf, CplUserData< number, dim > *if_val_data, int si)
compute gradients in an element
Definition hrfblsm_discr_impl.h:925
bool m_firstOrder
if to use the classic (first order) upwind method
Definition hrfblsm_discr.h:540
domain_type::position_accessor_type position_accessor_type
type of the position accessor
Definition hrfblsm_discr.h:103
SubsetGroup m_neumann_sg
subsets with the Neumann BC
Definition hrfblsm_discr.h:547
void limit_grad(TGridFunction &uOld, t_aaGrad &aaGradient)
slope limiter
Definition hrfblsm_discr_impl.h:1143
void append_vertical_to_normal_vel(SmartPtr< CplUserData< number, dim > > spNVelField, SmartPtr< TGridFunction > spNormVel)
appends a vertical vector the the normal velocity (using a user-data object)
Definition hrfblsm_discr_impl.h:1880
SmartPtr< CplUserData< number, dim > > m_imInterfaceVal
Dirichlet values at the interface.
Definition hrfblsm_discr.h:553
TGridFunction::domain_type domain_type
domain type
Definition hrfblsm_discr.h:91
void set_source_neg(number val)
set the source only for the subdomain with the negative values of the LSF
Definition hrfblsm_discr.h:228
void set_time_control(number minCFL, number maxCFL)
switch the time control on
Definition hrfblsm_discr.h:187
bool m_bVerbose
whether to print more details
Definition hrfblsm_discr.h:528
TGridFunction::template dim_traits< dim >::grid_base_object ElemType
type of base grid object
Definition hrfblsm_discr.h:121
void save_CourantNumber_to(SmartPtr< TGridFunction > spCN)
specifies a grid function to save the Courant number to
Definition hrfblsm_discr.h:339
Grid::VertexAttachmentAccessor< ABool > t_aaCoIE
type of the attachment accessor for corners of intersected elements
Definition hrfblsm_discr.h:118
number m_dt
current time step
Definition hrfblsm_discr.h:530
size_t m_nrOfSteps
number of time steps to compute
Definition hrfblsm_discr.h:531
void get_scvf_vel_on_if(DimFV1Geometry< dim > &geo, const typename DimFV1Geometry< dim >::SCVF &scvf, number u[], MathVector< dim > grad[], number lsf[], MathVector< dim > &from_co_vel, number &from_flux, MathVector< dim > &to_co_vel, number &to_flux)
get the velocity for a given SCVF in an element intersected by the interface
Definition hrfblsm_discr_impl.h:515
void set_limiter(bool b)
sets whether to use the slope limiter
Definition hrfblsm_discr.h:222
void set_divfree(bool b)
sets the divergence free flag
Definition hrfblsm_discr.h:210
TGridFunction::algebra_type algebra_type
algebra type
Definition hrfblsm_discr.h:94
virtual ~HiResFluxBasedLSM()
Destructor.
Definition hrfblsm_discr.h:154
Grid::VertexAttachmentAccessor< ANumber > t_aaVol
type of volume attachment accessor
Definition hrfblsm_discr.h:109
void set_SDF(SmartPtr< TGridFunction > spSDF)
set the signed-distance function for the computation of the effective time step length at the interfa...
Definition hrfblsm_discr.h:175
TGridFunction::template traits< Vertex >::const_iterator VertexConstIterator
vertex base iterator
Definition hrfblsm_discr.h:127
void set_dirichlet_data(number val)
set constant Dirichlet values
Definition hrfblsm_discr.h:257
SmartPtr< CplUserData< number, dim > > m_imDirichlet
data import for the Dirichlet values
Definition hrfblsm_discr.h:552
void extrapolate_by_lsf(const CplUserData< number, dim > *if_val_data, int si, DimFV1Geometry< dim > &geo, number sol[], number lsf[], size_t base, number ext[])
extrapolation by the LSF
Definition hrfblsm_discr_impl.h:125
SmartPtr< TGridFunction > m_spLSF
Level-Set Function data (if any)
Definition hrfblsm_discr.h:520
number m_source_neg
Definition hrfblsm_discr.h:556
void set_dirichlet_data(SmartPtr< CplUserData< number, dim > > d)
set the Dirichlet values as a user data object
Definition hrfblsm_discr.h:255
void set_interface_data(SmartPtr< CplUserData< number, dim > > d)
sets the Dirichlet values at the interface
Definition hrfblsm_discr.h:248
SmartPtr< T, FreePolicy > make_sp(T *inst)