ug4
debug_util.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__LIB_GIRD__DEBUG_UTIL__
34 #define __H__UG__LIB_GIRD__DEBUG_UTIL__
35 
36 #include "lib_grid/lg_base.h"
38 
39 namespace ug
40 {
41 
50 void PrintElementNumbers(const GridObjectCollection& goc);
51 
53 void PrintGridElementNumbers(Grid& grid);
54 
56 void PrintGridElementNumbers(MultiGrid& mg);
57 
59 void PrintGridElementNumbers(GridSubsetHandler& sh);
60 
61 
63 void PrintAttachmentInfo(Grid& grid);
64 
65 
66 
68 
80 template <class TElem>
81 vector3 GetGridObjectCenter(Grid& g, TElem* elem);
82 inline vector3 GetGridObjectCenter(Grid& g, GridObject* elem);
87 template <class TElem, class TAValue>
88 void WriteDebugValuesToFile(const char* filename, Grid& grid,
89  TAValue& aVal, bool levelWise);
90 
91 
93 
95 template <class TElem>
96 int GetGridObjectIndex(Grid& g, TElem* elem);
97 
98 
100 void CheckMultiGridConsistency(MultiGrid& mg);
101 
103 bool CheckHangingNodeConsistency(Grid& g);
104 
106 
111 bool CheckHangingNodeConsistency(MultiGrid& mg);
112 
113 
114 
116 
121 bool CheckDistributedObjectConstraintTypes(MultiGrid& mg);
122 
123 
125 bool CheckDistributedParentTypes(MultiGrid& mg);
126 
127 
129 
130 bool CheckElementConsistency(MultiGrid& mg, Vertex* v);
131 bool CheckElementConsistency(MultiGrid& mg, Edge* e);
132 bool CheckElementConsistency(MultiGrid& mg, Face* f);
137 
145 std::string ElementDebugInfo(const Grid& grid, GridObject* e);
149 //void CheckSurfaceViewConsistency(SurfaceView& sv);
150  // end of doxygen defgroup command
152 }// end of namespace
153 
155 // include implementation
156 #include "debug_util_impl.hpp"
157 
158 #endif
void PrintAttachmentInfo(Grid &grid)
prints information on all attachments of the specified grid
Definition: debug_util.cpp:107
void 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.
Definition: debug_util_impl.hpp:98
bool CheckHangingNodeConsistency(Grid &g)
checks whether all constraining and constrained objects are correctly connected.
Definition: debug_util.cpp:264
std::string ElementDebugInfo(const Grid &grid, GridObject *e)
Returns a string containing information on the given element.
Definition: debug_util.cpp:991
bool CheckDistributedParentTypes(MultiGrid &mg)
Check whether local parent types match the type of the actual parent element.
Definition: debug_util.cpp:778
void CheckMultiGridConsistency(MultiGrid &mg)
Checks whether parent child connections in a multi-grid are correct.
Definition: debug_util.cpp:224
int GetGridObjectIndex(Grid &g, TElem *elem)
returns the index of the given element in the given grid.
Definition: debug_util_impl.hpp:83
void PrintElementNumbers(const GridObjectCollection &goc)
prints how many elements of each type exist in the goc.
Definition: debug_util.cpp:47
bool CheckElementConsistency(MultiGrid &mg, Vertex *v)
Checks whether associated elements and associated constrained/constraining objects are fine.
Definition: debug_util.cpp:817
static bool CheckDistributedObjectConstraintTypes(MultiGrid &mg)
Checks whether distributed objects have the same type on all processes.
Definition: debug_util.cpp:569
void PrintGridElementNumbers(Grid &grid)
prints how many elements of each type exist in the grid.
Definition: debug_util.cpp:91
vector3 GetGridObjectCenter(Grid &g, TElem *elem)
Returns the center of the given element (SLOW - for debugging only!)
Definition: debug_util_impl.hpp:47
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
the ug namespace