15#ifndef __H__UG__PLUGINS__D3F__RIVERS__
16#define __H__UG__PLUGINS__D3F__RIVERS__
59 return (1 - d) / (smooth_len / 2);
74 return (1 - d) / (
PI * smooth_len * smooth_len / 3);
82template <
typename TGr
idFunction>
100 static const int dim = TGridFunction::dim;
212 fs_depth = - std::numeric_limits<number>::max ();
223 for (
size_t i = 0; i <
dim - 1; i++) X[i] = x[i];
328template <
typename TGr
idFunction>
350 static const int dim = TGridFunction::dim;
366 number the_well_depth_spec
399 if (coord.size () != (
size_t) (
dim - 1))
400 UG_THROW (
"VertexWellRecharge::add_well: Wrong number of coordinates specified.\n");
402 for (
size_t i = 0; i <
dim-1; i++) x[i] = coord[i];
440template <
typename TGr
idFunction>
462 static const int dim = TGridFunction::dim;
parameterString s
Definition Biogas.lua:2
bool access(Grid &grid, TAttachment &a)
void attach_to_edges(IAttachment &attachment)
void detach_from_edges(IAttachment &attachment)
Definition level_set_pos.h:48
bool get_height_at(const MathVector< dim-1 > &xy, number &height)
gets the largest z-coordinate (returns false if no intersections found)
Definition level_set_pos.h:163
void reinit()
initialize the object: find the intersected elements and prepare the tree
Definition level_set_pos.h:139
virtual number simple_smoothed_recharge_at(MathVector< dim > &x) const =0
VertexLowDimRecharge(number smoothLen, SmartPtr< grid_func_type > spLSF)
constructor
Definition rivers.h:118
bool m_no_inflow
whether to switch the possible inflow off
Definition rivers.h:295
number m_max_depth_diff
max. depth difference (if restricted)
Definition rivers.h:292
void prepare_ls_height()
initializes the level-set z-coordinate computations
Definition rivers.h:205
void set_bottom_thickness(number e)
sets the thickness of the bottom
Definition rivers.h:139
bool m_restrict_depth
if to restrict the depth
Definition rivers.h:289
void set_no_inflow(bool b)
switches the possible inflow on/off
Definition rivers.h:164
static const int dim
world dimension
Definition rivers.h:100
number m_top_tolerance
tolerance for the projection to the top
Definition rivers.h:310
static const int mol_dim
dimension of the mollifier
Definition rivers.h:103
number m_e
thickness of the bottom
Definition rivers.h:280
void set_relative_to(const char *subsetNames, number top_tolerance)
specifyes the subsets of the top
Definition rivers.h:173
void set_gravity(number g)
sets the gravity
Definition rivers.h:148
number m_gravity
gravity
Definition rivers.h:283
std::vector< MathVector< dim > > m_topTracePoints
intersection points with the top subsets
Definition rivers.h:307
TGridFunction::domain_type domain_type
type of the domain
Definition rivers.h:91
number object_recharge(number h_s, number h_fs, number w) const
the river recharge intensivity (according to the model)
Definition rivers.h:239
bool ls_depth_is_relative()
returns true iff the depths should be relative
Definition rivers.h:217
void set_viscosity(number mu)
sets the viscosity of the water
Definition rivers.h:145
void simple_compute(SmartPtr< grid_func_type > spRecharge)
computes the recharge at the vertices
Definition rivers_impl.h:95
bool m_is_constant
if to use the constant intensity
Definition rivers.h:315
TGridFunction grid_func_type
grid function type
Definition rivers.h:88
void set_density(number rho)
sets the density of the water
Definition rivers.h:142
number m_smoothLen
smoothing parameter (of the mollifier)
Definition rivers.h:286
number m_constant_flux
the intensity per unit length if constant (all other parameters are ignored)
Definition rivers.h:317
void set_relative_to(const char *subsetNames, number top_tolerance, int top_grid_level)
specifyes the subsets of the top
Definition rivers_impl.h:29
TGridFunction::algebra_type algebra_type
type of the algebra
Definition rivers.h:94
grid_dim_traits< dim >::side_type g_surf_elem_t
type of the elements constituting surfaces in the grid
Definition rivers.h:106
domain_type::grid_type grid_type
grid type
Definition rivers.h:97
LSPositionZ< grid_func_type > m_lsPosZ
depth measurer for the level set
Definition rivers.h:298
geometry_traits< g_surf_elem_t >::iterator g_surf_iter_t
type of the iterator of the grid surface elements
Definition rivers.h:109
void compute(SmartPtr< grid_func_type > spRecharge)
computes the recharge at the vertices
Definition rivers_impl.h:119
number get_ls_height_at(MathVector< dim-1 > &x)
computes the z-coordinate of the level set at a given point
Definition rivers.h:208
number m_perm
permeability of the bottom
Definition rivers.h:277
SmartPtr< top_tracer_tree_t > m_spTopTracerTree
tree for the top ray traicer
Definition rivers.h:301
void set_permeability(number k)
sets the permeability of the bottom
Definition rivers.h:136
number smooth_len() const
returns the smoothing parameter
Definition rivers.h:133
number max_depth_diff() const
returns the set maximum depth difference
Definition rivers.h:161
number m_viscosity
viscosity of the water
Definition rivers.h:274
size_t get_top_z(const MathVector< dim > &over)
get the intersection with the top
Definition rivers_impl.h:72
std::vector< top_intersection_record_t > m_topIntersectionRecords
top intersection tracer auxiliary data struction
Definition rivers.h:304
RayElemIntersectionRecord< g_surf_elem_t * > top_intersection_record_t
Definition rivers.h:112
void set_relative_to(const char *subsetNames)
specifyes the subsets of the top
Definition rivers.h:179
bool no_inflow() const
returns the state of the possible inflow
Definition rivers.h:167
bool restrict_depth() const
returns the state of the depth restriction
Definition rivers.h:158
virtual void compute_depths()=0
prepares the depth of the recharge objects
lg_ntree< dim-1, dim, g_surf_elem_t > top_tracer_tree_t
Definition rivers.h:111
void restrict_depth(number max_depth_diff)
restricts the depth
Definition rivers.h:151
void set_constant_flux(number flux)
sets the constant flux (mainly for debugging purposes)
Definition rivers.h:185
size_t min_top_depth(MathVector< dim-1 > &x, number &min_depth)
computes the minimum z-coordinate of the top surface (returns the number of the intersections)
Definition rivers.h:220
number m_density
density of the water
Definition rivers.h:271
virtual number smoothed_recharge_at(MathVector< dim > &x) const =0
computes the smoothed recharge at a given point
ANumber depth_attachment_type
attachment type for the depth of segments of the rivers
Definition rivers.h:467
void save_river_depth(const char *file_name)
save the river network with the fs depth in a file
Definition rivers_impl.h:708
void do_print_total_recharge()
prints the total recharge
Definition rivers_impl.h:536
void use_nodal_fs_height(bool v)
sets measuring the depth of the free surface from the centers of the segments to the nodes and back
Definition rivers.h:520
depth_attachment_type m_aRiverDepth
attachment for the specified depth of the rivers at the segments
Definition rivers.h:597
void compute_fs_depths_at_nodes()
computes the depths of the free surface at the nodes of the river vertices
Definition rivers_impl.h:319
bool m_bCheckFSCovering
whether to check the covering of the river segments by the free surface
Definition rivers.h:612
static const int dim
world dimension
Definition rivers.h:462
depth_accessor_type m_aaFSDepth
accessor for the attachment for the depth of the free surface
Definition rivers.h:594
domain_type::grid_type grid_type
grid type
Definition rivers.h:459
TGridFunction::domain_type domain_type
type of the domain
Definition rivers.h:453
void set_river_width(number riverWidth)
sets river width for all segments
Definition rivers_impl.h:264
void check_top_covering(bool v)
sets the verification of the covering by the top subset
Definition rivers.h:526
depth_accessor_type m_aaRiverWidth
accessor forthe attachment for the width of the rivers
Definition rivers.h:606
void check_fs_covering(bool v)
sets the verification of the covering by the free surface
Definition rivers.h:523
void print_total_recharge(bool v)
whether to print the total integrated recharge
Definition rivers.h:529
bool m_bNodalFSDepth
whether to measure the depth of the free surface at the nodes, not in the segments
Definition rivers.h:609
std::string m_sOutputPrefix
... and prepend the following prefix to the lines
Definition rivers.h:623
number river_depth_for(const Edge *seg) const
gets the depth of the river for a segment
Definition rivers.h:554
number fs_depth_for(const Edge *seg) const
gets the depth of the free surface for a segment
Definition rivers.h:551
virtual ~VertexRiverRecharge()
class destructor
Definition rivers.h:502
VertexRiverRecharge(SmartPtr< SegmentNetwork > spRiverNetwork, number smoothLen, SmartPtr< grid_func_type > spLSF)
class constructor
Definition rivers.h:476
SmartPtr< SegmentNetwork > river_network() const
returns the river network
Definition rivers.h:548
virtual number smoothed_recharge_at(MathVector< dim > &x) const
computes the smoothed recharge at a given point
Definition rivers_impl.h:590
bool m_bPrintTotalRecharge
whether to print the total recharge integrated over the rivers
Definition rivers.h:618
void print_total_recharge(const char *f_name)
whether to print the total integrated recharge to a file
Definition rivers.h:532
void file_output_prefix(const char *s)
sets the prefix to add to every line in the file
Definition rivers.h:539
SmartPtr< SegmentNetwork > m_spRiverNetwork
grid of the river segments
Definition rivers.h:588
VertexRiverRecharge< TGridFunction > this_type
this type
Definition rivers.h:445
virtual number simple_smoothed_recharge_at(MathVector< dim > &x) const
computes the smoothed recharge at a given point neglecting the depths, width etc.
Definition rivers_impl.h:762
void reset_river_depth()
set the river depth from the fs depth
Definition rivers_impl.h:650
depth_attachment_type m_aFSDepth
attachment for the depth of the free surface for the segments
Definition rivers.h:591
TGridFunction::algebra_type algebra_type
type of the algebra
Definition rivers.h:456
TGridFunction grid_func_type
grid function type
Definition rivers.h:450
number river_width_for(const Edge *seg) const
gets the with of the river for a segment
Definition rivers.h:557
void compute_fs_depths_at_segments()
computes the depths of the free surface at the centers of the river segments
Definition rivers_impl.h:383
bool m_bCheckTopCovering
whether to check the covering of the river segments by the top subset
Definition rivers.h:615
Grid::EdgeAttachmentAccessor< depth_attachment_type > depth_accessor_type
accessor type for the depth attachment
Definition rivers.h:470
depth_attachment_type m_aRiverWidth
attachment for the width of the rivers
Definition rivers.h:603
std::string m_sTotalRechargeFile
if yes, if to print it into a file, too
Definition rivers.h:621
virtual void compute_depths()
fills the attachment with the depths of the free surface
Definition rivers_impl.h:430
depth_accessor_type m_aaRiverDepth
accessor for the attachment for the depth of the rivers
Definition rivers.h:600
VertexWellRecharge(number smoothLen, SmartPtr< grid_func_type > spLSF)
class constructor
Definition rivers.h:376
void add_well(std::vector< number > coord, number depth)
adds a well
Definition rivers.h:397
TGridFunction grid_func_type
grid function type
Definition rivers.h:338
virtual void compute_depths()
fills the attachment with the depths of the free surface
Definition rivers_impl.h:147
TGridFunction::domain_type domain_type
type of the domain
Definition rivers.h:341
static const int dim
world dimension
Definition rivers.h:350
virtual ~VertexWellRecharge()
class destructor
Definition rivers.h:385
virtual number smoothed_recharge_at(MathVector< dim > &x) const
computes the smoothed recharge at a given point
Definition rivers_impl.h:211
void add_well(MathVector< dim-1 > &x, number depth)
adds a well
Definition rivers.h:391
void set_width(number riverWidth)
sets the diameter of the wells
Definition rivers.h:388
VertexWellRecharge< TGridFunction > this_type
this type
Definition rivers.h:333
std::vector< well_recharge_data_t > m_wells
array of the wells:
Definition rivers.h:429
virtual number simple_smoothed_recharge_at(MathVector< dim > &x) const
computes the smoothed recharge at a given point
Definition rivers_impl.h:252
TGridFunction::algebra_type algebra_type
type of the algebra
Definition rivers.h:344
domain_type::grid_type grid_type
grid type
Definition rivers.h:347
number m_width
diameter of the wells - meant to be the default one
Definition rivers.h:426
number cone_mollifier< 2 >(number d, number smooth_len)
Definition rivers.h:67
number cone_mollifier< 1 >(number d, number smooth_len)
Definition rivers.h:52
number cone_mollifier(number d, number smooth_len)
data of a recharge well
Definition rivers.h:356
MathVector< dim-1 > x
coordinates of the well
Definition rivers.h:357
number well_depth
effective level of the well
Definition rivers.h:361
number well_depth_spec
level of the well as specified
Definition rivers.h:358
number fs_depth
depth of the free surface at the well (computed)
Definition rivers.h:360
well_recharge_data_t(MathVector< dim-1 > the_x, number the_well_depth_spec)
Definition rivers.h:364