33 #ifndef __H__UG__debug_util_impl__
34 #define __H__UG__debug_util_impl__
46 template <
class TElem>
56 return vector3(v.x(), v.y(), 0);
64 UG_LOG(
"GetGridObjectCenter failed! No standard position attachment found.\n");
76 default:
UG_THROW(
"Unknown base object type.");
82 template <
class TElem>
89 iter != g.
end<TBase>(); ++iter, ++counter)
97 template <
class TElem,
class TAValue>
99 TAValue& aVal,
bool levelWise)
103 std::ofstream out(filename);
110 table(0, 0) <<
"lvl"; table(0, 1) <<
"center"; table(0, 2) <<
"value";
115 for(
size_t lvl = 0; lvl < goc.
num_levels(); ++lvl){
117 iter != goc.
end<TElem>(lvl); ++iter, ++row)
119 table(row, 0) << lvl;
121 table(row, 2) << aaVal[*iter];
128 iter != grid.
end<TElem>(); ++iter, ++row)
132 table(row, 2) << aaVal[*iter];
137 iter != grid.
end<TElem>(); ++iter, ++row)
141 table(row, 2) << aaVal[*iter];
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
the generic attachment-accessor for access to grids attachment pipes.
Definition: grid.h:182
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
size_t num() const
Definition: grid_impl.hpp:230
virtual GridObjectCollection get_grid_objects()
returns the the GridObjectCollection of the grid:
Definition: grid.cpp:527
geometry_traits< TGeomObj >::iterator begin()
Definition: grid_impl.hpp:164
bool has_vertex_attachment(IAttachment &attachment)
Definition: grid.h:798
geometry_traits< TGeomObj >::iterator end()
Definition: grid_impl.hpp:175
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
geometry_traits< TGeomObj >::iterator begin(size_t level=0)
Definition: grid_object_collection_impl.hpp:95
geometry_traits< TGeomObj >::iterator end(size_t level=0)
Definition: grid_object_collection_impl.hpp:106
size_t num_levels() const
returns the number of levels
Definition: grid_object_collection.h:128
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
virtual int base_object_id() const =0
Definition: multi_grid.h:72
int get_level(TElem *elem) const
Definition: multi_grid.h:206
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
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
int GetGridObjectIndex(Grid &g, TElem *elem)
returns the index of the given element in the given grid.
Definition: debug_util_impl.hpp:83
vector3 GetGridObjectCenter(Grid &g, TElem *elem)
Returns the center of the given element (SLOW - for debugging only!)
Definition: debug_util_impl.hpp:47
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
void CalculateCenter(vector_t ¢erOut, const vector_t *pointSet, size_t numPoints)
calculates the center of a point-set
Definition: math_util_impl.hpp:98
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
APosition1 aPosition1("position2", true)
The standard 1d position type.
Definition: common_attachments.h:90
@ VOLUME
Definition: grid_base_objects.h:63
@ VERTEX
Definition: grid_base_objects.h:60
@ EDGE
Definition: grid_base_objects.h:61
@ FACE
Definition: grid_base_objects.h:62
APosition aPosition("position", true)
The standard 3d position type.
Definition: common_attachments.h:84
APosition2 aPosition2("position2", true)
The standard 2d position type.
Definition: common_attachments.h:87
TElem::grid_base_object base_object
Definition: grid.h:137
geometry_traits< TElem >::iterator iterator
Definition: grid.h:143