Plugins
Loading...
Searching...
No Matches
ug::d3f::LSPositionZ< TGridFunction > Class Template Reference

#include <level_set_pos.h>

Classes

struct  elem_intersect_data
 a structure to get the intersection points of an element More...
 

Public Types

typedef TGridFunction::algebra_type algebra_type
 algebra type
 
typedef TGridFunction::domain_type domain_type
 domain type
 
typedef TGridFunction::element_type elem_type
 generic element type
 
typedef TGridFunction grid_func_type
 grid function type
 

Public Member Functions

void get_height (const MathVector< dim-1 > &xy, std::vector< number > &z, number small_z=1e-12)
 get the z-coordinates
 
bool get_height_at (const MathVector< dim-1 > &xy, number &height)
 gets the largest z-coordinate (returns false if no intersections found)
 
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)
 
number level_set_zero ()
 returns the value for the level set (the s.c. "level set zero")
 
SmartPtr< grid_func_typelsf ()
 returns the level-set function
 
size_t lsf_fct ()
 returns the component of the grid function
 
 LSPositionZ (SmartPtr< grid_func_type > spLSF)
 class constructor for the simplest (and historically standard) case
 
 LSPositionZ (SmartPtr< grid_func_type > spLSF, const char *lsf_cmp_name, number ls_value=0)
 class constructor
 
 LSPositionZ (SmartPtr< grid_func_type > spLSF, size_t lsf_fct, number ls_value=0)
 the most general class constructor
 
void reinit ()
 initialize the object: find the intersected elements and prepare the tree
 
void set_transform_tol (number tol, size_t nIter)
 sets the tolerance for the inverce transformation of the elements (for non-linear transformations)
 

Static Public Attributes

static const int dim = TGridFunction::dim
 world dimension
 
static const size_t maxNumCorners
 max. number of the corners of the elements in the domain
 

Private Types

typedef RayElemIntersectionRecord< elem_type * > intersect_rec_type
 intersection record type
 
typedef lg_ntree< dim-1, dim, elem_typetree_type
 quad- or octtree type to search the elements
 

Private Member Functions

void fill_cut ()
 get the elements cut by the level set
 
bool get_intersected (const MathVector< dim-1 > &xy)
 get the elements intersected by the ray
 
void get_z (std::vector< number > &z, number small_z=1e-12)
 get the point at the level set
 
int lsf_sign (size_t noc, number lsf[])
 sign of the LSF in the element
 

Static Private Member Functions

static number lsf_threshold ()
 threshold for the level-set-function
 

Private Attributes

std::vector< intersect_rec_typem_intersectionRecords
 intersection recorder
 
std::vector< elem_intersect_datam_intersections
 set of the intersections
 
number m_level_set_zero
 value of the level set (standardly 0)
 
size_t m_lsf_fct
 component for the level-set function (0 if the grid function is scalar)
 
SmartPtr< grid_func_typem_spLSF
 level-set function
 
size_t m_traNI
 number of iterations for the inverse transformation of the coordinates (for non-linear transformations)
 
number m_traTol
 tolerance for the inverse transformation of the coordinates (for non-linear transformations)
 
tree_type m_tree
 the quad- or octtree:
 
std::vector< elem_type * > m_vpCut
 array of the intersected elements
 

Detailed Description

template<typename TGridFunction>
class ug::d3f::LSPositionZ< TGridFunction >

Class for measuring the z-coordinates of the level set.

REMARK: This class is not parallalized! The measure can fail to find the level set if it is in a different process. The parallalization should be implemented in the classes that use this measurer!

Member Typedef Documentation

◆ algebra_type

template<typename TGridFunction >
typedef TGridFunction::algebra_type ug::d3f::LSPositionZ< TGridFunction >::algebra_type

algebra type

◆ domain_type

template<typename TGridFunction >
typedef TGridFunction::domain_type ug::d3f::LSPositionZ< TGridFunction >::domain_type

domain type

◆ elem_type

template<typename TGridFunction >
typedef TGridFunction::element_type ug::d3f::LSPositionZ< TGridFunction >::elem_type

generic element type

◆ grid_func_type

template<typename TGridFunction >
typedef TGridFunction ug::d3f::LSPositionZ< TGridFunction >::grid_func_type

grid function type

◆ intersect_rec_type

template<typename TGridFunction >
typedef RayElemIntersectionRecord<elem_type *> ug::d3f::LSPositionZ< TGridFunction >::intersect_rec_type
private

intersection record type

◆ tree_type

