ug4
log util

Functions

template<class TElem >
static bool ug::CheckDistributedObjectConstraintTypes (MultiGrid &mg)
 Checks whether distributed objects have the same type on all processes. More...
 
bool ug::CheckDistributedParentTypes (MultiGrid &mg)
 Check whether local parent types match the type of the actual parent element. More...
 
bool ug::CheckHangingNodeConsistency (Grid &g)
 checks whether all constraining and constrained objects are correctly connected. More...
 
bool ug::CheckHangingNodeConsistency (MultiGrid &mg)
 checks whether a multigrid is a valid haging vertex grid. More...
 
void ug::CheckMultiGridConsistency (MultiGrid &mg)
 Checks whether parent child connections in a multi-grid are correct. More...
 
template<class TElem >
int ug::GetGridObjectIndex (Grid &g, TElem *elem)
 returns the index of the given element in the given grid. More...
 
template<class TGeomObj >
void ug::PrintAttachmentInfo (Grid &grid)
 prints information on all attachments of the specified grid More...
 
void ug::PrintElementNumbers (const GridObjectCollection &goc)
 prints how many elements of each type exist in the goc. More...
 
void ug::PrintGridElementNumbers (Grid &grid)
 prints how many elements of each type exist in the grid. More...
 
void ug::PrintGridElementNumbers (GridSubsetHandler &sh)
 prints how many elements of each type exist in the subset handler. More...
 
void ug::PrintGridElementNumbers (MultiGrid &mg)
 prints how many elements of each type exist in the multi grid. More...
 
template<class TElem , class TAValue >
void ug::WriteDebugValuesToFile (const char *filename, Grid &grid, TAValue &aVal, bool levelWise)
 Writes level and center of each object together with a custom value to a file. More...
 
template<class TElem >
vector3 ug::GetGridObjectCenter (Grid &g, TElem *elem)
 Returns the center of the given element (SLOW - for debugging only!) More...
 
vector3 ug::GetGridObjectCenter (Grid &g, GridObject *elem)
 Returns the center of the given element (SLOW - for debugging only!) More...
 
bool ug::CheckElementConsistency (MultiGrid &mg, Vertex *v)
 Checks whether associated elements and associated constrained/constraining objects are fine. More...
 
bool ug::CheckElementConsistency (MultiGrid &mg, Edge *e)
 Checks whether associated elements and associated constrained/constraining objects are fine. More...
 
bool ug::CheckElementConsistency (MultiGrid &mg, Face *f)
 Checks whether associated elements and associated constrained/constraining objects are fine. More...
 
std::string ug::ElementDebugInfo (const Grid &grid, GridObject *e)
 Returns a string containing information on the given element. More...
 

Detailed Description

Methods that log informations on grids, subset-handlers, ...

Function Documentation

◆ CheckDistributedObjectConstraintTypes()

template<class TElem >
bool ug::CheckDistributedObjectConstraintTypes ( MultiGrid mg)
static

Checks whether distributed objects have the same type on all processes.

Especially when constrained / constraining objects are present in a grid, it may be useful to check the types if errors occur during refinement / distribution.

Returns
true if all object types match, false if not.

References ug::Grid::attach_to(), ug::MultiGrid::begin(), pcl::InterfaceCommunicator< TLayout >::communicate(), ug::CT_CONSTRAINED, ug::CT_CONSTRAINING, ug::CT_NONE, ug::Grid::detach_from(), ug::Grid::distributed_grid_manager(), ug::MultiGrid::end(), pcl::InterfaceCommunicator< TLayout >::exchange_data(), ug::MultiGrid::get_level(), ug::GetGridObjectCenter(), ug::DistributedGridManager::grid_layout_map(), ug::INT_H_MASTER, ug::INT_H_SLAVE, ug::INT_V_MASTER, ug::INT_V_SLAVE, PCL_RO_BOR, and UG_LOG.

Referenced by ug::bridge::RegisterGridBridge_Debug().

