ug4
|
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 SubsetGroup & | subset_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_type > | m_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< MultiGridSubsetHandler > | m_spSH |
Subset handler to use. More... | |
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:
References:
dim | (topological) dimensionality of the grid |
typedef grid_dim_traits<dim>::grid_base_object ug::DegeneratedLayerManager< dim >::element_type |
base grid element object type
typedef Attachment<signed char> ug::DegeneratedLayerManager< dim >::mark_attachment_type |
type of the attachment for the marks
typedef grid_dim_traits<dim>::side_type ug::DegeneratedLayerManager< dim >::side_type |
grid element's side base object type
enum ug::DegeneratedLayerManager::t_grid_object_mark |
ug::DegeneratedLayerManager< dim >::DegeneratedLayerManager | ( | SmartPtr< MultiGridSubsetHandler > | spSH | ) |
Constructor.
Class constructor: Parses the subset names, attaches itself to the grid to be updated if the grid is refined, and writes itself to the properties of the subsets.
[in] | spSH | subset handler of the grid |
References ug::DegeneratedLayerManager< dim >::D_LAYER_UNKNOWN, ug::DegeneratedLayerManager< dim >::m_aaVertMarks, ug::DegeneratedLayerManager< dim >::m_aVertexMarks, ug::DegeneratedLayerManager< dim >::m_layerSsGrp, ug::DegeneratedLayerManager< dim >::m_spGridAdaptionCallbackID, ug::DegeneratedLayerManager< dim >::m_spGridDistributionCallbackID, ug::DegeneratedLayerManager< dim >::m_spSH, ug::Grid::message_hub(), ug::SubsetGroup::set_subset_handler(), and UG_THROW.
|
virtual |
Destructor.
Class destructor: Detaches the attachment.
void ug::DegeneratedLayerManager< dim >::add | ( | const char * | ss_names | ) |
Adds a fracture subdomain.
Adds subsets to the manager
[in] | ss_names | subset names of the fractures |
References ug::TokenizeString(), and UG_LOG.
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.
layer_ss_name | subset name of the layer |
middle_ss_name | name of the subset to assign |
References UG_THROW.
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.
layer_si | subset index of the layer |
middle_ss_name | name of the subset to assign |
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.
layer_si | subset index of the layer |
middle_si | the 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().
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.
|
inline |
Whether a subset is registered in the manager.
[in] | si | subset index |
References ug::SubsetGroup::contains(), and ug::DegeneratedLayerManager< dim >::m_layerSsGrp.
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).
[in] | elem | the element |
[out] | num_side_co | number of corners of the inner/outer sides |
[out] | inner_side | its fracture inner side |
[out] | inner_side_idx | index of the inner side in the reference element |
[out] | inner_side_corners | inner side corner idx -> elem. corner idx (maxLayerSideCorners elements) |
[out] | outer_side | its fracture outer side |
[out] | outer_side_idx | index of the outer side in the reference element |
[out] | outer_side_corners | outer side corner idx -> elem. corner idx (maxLayerSideCorners elements) |
[out] | ass_co | correspondence 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().
|
protected |
Called when a grid adaption has been performed.
The grid adaption callback: Catches the messages about grid refinements, ...
msg | the message from the message hub |
References ug::GridMessage_Adaption::adaption_ends().
|
protected |
Called when a grid has been distributed between different processes.
The grid adaption callback: Catches the messages about the distribution of the grid
msg | the message from the message hub |
References ug::GMDT_DISTRIBUTION_STOPS, and ug::GridMessage_Distribution::msg().
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
refiner | the refiner |
as_low_dim | whether it should consider the fractures as low-dimentional |
References UG_THROW.
|
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().
|
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.
|
inline |
Number of subsets in the manager.
References ug::DegeneratedLayerManager< dim >::m_layerSsGrp, and ug::SubsetGroup::size().
void ug::DegeneratedLayerManager< dim >::remove | ( | const char * | ss_names | ) |
Removes a fracture subdomain (e.g. for dimension-adaptive method)
Removes subsets from the manager
[in] | ss_names | subset names of the fractures |
References ug::TokenizeString().
|
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.
|
inline |
Returns the subset group of the fracture network.
References ug::DegeneratedLayerManager< dim >::m_layerSsGrp.
|
inline |
Returs the mark of a vertex.
References ug::DegeneratedLayerManager< dim >::m_aaVertMarks.
|
private |
Attachment accessor.
Referenced by ug::DegeneratedLayerManager< dim >::DegeneratedLayerManager(), and ug::DegeneratedLayerManager< dim >::vert_mark().
|
private |
Attachment keeping the grid object marks for the vertices.
Referenced by ug::DegeneratedLayerManager< dim >::DegeneratedLayerManager().
|
private |
'closed'-flag
Referenced by ug::DegeneratedLayerManager< dim >::is_closed().
|
private |
Subset group of the fractures.
Referenced by ug::DegeneratedLayerManager< dim >::contains(), ug::DegeneratedLayerManager< dim >::DegeneratedLayerManager(), ug::DegeneratedLayerManager< dim >::num_subsets(), ug::DegeneratedLayerManager< dim >::subset(), and ug::DegeneratedLayerManager< dim >::subset_grp().
|
private |
|
private |
|
private |
Subset handler to use.
Referenced by ug::DegeneratedLayerManager< dim >::DegeneratedLayerManager().
|
static |
max. number of corners of the elements
|
static |
max. number of corners of non-degenerated sides