template<typename TGridFunction >
typedef lg_ntree<dim-1, dim, elem_type> ug::d3f::LSPositionZ< TGridFunction >::tree_type
private

quad- or octtree type to search the elements

Constructor & Destructor Documentation

◆ LSPositionZ() [1/3]

template<typename TGridFunction >
ug::d3f::LSPositionZ< TGridFunction >::LSPositionZ ( SmartPtr< grid_func_type spLSF,
size_t  lsf_fct,
number  ls_value = 0 
)
inline

the most general class constructor

Parameters
spLSFthe level-set function
lsf_fctthe index of the component in the grid function
ls_valuethe value for the level set

References ug::ntree< int tree_dim, int world_dim, class TElem, class TCommonData >::enable_warnings(), and ug::d3f::LSPositionZ< TGridFunction >::m_tree.

◆ LSPositionZ() [2/3]

template<typename TGridFunction >
ug::d3f::LSPositionZ< TGridFunction >::LSPositionZ ( SmartPtr< grid_func_type spLSF,
const char *  lsf_cmp_name,
number  ls_value = 0 
)
inline

class constructor

Parameters
spLSFthe level-set function
lsf_cmp_namethe component in the grid function
ls_valuethe value for the level set

◆ LSPositionZ() [3/3]

template<typename TGridFunction >
ug::d3f::LSPositionZ< TGridFunction >::LSPositionZ ( SmartPtr< grid_func_type spLSF)
inline

class constructor for the simplest (and historically standard) case

Parameters
spLSFthe level-set function

Member Function Documentation

◆ fill_cut()

template<typename TGridFunction >
void ug::d3f::LSPositionZ< TGridFunction >::fill_cut ( )
private

get the elements cut by the level set

Find the cut elements.

grid element iterator

References ug::GetLocalVector(), and ug::LocalVector::resize().

Referenced by ug::d3f::LSPositionZ< TGridFunction >::reinit().

◆ get_height()

template<typename TGridFunction >
void ug::d3f::LSPositionZ< TGridFunction >::get_height ( const MathVector< dim-1 > &  xy,
std::vector< number > &  z,
number  small_z = 1e-12 
)
inline

get the z-coordinates

Parameters
xythe first coordinates (x, y)
zto save the last coordinates (of all the intersections)
small_za threshold for the coordinates

References ug::d3f::LSPositionZ< TGridFunction >::get_intersected(), and ug::d3f::LSPositionZ< TGridFunction >::get_z().

Referenced by ug::d3f::LSPositionZ< TGridFunction >::get_height_at().

◆ get_height_at()

template<typename TGridFunction >
bool ug::d3f::LSPositionZ< TGridFunction >::get_height_at ( const MathVector< dim-1 > &  xy,
number height 
)
inline

gets the largest z-coordinate (returns false if no intersections found)

Parameters
xythe first coordinates (x, y)
heightthe largest 'z'-coordinate

References ug::d3f::LSPositionZ< TGridFunction >::get_height().

Referenced by ug::d3f::VertexLowDimRecharge< TGridFunction >::get_ls_height_at(), and ug::d3f::LSPositionZ< TGridFunction >::height_at_dv().

◆ get_intersected()

template<typename TGridFunction >
bool ug::d3f::LSPositionZ< TGridFunction >::get_intersected ( const MathVector< dim-1 > &  xy)
private

get the elements intersected by the ray

Find the elements intersected by the straight line.

Parameters
xythe first coordinates of the points of the line

References ug::RayElemIntersectionRecord< class TElem >::elem, ug::PointOnRay(), ug::RayElementIntersections(), ug::RayElemIntersectionRecord< class TElem >::smax, ug::RayElemIntersectionRecord< class TElem >::smin, and ug::VecSet().

Referenced by ug::d3f::LSPositionZ< TGridFunction >::get_height().

◆ get_z()

template<typename TGridFunction >
void ug::d3f::LSPositionZ< TGridFunction >::get_z ( std::vector< number > &  z,
number  small_z = 1e-12 
)
private

◆ height_at_dv()

template<typename TGridFunction >
number ug::d3f::LSPositionZ< TGridFunction >::height_at_dv ( const MathVector< dim-1 > &  xy,
number  default_height 
)
inline

returns the largest z-coordinate or the default value (if no intersections found)

Parameters
xythe first coordinates (x, y)
default_heightthe default value

References ug::d3f::LSPositionZ< TGridFunction >::get_height_at().

◆ level_set_zero()

template<typename TGridFunction >
number ug::d3f::LSPositionZ< TGridFunction >::level_set_zero ( )
inline