◆ CheckDistributedParentTypes()

bool ug::CheckDistributedParentTypes ( MultiGrid mg)

Check whether local parent types match the type of the actual parent element.

References pcl::AllProcsTrue(), ug::ComPol_CheckDistributedParentStates< TLayout >::exchange_data(), and UG_LOG.

Referenced by ug::bridge::RegisterGridBridge_Debug().

◆ CheckElementConsistency() [1/3]

◆ CheckElementConsistency() [2/3]

bool ug::CheckElementConsistency ( MultiGrid mg,
Face f 
)

Checks whether associated elements and associated constrained/constraining objects are fine.

References ug::Grid::associated_elements(), ug::GetGridObjectCenter(), ug::GridObject::is_constrained(), ug::GridObject::is_constraining(), ug::PointerConstArray< TPtr >::size(), and UG_LOG.

Referenced by ug::CheckElementConsistency().

◆ CheckElementConsistency() [3/3]

bool ug::CheckElementConsistency ( MultiGrid mg,
Vertex v 
)

Checks whether associated elements and associated constrained/constraining objects are fine.

References ug::ConstrainedVertex::get_constraining_object(), ug::MultiGrid::get_parent(), ug::GetGridObjectCenter(), ug::GridObject::is_constrained(), UG_ASSERT, and UG_LOG.

Referenced by ug::bridge::RegisterGridBridge_Debug().

◆ CheckHangingNodeConsistency() [1/2]

◆ CheckHangingNodeConsistency() [2/2]

◆ CheckMultiGridConsistency()

void ug::CheckMultiGridConsistency ( MultiGrid mg)

Checks whether parent child connections in a multi-grid are correct.

Referenced by ug::bridge::RegisterGridBridge_Debug().

◆ ElementDebugInfo()

std::string ug::ElementDebugInfo ( const Grid grid,
GridObject e 
)

Returns a string containing information on the given element.

The string contains the position and level of the element, whether it is normal, constrained or constraining, and its assigned and actual parent types. In parallel the interface states are also returned.

This method is intended for use in UG_ASSERT or UG_THROW to print additional information on an element for which a problem occurred.

Returns
string containing gathered information on the given element

References ug::GridObject::base_object_id(), ug::EDGE, ug::ElementDebugInfo_IMPL(), ug::FACE, ug::VERTEX, and ug::VOLUME.

