ug4
ug::grid_global_debug_info_provider Class Reference

Debugging tool for function that do have no direct access to the grid. More...

#include <grid_debug.h>

Static Public Member Functions

template<typename TAssElem >
static bool ass_elem_in_subset (GridObject *elem, int si)
 checks if one of the associated elements is in a given subset More...
 
template<typename TAssElem >
static bool ass_elem_in_subsets (GridObject *elem, std::vector< int > si_ar, bool in_all=false)
 checks if one of the associated elements is in (all or some of the) given subsets More...
 
static void create (grid_type &rGrid, ISubsetHandler &rSH)
 creates the object (if it did not exist) More...
 
static bool elem_in_subset (GridObject *elem, int si)
 checks if an element is in a subset More...
 
static bool elem_in_subsets (GridObject *elem, std::vector< int > si_ar)
 checks if an element is in subsets from a list More...
 

Protected Member Functions

 grid_global_debug_info_provider (grid_type &rGrid, ISubsetHandler &rSH)
 (protected) constructor More...
 

Private Types

typedef Grid grid_type
 
typedef grid_global_debug_info_provider this_type
 

Private Attributes

grid_typem_pGrid
 current grid More...
 
ISubsetHandlerm_pSH
 current SubsetHandler to use More...
 

Static Private Attributes

static std::unique_ptr< grid_global_debug_info_providerthe_object
 Pointer to the single (if any) object of the grid debug info provider. More...
 

Detailed Description

Debugging tool for function that do have no direct access to the grid.

This class provides access to grid data in functions that have no direct access to the grid (e.g. get only a pointer to an element but need the subsets of the corners etc.).

This is the class for the base Grid class.

REMARK: THIS IS A PURELY DEBUGGING TOOL! IT MAY NOT BE USED IN THE NORMAL ROUTINES FOR THE "EVERY-DAY" USE! THIS CLASS CAN BE PATCHED AND CHANGED ANY TIME, THERE NO STABLE IMPLEMENTATION MAY BE ASSUMED!

This class provides a global pointer (which is static in the class) referencing its single object (only if it is created - otherwise the pointer is NULL).

Member Typedef Documentation

◆ grid_type

◆ this_type

Constructor & Destructor Documentation

◆ grid_global_debug_info_provider()

ug::grid_global_debug_info_provider::grid_global_debug_info_provider ( grid_type rGrid,
ISubsetHandler rSH 
)
inlineprotected

(protected) constructor

Member Function Documentation

◆ ass_elem_in_subset()

template<typename TAssElem >
static bool ug::grid_global_debug_info_provider::ass_elem_in_subset ( GridObject elem,
int  si 
)
inlinestatic

checks if one of the associated elements is in a given subset

Parameters
elemthe element to check
sisubset index to check

References ug::PointerConstArray< TPtr >::size(), and the_object.

◆ ass_elem_in_subsets()

template<typename TAssElem >
static bool ug::grid_global_debug_info_provider::ass_elem_in_subsets ( GridObject elem,
std::vector< int >  si_ar,
bool  in_all = false 
)
inlinestatic

checks if one of the associated elements is in (all or some of the) given subsets

Parameters
elemthe element to check
si_arsubset indices to check
in_allif to check all the subsets of the list

References ug::PointerConstArray< TPtr >::size(), the_object, and UG_THROW.

◆ create()

static void ug::grid_global_debug_info_provider::create ( grid_type rGrid,
ISubsetHandler rSH 
)
inlinestatic

creates the object (if it did not exist)

This function creates the single object of the class. If the object exists, this function throws and exception (to prevent the undesired reinitialization during the debugging process).

Parameters
rGridthe grid to use
rSHthe subset handler to use

References the_object, and UG_THROW.

◆ elem_in_subset()

static bool ug::grid_global_debug_info_provider::elem_in_subset ( GridObject elem,
int  si 
)
inlinestatic

checks if an element is in a subset

Parameters
elemthe element to check
sisubset index to check

References the_object.

◆ elem_in_subsets()

static bool ug::grid_global_debug_info_provider::elem_in_subsets ( GridObject elem,
std::vector< int >  si_ar 
)
inlinestatic

checks if an element is in subsets from a list

Parameters
elemthe element to check
si_arsubset indices to check

References the_object.

Member Data Documentation

◆ m_pGrid

grid_type* ug::grid_global_debug_info_provider::m_pGrid
private

current grid

◆ m_pSH

ISubsetHandler* ug::grid_global_debug_info_provider::m_pSH
private

current SubsetHandler to use

◆ the_object

std::unique_ptr< grid_global_debug_info_provider > ug::grid_global_debug_info_provider::the_object
staticprivate

Pointer to the single (if any) object of the grid debug info provider.

Referenced by ass_elem_in_subset(), ass_elem_in_subsets(), create(), elem_in_subset(), and elem_in_subsets().


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