returns the value for the level set (the s.c. "level set zero")

References ug::d3f::LSPositionZ< TGridFunction >::m_level_set_zero.

◆ lsf()

template<typename TGridFunction >
SmartPtr< grid_func_type > ug::d3f::LSPositionZ< TGridFunction >::lsf ( )
inline

returns the level-set function

References ug::d3f::LSPositionZ< TGridFunction >::m_spLSF.

◆ lsf_fct()

template<typename TGridFunction >
size_t ug::d3f::LSPositionZ< TGridFunction >::lsf_fct ( )
inline

returns the component of the grid function

References ug::d3f::LSPositionZ< TGridFunction >::m_lsf_fct.

◆ lsf_sign()

template<typename TGridFunction >
int ug::d3f::LSPositionZ< TGridFunction >::lsf_sign ( size_t  noc,
number  lsf[] 
)
inlineprivate

sign of the LSF in the element

get the sign of the LSF in an element: 0 if there both the signes, -1 if negative at all the corners 1 if positive at all the corners

Parameters
nocnumber of corners
lsfcorner values of the LSF

◆ lsf_threshold()

template<typename TGridFunction >
static number ug::d3f::LSPositionZ< TGridFunction >::lsf_threshold ( )
inlinestaticprivate

threshold for the level-set-function

◆ reinit()

◆ set_transform_tol()

template<typename TGridFunction >
void ug::d3f::LSPositionZ< TGridFunction >::set_transform_tol ( number  tol,
size_t  nIter 
)
inline

sets the tolerance for the inverce transformation of the elements (for non-linear transformations)

Parameters
tolthe tolerance
nIternumber of iterations

References ug::d3f::LSPositionZ< TGridFunction >::m_traNI, and ug::d3f::LSPositionZ< TGridFunction >::m_traTol.

Member Data Documentation

◆ dim

template<typename TGridFunction >
const int ug::d3f::LSPositionZ< TGridFunction >::dim = TGridFunction::dim
static

world dimension

◆ m_intersectionRecords

template<typename TGridFunction >
std::vector<intersect_rec_type> ug::d3f::LSPositionZ< TGridFunction >::m_intersectionRecords
private

intersection recorder

◆ m_intersections

template<typename TGridFunction >
std::vector<elem_intersect_data> ug::d3f::LSPositionZ< TGridFunction >::m_intersections
private

set of the intersections

◆ m_level_set_zero

template<typename TGridFunction >
number ug::d3f::LSPositionZ< TGridFunction >::m_level_set_zero
private

value of the level set (standardly 0)

Referenced by ug::d3f::LSPositionZ< TGridFunction >::level_set_zero().

◆ m_lsf_fct

template<typename TGridFunction >
size_t ug::d3f::LSPositionZ< TGridFunction >::m_lsf_fct
private

component for the level-set function (0 if the grid function is scalar)

Referenced by ug::d3f::LSPositionZ< TGridFunction >::lsf_fct().

◆ m_spLSF

template<typename TGridFunction >
SmartPtr<grid_func_type> ug::d3f::LSPositionZ< TGridFunction >::m_spLSF
private

level-set function

Referenced by ug::d3f::LSPositionZ< TGridFunction >::lsf().

◆ m_traNI

template<typename TGridFunction >
size_t ug::d3f::LSPositionZ< TGridFunction >::m_traNI
private

number of iterations for the inverse transformation of the coordinates (for non-linear transformations)

Referenced by ug::d3f::LSPositionZ< TGridFunction >::set_transform_tol().

◆ m_traTol

template<typename TGridFunction >
number ug::d3f::LSPositionZ< TGridFunction >::m_traTol
private

tolerance for the inverse transformation of the coordinates (for non-linear transformations)

Referenced by ug::d3f::LSPositionZ< TGridFunction >::set_transform_tol().

◆ m_tree

template<typename TGridFunction >
tree_type ug::d3f::LSPositionZ< TGridFunction >::m_tree
private

◆ m_vpCut

template<typename TGridFunction >
std::vector<elem_type *> ug::d3f::LSPositionZ< TGridFunction >::m_vpCut
private

array of the intersected elements

Referenced by ug::d3f::LSPositionZ< TGridFunction >::reinit().

◆ maxNumCorners

template<typename TGridFunction >
const size_t ug::d3f::LSPositionZ< TGridFunction >::maxNumCorners
static
Initial value:
= (size_t)
element_list_traits<typename domain_traits<dim>::DimElemList>::maxCorners

max. number of the corners of the elements in the domain


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