Plugins
Loading...
Searching...
No Matches
level_set_pos.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Gesellschaft fuer Anlagen- und Reaktorsicherheit gGmbH
3 * SPDX-License-Identifier: EUPL-1.2
4 * SPDX-FileContributor: Dmitry Logashenko
5 * SPDX-FileContributor: Goethe Universität Frankfurt
6 * SPDX-FileType: SOURCE
7 *
8 * This file is part of d3f++.
9 * d3f++ is an extension for UG4. Licensing information and citation requirements of UG4 are provided in LICENSES/UG4-LGPL_2.1
10 */
11
12
13/*
14 * Tools for determining the position of the level set
15 */
16#ifndef __H__UG__PLUGINS__LEVEL_SET_POSITION_H__
17#define __H__UG__PLUGINS__LEVEL_SET_POSITION_H__
18
19#include <vector>
20#include <iostream>
21#include <limits>
22#include <cmath>
23
24#include "common/common.h"
25
35
36namespace ug {
37namespace d3f {
38
46template <typename TGridFunction>
48{
49public:
50
52 typedef TGridFunction grid_func_type;
53
55 typedef typename TGridFunction::domain_type domain_type;
56
58 typedef typename TGridFunction::algebra_type algebra_type;
59
61 typedef typename TGridFunction::element_type elem_type;
62
64 static const int dim = TGridFunction::dim;
65
67 static const size_t maxNumCorners = (size_t)
69
70private:
71
73 static number lsf_threshold () {return 1e-8;}
74
77
80
83 {
86
87 // constructor
89 : elem (e)
90 {
91 pnt[0] = p_min; pnt[1] = p_max;
92 }
93 };
94
95public:
96
99 (
101 size_t lsf_fct,
102 number ls_value = 0
103 )
104 : m_spLSF (spLSF), m_lsf_fct (lsf_fct), m_level_set_zero (ls_value),
105 m_tree (* (spLSF->domain()->grid ()), spLSF->domain()->position_attachment ()),
106 m_traTol (1e-10), m_traNI (1000)
107 {
108 m_tree.enable_warnings(false);
109 }
110
113 (
115 const char * lsf_cmp_name,
116 number ls_value = 0
117 )
118 : LSPositionZ (spLSF, spLSF->fct_id_by_name (lsf_cmp_name), ls_value)
119 {}
120
123 (
125 )
126 : LSPositionZ (spLSF, (size_t) 0, 0)
127 {}
128
131
133 size_t lsf_fct () {return m_lsf_fct;}
134
137
139 void reinit ()
140 {
141 // find the intersected elements
142 fill_cut ();
143
144 // create the tree
145 m_tree.create_tree (m_vpCut.begin (), m_vpCut.end ());
146 };
147
150 (
151 const MathVector<dim-1> & xy,
152 std::vector<number> & z,
153 number small_z = 1e-12
154 )
155 {
156 z.clear ();
157 if (! get_intersected (xy)) return;
158 get_z (z, small_z);
159 }
160
163 (
164 const MathVector<dim-1> & xy,
165 number& height
166 )
167 {
168 std::vector<number> z;
169 get_height (xy, z);
170 if (z.size () == 0) return false;
171 number max_z = z[0];
172 for (size_t i = 1; i < z.size (); i++)
173 if (z[i] > max_z)
174 max_z = z[i];
175 height = max_z;
176 return true;
177 }
178
181 (
182 const MathVector<dim-1> & xy,
183 number default_height
184 )
185 {
186 number v;
187 if (get_height_at (xy, v))
188 return v;
189 return default_height;
190 }
191
192#ifdef UG_FOR_LUA
194 number height_at
195 (
196 std::vector<number> xy
197 )
198 {
199 if (xy.size () != dim - 1)
200 UG_THROW ("LSPositionZ::height_at: Only " << dim - 1 << "coordinates may be specified!");
201
202 MathVector<dim-1> xy_vec;
203 number v;
204 for (size_t i = 0; i < dim - 1; i++) xy_vec [i] = xy [i];
205 if (! get_height_at (xy_vec, v))
206 return std::numeric_limits<number>::quiet_NaN ();
207 return v;
208 }
209#endif
210
213 (
214 number tol,
215 size_t nIter
216 )
217 {
218 m_traTol = tol; m_traNI = nIter;
219 }
220
221private:
222
224 inline int lsf_sign (size_t noc, number lsf []);
225
227 void fill_cut ();
228
230 bool get_intersected
231 (
232 const MathVector<dim-1> & xy
233 );
234
236 void get_z
237 (
238 std::vector<number> & z,
239 number small_z = 1e-12
240 );
241
242private:
243
246
248 size_t m_lsf_fct;
249
252
255
257 std::vector<elem_type *> m_vpCut;
258
260 std::vector<intersect_rec_type> m_intersectionRecords;
261
263 std::vector<elem_intersect_data> m_intersections;
264
268 size_t m_traNI;
269};
270
280template <typename TGridFunction>
282: public StdDependentUserData<LSPosZData<TGridFunction>, number, TGridFunction::dim>
283{
284public:
286 typedef TGridFunction gf_type;
287
289 static const int wDim = gf_type::dim;
290
293
296
298 typedef typename gf_type::domain_type domain_type;
299
301 typedef typename domain_type::position_accessor_type pos_acc_type;
302
303private:
306
309
310public:
311
314 (
315 SmartPtr<measurer_type>& sp_ls_pos_z,
316 const char * subsets
317 );
318
320 ~LSPosZData ();
321
324 (
325 number defaultHeight
326 )
327 {
328 m_default_height = defaultHeight;
329 m_use_ss_z_as_default = false;
330 }
331
333 void reinit ();
334
336 void reinit_for
337 (
338 int dim
339 );
340
342 virtual bool continuous () const {return m_elem_dim == 0;}
343
345 virtual bool requires_grid_fct () const {return true;}
346
348 template <int refDim>
349 void eval_and_deriv
350 (
351 number vValue[],
352 const MathVector<wDim> vGlobIP[],
353 number time,
354 int si,
355 GridObject* elem,
356 const MathVector<wDim> vCornerCoords[],
357 const MathVector<refDim> vLocIP[],
358 const size_t nip,
359 LocalVector* u,
360 bool bDeriv,
361 int s,
362 std::vector<std::vector<number> > vvvDeriv[],
363 const MathMatrix<refDim, wDim>* vJT = NULL
364 );
365
366private:
367
369 template <typename TElem>
370 void get_xy_for_all_
371 (
372 MathVector<wDim-1> * xy_pos,
373 number * z_pos
374 );
375
378 {
383 : m_pThis (pThis), m_xy_pos (xy_pos), m_z_pos (z_pos) {};
384 template <typename TElem> void operator() (TElem &)
385 {
386 m_pThis->template get_xy_for_all_<TElem> (m_xy_pos, m_z_pos);
387 }
388 };
389
391 template <int elemDim>
392 void reinit_for_ ();
393
395 template <int elemDim>
396 void detach_for_ ();
397
399 void detach_for
400 (
401 int dim
402 );
403
404private:
405
407
409
412
415 std::vector<number> m_elem_z;
416};
417
428template <typename TGridFunction>
430: public StdDependentUserData<LSPosZCellToVrtData<TGridFunction>, number, TGridFunction::dim>
431{
432public:
434 typedef TGridFunction gf_type;
435
437 static const int wDim = gf_type::dim;
438
441
444
446 typedef typename gf_type::domain_type domain_type;
447
449 typedef typename domain_type::grid_type grid_type;
450
452 typedef typename domain_type::position_accessor_type pos_acc_type;
453
454private:
457
460
463
466
469
472
473public:
474
477 (
478 SmartPtr<measurer_type>& sp_ls_pos_z,
479 const char * subsets
480 );
481
484
487 (
488 number defaultHeight
489 )
490 {
491 m_default_height = defaultHeight;
492 m_use_ss_z_as_default = false;
493 }
494
496 void reinit ();
497
499 void reinit_for
500 (
501 int dim
502 );
503
505 virtual bool continuous () const {return true;}
506
508 virtual bool requires_grid_fct () const {return true;}
509
511 template <int refDim>
512 void eval_and_deriv
513 (
514 number vValue[],
515 const MathVector<wDim> vGlobIP[],
516 number time,
517 int si,
518 GridObject* elem,
519 const MathVector<wDim> vCornerCoords[],
520 const MathVector<refDim> vLocIP[],
521 const size_t nip,
522 LocalVector* u,
523 bool bDeriv,
524 int s,
525 std::vector<std::vector<number> > vvvDeriv[],
526 const MathMatrix<refDim, wDim>* vJT = NULL
527 );
528
529private:
530
532 template <typename TElem>
533 void get_xy_for_all_
534 (
535 num_a_type & a_elem_num,
536 MathVector<wDim-1> * xy_pos,
537 number * z_pos
538 );
539
542 {
548 : m_pThis (pThis), m_a_elem_num (a_elem_num), m_xy_pos (xy_pos), m_z_pos (z_pos) {};
549 template <typename TElem> void operator() (TElem &)
550 {
551 m_pThis->template get_xy_for_all_<TElem> (m_a_elem_num, m_xy_pos, m_z_pos);
552 }
553 };
554
556 template <int elemDim>
557 void reinit_for_ ();
558
559private:
560
562
564
567
571};
572
578template <typename TLSPosZ>
580{
581public:
582
584 typedef TLSPosZ t_ls_measurer;
585
587 static const int dim = t_ls_measurer::dim;
588
589public:
590
593 (
594 SmartPtr<t_ls_measurer> sp_ls_measurer
595 )
596 : m_sp_ls_measurer (sp_ls_measurer)
597 {}
598
600 void clear_pnt () {m_v_points.resize (0);}
601
604 (
606 number z_spec = 0,
607 bool z_given = false
608 )
609 {
610 m_v_points.push_back (t_pnt_data (xy, z_spec, z_given));
611 }
612
613#ifdef UG_FOR_LUA
615 void add_pnt
616 (
617 std::vector<number> xyz
618 )
619 {
620 bool z_given = false;
621 number z_spec = 0;
622
623 if (xyz.size () == dim)
624 {
625 z_spec = xyz [dim-1];
626 z_given = true;
627 }
628 else if (xyz.size () != dim - 1)
629 UG_THROW ("LSPositionAtPoints::add_pnt: Only " << dim - 1 << "coordinates may be specified!");
630
631 MathVector<dim-1> xy_vec;
632 for (size_t i = 0; i < dim - 1; i++) xy_vec [i] = xyz [i];
633 add_pnt (xy_vec, z_spec, z_given);
634 }
635#endif
636
639 (
640 std::istream & in,
641 bool z_given = false
642 );
643
646 (
647 const char * file_name,
648 bool z_given = false
649 );
650
652 void compute ();
653
655 size_t n_points () {return m_v_points.size ();}
656
658 const MathVector<dim-1>& coord (size_t i) {return m_v_points[i].xy;}
659
661 number z_at_pnt (size_t i) {return m_v_points[i].z;}
662
664 number spec_z_at_pnt (size_t i) {return m_v_points[i].z_spec;}
665
667 bool z_is_spec (size_t i) {return m_v_points[i].z_given;}
668
670 void print_to
671 (
672 std::ostream & out,
673 bool print_difference = false
674 );
675
677 void print_to
678 (
679 const char * file_name,
680 bool print_difference = false
681 );
682
684 void print
685 (
686 bool print_difference = false
687 )
688 {
689 print_to (ug::GetLogAssistant().logger(), print_difference);
690 }
691
693 void append_to_table
694 (
695 const char * file_name,
696 size_t step,
697 number time
698 );
699
702 (
703 const char * file_name
704 );
705
706private:
707
710 {
714 bool z_given;
715
716 bool valid;
717
718 t_pnt_data (MathVector<dim-1> & the_xy, number the_z_spec, bool if_z_given)
719 : xy (the_xy), z (0), z_spec (the_z_spec), z_given (if_z_given), valid (false) {};
720 };
721
723
724 std::vector<t_pnt_data> m_v_points;
725};
726
727} // namespace d3f
728} // end namespace ug
729
730// include implementation
731#include "level_set_pos_impl.h"
732
733#endif // __H__UG__PLUGINS__LEVEL_SET_POSITION_H__
734
735/* End of File */
parameterString s
Definition Biogas.lua:2
number time() const
Definition level_set_pos.h:431
domain_type::grid_type grid_type
grid type
Definition level_set_pos.h:449
SmartPtr< measurer_type > m_sp_ls_pos_z
the object to measure the z-coordinate of the level set
Definition level_set_pos.h:563
LSPosZCellToVrtData< gf_type > this_type
this type
Definition level_set_pos.h:440
gf_type::domain_type domain_type
domain type
Definition level_set_pos.h:446
Attachment< number > h_a_type
type of the attachment for the averaged height at the vertices
Definition level_set_pos.h:468
bool m_use_ss_z_as_default
whether to use the z-coord. of the subset as the default value
Definition level_set_pos.h:565
~LSPosZCellToVrtData()
Destructor.
Definition level_set_pos_impl.h:652
void reinit_for(int dim)
Initializer (should be called before every use). Reinialize the measurer before running this reinit!
Definition level_set_pos_impl.h:892
void reinit_for_()
Initializer for the constant dimensionality.
Definition level_set_pos_impl.h:709
Attachment< size_t > num_a_type
type of the attachment numbering the elements
Definition level_set_pos.h:459
number m_default_height
the default value of the z-coordinate if the level set is not found
Definition level_set_pos.h:566
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition level_set_pos.h:508
StdDependentUserData< this_type, number, wDim > base_type
the base type
Definition level_set_pos.h:443
h_a_type m_a_height
attachment keeping the averaged height at the vertex
Definition level_set_pos.h:570
TGridFunction gf_type
type of the grid function
Definition level_set_pos.h:434
LSPositionZ< TGridFunction > measurer_type
type of the class for measuring the height of the level-set
Definition level_set_pos.h:456
Grid::AttachmentAccessor< Vertex, h_a_type > h_aa_t
type of the attachment accessor for the averaged height at the vertices
Definition level_set_pos.h:471
static const int wDim
world dimension
Definition level_set_pos.h:437
domain_type::position_accessor_type pos_acc_type
position attachment accessor type
Definition level_set_pos.h:452
Attachment< size_t > cnt_a_type
type of the attachment for counting elements adjecent to the vertices
Definition level_set_pos.h:462
void reinit()
Initializer (should be called before every use). Reinialize the measurer before running this reinit!
Definition level_set_pos_impl.h:917
void eval_and_deriv(number vValue[], const MathVector< wDim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< wDim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< number > > vvvDeriv[], const MathMatrix< refDim, wDim > *vJT=NULL)
Performs the main computations:
Definition level_set_pos_impl.h:939
SubsetGroup m_SsGrp
(low-dimensional) subsets to compute the coordinates over
Definition level_set_pos.h:561
Grid::AttachmentAccessor< Vertex, cnt_a_type > cnt_aa_t
type of the attachment accessor for counting elements adjecent to the vertices
Definition level_set_pos.h:465
cnt_a_type m_a_vrt_div
attachment keeping the number of the elements adjecent to a vertex
Definition level_set_pos.h:569
void get_xy_for_all_(num_a_type &a_elem_num, MathVector< wDim-1 > *xy_pos, number *z_pos)
Computes the xy-coordinates of the evaluation points for all elements of the given type.
Definition level_set_pos_impl.h:666
int m_elem_dim
dimensionality of the elements (-1 = not initizlised)
Definition level_set_pos.h:568
void set_default_height(number defaultHeight)
sets the default value for the points with no level set
Definition level_set_pos.h:487
virtual bool continuous() const
We consider here the height as a continuous field as it is represented at vertices.
Definition level_set_pos.h:505
Definition level_set_pos.h:283
static const int wDim
world dimension
Definition level_set_pos.h:289
void set_default_height(number defaultHeight)
sets the default value for the points with no level set
Definition level_set_pos.h:324
void reinit()
Initializer (should be called before every use). Reinialize the measurer before running this reinit!
Definition level_set_pos_impl.h:521
SmartPtr< measurer_type > m_sp_ls_pos_z
the object to measure the z-coordinate of the level set
Definition level_set_pos.h:408
domain_type::position_accessor_type pos_acc_type
position attachment accessor type
Definition level_set_pos.h:301
TGridFunction gf_type
type of the grid function
Definition level_set_pos.h:286
LSPosZData< gf_type > this_type
this type
Definition level_set_pos.h:292
StdDependentUserData< this_type, number, wDim > base_type
the base type
Definition level_set_pos.h:295
~LSPosZData()
Destructor.
Definition level_set_pos_impl.h:279
number m_default_height
the default value of the z-coordinate if the level set is not found
Definition level_set_pos.h:411
void reinit_for(int dim)
Initializer (should be called before every use). Reinialize the measurer before running this reinit!
Definition level_set_pos_impl.h:499
void eval_and_deriv(number vValue[], const MathVector< wDim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< wDim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< number > > vvvDeriv[], const MathMatrix< refDim, wDim > *vJT=NULL)
Performs the main computations:
Definition level_set_pos_impl.h:543
bool m_use_ss_z_as_default
whether to use the z-coord. of the subset as the default value
Definition level_set_pos.h:410
virtual bool continuous() const
We consider here the height as a continuous field only if it is evaluated at vertices.
Definition level_set_pos.h:342
void get_xy_for_all_(MathVector< wDim-1 > *xy_pos, number *z_pos)
Computes the xy-coordinates of the evaluation points for all elements of the given type.
Definition level_set_pos_impl.h:290
std::vector< number > m_elem_z
z-coordinates of the level set at the elements of the subsets
Definition level_set_pos.h:415
LSPositionZ< TGridFunction > measurer_type
type of the class for measuring the height of the level-set
Definition level_set_pos.h:305
void detach_for_()
Destroys the attachment (for the templated dimensionality)
Definition level_set_pos_impl.h:468
num_a_type m_a_elem_num
attachment keeping a numbering of the elements (vertices etc.) in the subsets
Definition level_set_pos.h:414
void reinit_for_()
Initializer for the constant dimensionality.
Definition level_set_pos_impl.h:330
Attachment< size_t > num_a_type
type of the attachment numbering the elements
Definition level_set_pos.h:308
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition level_set_pos.h:345
SubsetGroup m_SsGrp
(low-dimensional) subsets to compute the coordinates over
Definition level_set_pos.h:406
void detach_for(int dim)
Destroys the attachment (for a variable dimensionality)
Definition level_set_pos_impl.h:479
int m_elem_dim
dimensionality of the elements (-1 = not initizlised)
Definition level_set_pos.h:413
gf_type::domain_type domain_type
domain type
Definition level_set_pos.h:298
Definition level_set_pos.h:580
static const int dim
world dimension
Definition level_set_pos.h:587
void append_to_table(const char *file_name, size_t step, number time)
appends the data to a given file
Definition level_set_pos_impl.h:1172
std::vector< t_pnt_data > m_v_points
the points to evaluate at
Definition level_set_pos.h:724
number spec_z_at_pnt(size_t i)
return the specified z-coordinate at point i
Definition level_set_pos.h:664
bool z_is_spec(size_t i)
return true iff the z-coordinate of point i is given
Definition level_set_pos.h:667
void compute()
compute the z-coordinates
Definition level_set_pos_impl.h:1068
void add_pnt(MathVector< dim-1 > &xy, number z_spec=0, bool z_given=false)
adds a point
Definition level_set_pos.h:604
void load_points_from(std::istream &in, bool z_given=false)
load points from a stream
Definition level_set_pos_impl.h:1008
void print_table_header(const char *file_name)
prints the table header to a given file
Definition level_set_pos_impl.h:1207
SmartPtr< t_ls_measurer > m_sp_ls_measurer
the measurer
Definition level_set_pos.h:722
void print(bool print_difference=false)
prints the table of the points into the ug shell
Definition level_set_pos.h:685
TLSPosZ t_ls_measurer
measurer type
Definition level_set_pos.h:584
size_t n_points()
returns the number points
Definition level_set_pos.h:655
void print_to(std::ostream &out, bool print_difference=false)
prints the table of the points into a given stream
Definition level_set_pos_impl.h:1114
LSPositionAtPoints(SmartPtr< t_ls_measurer > sp_ls_measurer)
constructor
Definition level_set_pos.h:593
number z_at_pnt(size_t i)
return the computed z-coordinate at point i
Definition level_set_pos.h:661
void clear_pnt()
clear the points
Definition level_set_pos.h:600
const MathVector< dim-1 > & coord(size_t i)
returns the low-dim. coordinates the point i
Definition level_set_pos.h:658
Definition level_set_pos.h:48
SmartPtr< grid_func_type > m_spLSF
level-set function
Definition level_set_pos.h:245
std::vector< elem_type * > m_vpCut
array of the intersected elements
Definition level_set_pos.h:257
TGridFunction::algebra_type algebra_type
algebra type
Definition level_set_pos.h:58
TGridFunction::element_type elem_type
generic element type
Definition level_set_pos.h:61
void get_z(std::vector< number > &z, number small_z=1e-12)
get the point at the level set
Definition level_set_pos_impl.h:122
std::vector< elem_intersect_data > m_intersections
set of the intersections
Definition level_set_pos.h:263
size_t m_lsf_fct
component for the level-set function (0 if the grid function is scalar)
Definition level_set_pos.h:248
lg_ntree< dim-1, dim, elem_type > tree_type
quad- or octtree type to search the elements
Definition level_set_pos.h:76
std::vector< intersect_rec_type > m_intersectionRecords
intersection recorder
Definition level_set_pos.h:260
number height_at_dv(const MathVector< dim-1 > &xy, number default_height)
returns the largest z-coordinate or the default value (if no intersections found)
Definition level_set_pos.h:181
void get_height(const MathVector< dim-1 > &xy, std::vector< number > &z, number small_z=1e-12)
get the z-coordinates
Definition level_set_pos.h:150
SmartPtr< grid_func_type > lsf()
returns the level-set function
Definition level_set_pos.h:130
size_t lsf_fct()
returns the component of the grid function
Definition level_set_pos.h:133
LSPositionZ(SmartPtr< grid_func_type > spLSF, size_t lsf_fct, number ls_value=0)
the most general class constructor
Definition level_set_pos.h:99
TGridFunction grid_func_type
grid function type
Definition level_set_pos.h:52
number level_set_zero()
returns the value for the level set (the s.c. "level set zero")
Definition level_set_pos.h:136
size_t m_traNI
number of iterations for the inverse transformation of the coordinates (for non-linear transformation...
Definition level_set_pos.h:268
static number lsf_threshold()
threshold for the level-set-function
Definition level_set_pos.h:73
int lsf_sign(size_t noc, number lsf[])
sign of the LSF in the element
Definition level_set_pos_impl.h:39
bool get_intersected(const MathVector< dim-1 > &xy)
get the elements intersected by the ray
Definition level_set_pos_impl.h:95
TGridFunction::domain_type domain_type
domain type
Definition level_set_pos.h:55
RayElemIntersectionRecord< elem_type * > intersect_rec_type
intersection record type
Definition level_set_pos.h:79
LSPositionZ(SmartPtr< grid_func_type > spLSF, const char *lsf_cmp_name, number ls_value=0)
class constructor
Definition level_set_pos.h:113
static const size_t maxNumCorners
max. number of the corners of the elements in the domain
Definition level_set_pos.h:67
LSPositionZ(SmartPtr< grid_func_type > spLSF)
class constructor for the simplest (and historically standard) case
Definition level_set_pos.h:123
void fill_cut()
get the elements cut by the level set
Definition level_set_pos_impl.h:58
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
number m_traTol
tolerance for the inverse transformation of the coordinates (for non-linear transformations)
Definition level_set_pos.h:266
number m_level_set_zero
value of the level set (standardly 0)
Definition level_set_pos.h:251
static const int dim
world dimension
Definition level_set_pos.h:64
void set_transform_tol(number tol, size_t nIter)
sets the tolerance for the inverce transformation of the elements (for non-linear transformations)
Definition level_set_pos.h:213
tree_type m_tree
the quad- or octtree:
Definition level_set_pos.h:254
void reinit()
initialize the object: find the intersected elements and prepare the tree
Definition level_set_pos.h:139
void create_tree(TIterator elemsBegin, TIterator elemsEnd)
void enable_warnings(bool enable)
SmartPtr< TGrid > grid()
position_attachment_type & position_attachment()
LogAssistant & GetLogAssistant()
#define UG_THROW(msg)
double number
Helper class for computation of the position of the level set in all the elements.
Definition level_set_pos.h:542
LSPosZCellToVrtData * m_pThis
Definition level_set_pos.h:543
void operator()(TElem &)
Definition level_set_pos.h:549
num_a_type & m_a_elem_num
Definition level_set_pos.h:544
number * m_z_pos
Definition level_set_pos.h:546
MathVector< wDim-1 > * m_xy_pos
Definition level_set_pos.h:545
GetXYForElements(LSPosZCellToVrtData *pThis, num_a_type &a_elem_num, MathVector< wDim-1 > *xy_pos, number *z_pos)
Definition level_set_pos.h:547
Helper class for computation of the position of the level set in all the elements.
Definition level_set_pos.h:378
number * m_z_pos
Definition level_set_pos.h:381
void operator()(TElem &)
Definition level_set_pos.h:384
LSPosZData * m_pThis
Definition level_set_pos.h:379
GetXYForElements(LSPosZData *pThis, MathVector< wDim-1 > *xy_pos, number *z_pos)
Definition level_set_pos.h:382
MathVector< wDim-1 > * m_xy_pos
Definition level_set_pos.h:380
type of point data
Definition level_set_pos.h:710
number z
computed value of the z-coordiate
Definition level_set_pos.h:712
bool z_given
iff z is specified
Definition level_set_pos.h:714
number z_spec
expected value of z-coordinate
Definition level_set_pos.h:713
t_pnt_data(MathVector< dim-1 > &the_xy, number the_z_spec, bool if_z_given)
Definition level_set_pos.h:718
MathVector< dim-1 > xy
low-dim coordinate of the point
Definition level_set_pos.h:711
bool valid
if not computed or the level set is not covered by the top surface
Definition level_set_pos.h:716
a structure to get the intersection points of an element
Definition level_set_pos.h:83
MathVector< dim > pnt[2]
the intersection points
Definition level_set_pos.h:85
elem_type * elem
the intersected element
Definition level_set_pos.h:84
elem_intersect_data(elem_type *e, MathVector< dim > p_min, MathVector< dim > p_max)
Definition level_set_pos.h:88