ug4
ug::DegeneratedLayerManager< dim > Class Template Reference

Gegenerated layer subset manager. More...

#include <deg_layer_mngr.h>

Public Types

typedef grid_dim_traits< dim >::grid_base_object element_type
 base grid element object type More...
 
typedef Attachment< signed char > mark_attachment_type
 type of the attachment for the marks More...
 
typedef grid_dim_traits< dim >::side_type side_type
 grid element's side base object type More...
 
enum  t_grid_object_mark { D_LAYER_UNKNOWN = -1 , D_LAYER_OUTER = 0 , D_LAYER_INNER = 1 }
 Marks for the grid vertices. More...
 

Public Member Functions

void add (const char *ss_names)
 Adds a fracture subdomain. More...
 
int assign_middle_subset (const char *layer_ss_name, const char *middle_ss_name)
 Assigns a different subset to the inner sides of a layer. More...
 
int assign_middle_subset (int layer_si, const char *middle_ss_name)
 Assigns a different subset to the inner sides of a layer. More...
 
int assign_middle_subset (int layer_si, int middle_si=-1)
 Assigns a different subset index to the inner sides of a layer. More...
 
void close ()
 Closes the manager, i.e. computes all the data, ... More...
 
bool contains (int si)
 Whether a subset is registered in the manager. More...
 
 DegeneratedLayerManager (SmartPtr< MultiGridSubsetHandler > spSH)
 Constructor. More...
 
void get_layer_sides (element_type *elem, size_t &num_fract_co, side_type *&inner_side, size_t &inner_side_idx, size_t inner_side_corners[], side_type *&outer_side, size_t &outer_side_idx, size_t outer_side_corners[], size_t ass_co[]=NULL)
 Gets the inner and the outer fracture sides of an element. More...
 
void init_refiner (SmartPtr< GlobalFracturedMediaRefiner > refiner, bool as_low_dim)
 Initializes a refiner with the fracture subsets. More...
 
bool is_closed ()
 Returns true if the manager is closed (and can be used) or false otherwise. More...
 
size_t num_subsets ()
 Number of subsets in the manager. More...
 
void remove (const char *ss_names)
 Removes a fracture subdomain (e.g. for dimension-adaptive method) More...
 
int subset (size_t i)
 Subset no. i in the manager (only if the manager is closed) More...
 
const SubsetGroupsubset_grp ()
 Returns the subset group of the fracture network. More...
 
int vert_mark (Vertex *vrt)
 Returs the mark of a vertex. More...
 
virtual ~DegeneratedLayerManager ()
 Destructor. More...
 

Static Public Attributes

static const size_t maxElemCorners = grid_dim_traits<dim>::MaxNumVerticesOfElem
 max. number of corners of the elements More...
 
static const size_t maxLayerSideCorners = maxElemCorners / 2
 max. number of corners of non-degenerated sides More...
 

Protected Member Functions

void grid_adaption_callback (const GridMessage_Adaption &msg)
 Called when a grid adaption has been performed. More...
 
void grid_distribution_callback (const GridMessage_Distribution &msg)
 Called when a grid has been distributed between different processes. More...
 
void mark_vertices ()
 Marks the inner fracture vertices. More...
 

Private Attributes

MultiGrid::AttachmentAccessor< Vertex, mark_attachment_typem_aaVertMarks
 Attachment accessor. More...
 
mark_attachment_type m_aVertexMarks
 Attachment keeping the grid object marks for the vertices. More...
 
bool m_bClosed
 'closed'-flag More...
 
SubsetGroup m_layerSsGrp
 Subset group of the fractures. More...
 
MessageHub::SPCallbackId m_spGridAdaptionCallbackID
 
MessageHub::SPCallbackId m_spGridDistributionCallbackID
 
SmartPtr< MultiGridSubsetHandlerm_spSH
 Subset handler to use. More...
 

Detailed Description

template<int dim>
class ug::DegeneratedLayerManager< dim >

Gegenerated layer subset manager.

Class for the manager of the degenerated layer (e.g. fracture) subsets. Note that the object of the class should get ALL the subsets that belong to ALL the degenerated layers in the domain. This object gets updated every time the grid is refined.

Usage instructions:

Remarks:

  • The grid must be created (loaded) before the object is created.
  • All the degenerated layer subsets must be registered in the same degenerated layer manager. There should exist only one such the manager at all. Alternatively, the different managers must hold groups of the layers that are not intersect or connected to each other. But every degenerated subset must be registered in one of the degenerated layer managers.

References:

  • S. Reiter, D. Logashenko, A. Grillo, G. Wittum, Preparation of grids for simulations of groundwater flow in fractured porous media, Computing and Visualization in Science, Vol. 15, No. 4 (2012), pp. 209-225, DOI: 10.1007/s00791-013-0210-7
Template Parameters
dim(topological) dimensionality of the grid

Member Typedef Documentation

◆ element_type