Referenced by ug::AdaptionSurfaceGridFunction< TDomain >::ValueAccessor::access_closure(), ug::AdaptionSurfaceGridFunction< TDomain >::ValueAccessor::access_inner(), ug::StdTransfer< TDomain, TAlgebra >::assemble_prolongation_p1(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::calc_error(), ug::CalculateSmoothCreaseManifoldPosInParentLevelLoopScheme(), ug::CalculateSmoothManifoldPosInParentLevelButterflyScheme(), ug::CalculateSmoothManifoldPosInParentLevelLoopScheme(), ug::DoFDistribution::check_subsets(), ug::CheckForUnconnectedSidesIMPL(), ug::CheckGFValuesWithinBounds(), ug::CollectConstraining(), ug::AdaptionSurfaceGridFunction< TDomain >::copy_to_surface(), ug::CreateLayoutsFromDistInfos(), ug::GlobalGridFunctionGradientData< TGridFunction >::evaluate(), ug::ComPol_NewConstrainedVerticals< TLayout >::extract(), ug::interpolate_from_original_fct(), ug::ExpectedErrorMarkingStrategy< TDomain >::mark(), ug::SurfaceView::mark_shadowing(), ug::MultiEdgeSplit(), ug::HangingNodeRefiner_MultiGrid::perform_coarsening(), ug::PostProcessDistInfos(), ug::HangingNodeRefinerBase< TSelector >::refine_face_with_normal_vertex(), ug::SerializeMultiGridElements(), and ug::PeriodicBoundaryManager::validity_check().

◆ GetGridObjectCenter() [1/2]

vector3 ug::GetGridObjectCenter ( Grid g,
GridObject elem 
)
inline

Returns the center of the given element (SLOW - for debugging only!)

Caution: This method is pretty slow and should only be used for debugging purposes. It only works if one of the standard position attachments aPosition, aPosition2 or aPosition1 is attached to the vertices of g.

The method returns the center of the specified element in a vector3 structure, regardless of the actual dimension of the position attachment. Unused coordinates are set to 0.

TElem has to be derived from GridObject

References ug::GridObject::base_object_id(), ug::EDGE, ug::FACE, ug::GetGridObjectCenter(), UG_THROW, ug::VERTEX, and ug::VOLUME.

◆ GetGridObjectCenter() [2/2]

template<class TElem >
vector3 ug::GetGridObjectCenter ( Grid g,
TElem *  elem 
)

Returns the center of the given element (SLOW - for debugging only!)

Caution: This method is pretty slow and should only be used for debugging purposes. It only works if one of the standard position attachments aPosition, aPosition2 or aPosition1 is attached to the vertices of g.

The method returns the center of the specified element in a vector3 structure, regardless of the actual dimension of the position attachment. Unused coordinates are set to 0.

TElem has to be derived from GridObject

References ug::aPosition, ug::aPosition1, ug::aPosition2, ug::CalculateCenter(), ug::Grid::has_vertex_attachment(), and UG_LOG.

Referenced by ug::GlobalFracturedMediaRefiner::assign_elem_and_side_marks(), ug::PeriodicBoundaryManager::check_elements_periodicity(), ug::CheckDistributedObjectConstraintTypes(), ug::CheckElementConsistency(), ug::CheckHangingNodeConsistency(), ug::CheckLocalParentTypes(), ug::ComPol_NewConstrainedVerticals< TLayout >::create_initial_hash_entry(), ug::ElementDebugInfo_IMPL(), ug::ComPol_CheckDistributedParentStates< TLayout >::extract(), ug::GetGridObjectCenter(), ug::PeriodicBoundaryManager::print_identification(), ug::StdHNodeAdjuster::ref_marks_changed(), ug::HangingNodeRefinerBase< TSelector >::refine_volume_with_normal_vertex(), and ug::WriteDebugValuesToFile().

◆ GetGridObjectIndex()

template<class TElem >
int ug::GetGridObjectIndex ( Grid g,
TElem *  elem 
)

returns the index of the given element in the given grid.

Runtime O(n). Returns -1 if the element could not be found.

Note
: The all elements of the same base-type are considered during counting.

References ug::Grid::begin(), and ug::Grid::end().

◆ PrintAttachmentInfo()

◆ PrintElementNumbers()

void ug::PrintElementNumbers ( const GridObjectCollection goc)

prints how many elements of each type exist in the goc.

References ug::GridObjectCollection::num(), ug::GridObjectCollection::num_levels(), and UG_LOG.

Referenced by ug::PrintGridElementNumbers().

◆ PrintGridElementNumbers() [1/3]

void ug::PrintGridElementNumbers ( Grid grid)

prints how many elements of each type exist in the grid.

References ug::Grid::get_grid_objects(), and ug::PrintElementNumbers().

Referenced by ug::bridge::RegisterGridBridge_Misc().

◆ PrintGridElementNumbers() [2/3]

void ug::PrintGridElementNumbers ( GridSubsetHandler sh)

prints how many elements of each type exist in the subset handler.

References ug::GridSubsetHandler::get_grid_objects(), and ug::PrintElementNumbers().

◆ PrintGridElementNumbers() [3/3]

void ug::PrintGridElementNumbers ( MultiGrid mg)

prints how many elements of each type exist in the multi grid.

References ug::MultiGrid::get_grid_objects(), and ug::PrintElementNumbers().

◆ WriteDebugValuesToFile()

template<class TElem , class TAValue >
void ug::WriteDebugValuesToFile ( const char *  filename,
Grid grid,
TAValue &  aVal,
bool  levelWise 
)