template<int dim>
typedef grid_dim_traits<dim>::grid_base_object ug::DegeneratedLayerManager< dim >::element_type

base grid element object type

◆ mark_attachment_type

template<int dim>
typedef Attachment<signed char> ug::DegeneratedLayerManager< dim >::mark_attachment_type

type of the attachment for the marks

◆ side_type

grid element's side base object type

Member Enumeration Documentation

◆ t_grid_object_mark

Marks for the grid vertices.

Enumerator
D_LAYER_UNKNOWN 
D_LAYER_OUTER 
D_LAYER_INNER 

Constructor & Destructor Documentation

◆ DegeneratedLayerManager()

◆ ~DegeneratedLayerManager()

Destructor.

Class destructor: Detaches the attachment.

Member Function Documentation

◆ add()

template<int dim>
void ug::DegeneratedLayerManager< dim >::add ( const char *  ss_names)

Adds a fracture subdomain.

Adds subsets to the manager

Parameters
[in]ss_namessubset names of the fractures

References ug::TokenizeString(), and UG_LOG.

◆ assign_middle_subset() [1/3]

template<int dim>
int ug::DegeneratedLayerManager< dim >::assign_middle_subset ( const char *  layer_ss_name,
const char *  middle_ss_name 
)

Assigns a different subset to the inner sides of a layer.

Assigns a different subset to the inner sides of a layer. (Only to the sides, not vertices, or edges in 3d!) If the given subset does not exist, it is created. The function returns the index of the assigned subset.

Parameters
layer_ss_namesubset name of the layer
middle_ss_namename of the subset to assign

References UG_THROW.

◆ assign_middle_subset() [2/3]

template<int dim>
int ug::DegeneratedLayerManager< dim >::assign_middle_subset ( int  layer_si,
const char *  middle_ss_name 
)

Assigns a different subset to the inner sides of a layer.

Assigns a different subset to the inner sides of a layer. (Only to the sides, not vertices, or edges in 3d!) If the given subset does not exist, it is created. The function returns the index of the assigned subset.

Parameters
layer_sisubset index of the layer
middle_ss_namename of the subset to assign

◆ assign_middle_subset() [3/3]

template<int dim>
int ug::DegeneratedLayerManager< dim >::assign_middle_subset ( int  layer_si,
int  middle_si = -1 
)

Assigns a different subset index to the inner sides of a layer.

Assigns a different subset index to the inner sides of a layer. (Only to the sides, not vertices, or edges in 3d!) If -1 passed instead of the index of the subset to assign, new subset is created. The function returns the index of the assigned subset.

Parameters
layer_sisubset index of the layer
middle_sithe subset index to assign (or -1 to create a new subset)

References ug::GMCT_CREATION_STARTS, ug::GMCT_CREATION_STOPS, ug::Grid::message_hub(), ug::MultiGrid::num_levels(), and ug::MessageHub::post_message().

◆ close()

template<int dim>
void ug::DegeneratedLayerManager< dim >::close

Closes the manager, i.e. computes all the data, ...

Closes the manager: Computes the vertex marks

References dim, ug::DimensionOfSubset(), UG_LOG, and UG_THROW.

◆ contains()

template<int dim>
bool ug::DegeneratedLayerManager< dim >::contains ( int  si)
inline

Whether a subset is registered in the manager.

Parameters
[in]sisubset index

References ug::SubsetGroup::contains(), and ug::DegeneratedLayerManager< dim >::m_layerSsGrp.

◆ get_layer_sides()

template<int dim>
void ug::DegeneratedLayerManager< dim >::get_layer_sides ( element_type elem,
size_t &  num_side_co,
side_type *&  inner_side,
size_t &  inner_side_idx,
size_t  inner_side_corners[],
side_type *&  outer_side,
size_t &  outer_side_idx,
size_t  outer_side_corners[],
size_t  ass_co[] = NULL 
)

Gets the inner and the outer fracture sides of an element.

For a given element, finds its inner and outer layer sides. For these sides, gets the correspondence of the vertices in the degenerated element (i.e. considering all other sides as degenerated).

Parameters
[in]elemthe element
[out]num_side_conumber of corners of the inner/outer sides
[out]inner_sideits fracture inner side
[out]inner_side_idxindex of the inner side in the reference element
[out]inner_side_cornersinner side corner idx -> elem. corner idx (maxLayerSideCorners elements)
[out]outer_sideits fracture outer side
[out]outer_side_idxindex of the outer side in the reference element
[out]outer_side_cornersouter side corner idx -> elem. corner idx (maxLayerSideCorners elements)
[out]ass_cocorrespondence of the corners of the sides (2 * maxLayerSideCorners elements or NULL)

References ug::Grid::associated_elements(), ug::Grid::get_side(), ug::PointerConstArray< TPtr >::size(), UG_THROW, and ug::EdgeVertices::vertex().

◆ grid_adaption_callback()

template<int dim>
void ug::DegeneratedLayerManager< dim >::grid_adaption_callback ( const GridMessage_Adaption msg)
protected

Called when a grid adaption has been performed.

The grid adaption callback: Catches the messages about grid refinements, ...

Parameters
msgthe message from the message hub

References ug::GridMessage_Adaption::adaption_ends().

◆ grid_distribution_callback()

template<int dim>
void ug::DegeneratedLayerManager< dim >::grid_distribution_callback ( const GridMessage_Distribution msg)
protected

Called when a grid has been distributed between different processes.

The grid adaption callback: Catches the messages about the distribution of the grid

Parameters
msgthe message from the message hub

References ug::GMDT_DISTRIBUTION_STOPS, and ug::GridMessage_Distribution::msg().

◆ init_refiner()

template<int dim>
void ug::DegeneratedLayerManager< dim >::init_refiner ( SmartPtr< GlobalFracturedMediaRefiner refiner,
bool  as_low_dim 
)

Initializes a refiner with the fracture subsets.

Adds the registered subsets to the refiner

Parameters
refinerthe refiner
as_low_dimwhether it should consider the fractures as low-dimentional

References UG_THROW.

◆ is_closed()

template<int dim>
bool ug::DegeneratedLayerManager< dim >::is_closed ( )
inline

Returns true if the manager is closed (and can be used) or false otherwise.

References ug::DegeneratedLayerManager< dim >::m_bClosed.

Referenced by ug::DegeneratedLayerManager< dim >::subset().

◆ mark_vertices()

template<int dim>
void ug::DegeneratedLayerManager< dim >::mark_vertices
protected

Marks the inner fracture vertices.

Marks the vertices in such a way that the inner layer vertices are marked with D_LAYER_INNER, whereas all other vertices (at the fractures and in the bulk medium) are marked with D_LAYER_OUTER. After the call, there should be no vertices marked with D_LAYER_UNKNOWN.

References dim, ug::DimensionOfSubset(), ug::GridObject::is_constrained(), ug::MultiGrid::num_levels(), and PCL_RO_MIN.

◆ num_subsets()

template<int dim>
size_t ug::DegeneratedLayerManager< dim >::num_subsets ( )
inline

Number of subsets in the manager.

References ug::DegeneratedLayerManager< dim >::m_layerSsGrp, and ug::SubsetGroup::size().

◆ remove()

template<int dim>
void ug::DegeneratedLayerManager< dim >::remove ( const char *  ss_names)

Removes a fracture subdomain (e.g. for dimension-adaptive method)

Removes subsets from the manager

Parameters
[in]ss_namessubset names of the fractures

References ug::TokenizeString().

◆ subset()

template<int dim>
int ug::DegeneratedLayerManager< dim >::subset ( size_t  i)
inline

Subset no. i in the manager (only if the manager is closed)

References ug::DegeneratedLayerManager< dim >::is_closed(), ug::DegeneratedLayerManager< dim >::m_layerSsGrp, and UG_THROW.

◆ subset_grp()

template<int dim>
const SubsetGroup& ug::DegeneratedLayerManager< dim >::subset_grp ( )
inline

Returns the subset group of the fracture network.

References ug::DegeneratedLayerManager< dim >::m_layerSsGrp.

◆ vert_mark()

template<int dim>
int ug::DegeneratedLayerManager< dim >::vert_mark ( Vertex vrt)
inline

Returs the mark of a vertex.

References ug::DegeneratedLayerManager< dim >::m_aaVertMarks.

Member Data Documentation

◆ m_aaVertMarks

◆ m_aVertexMarks

template<int dim>
mark_attachment_type ug::DegeneratedLayerManager< dim >::m_aVertexMarks
private

Attachment keeping the grid object marks for the vertices.

Referenced by ug::DegeneratedLayerManager< dim >::DegeneratedLayerManager().

◆ m_bClosed

template<int dim>
bool ug::DegeneratedLayerManager< dim >::m_bClosed
private

◆ m_layerSsGrp

◆ m_spGridAdaptionCallbackID

template<int dim>
MessageHub::SPCallbackId ug::DegeneratedLayerManager< dim >::m_spGridAdaptionCallbackID
private

◆ m_spGridDistributionCallbackID

template<int dim>
MessageHub::SPCallbackId ug::DegeneratedLayerManager< dim >::m_spGridDistributionCallbackID
private

◆ m_spSH

template<int dim>
SmartPtr<MultiGridSubsetHandler> ug::DegeneratedLayerManager< dim >::m_spSH
private

◆ maxElemCorners

template<int dim>
const size_t ug::DegeneratedLayerManager< dim >::maxElemCorners = grid_dim_traits<dim>::MaxNumVerticesOfElem
static

max. number of corners of the elements

◆ maxLayerSideCorners

template<int dim>
const size_t ug::DegeneratedLayerManager< dim >::maxLayerSideCorners = maxElemCorners / 2
static

max. number of corners of non-degenerated sides


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