33 #ifndef __H__UG__GRID_STATISTICS__
34 #define __H__UG__GRID_STATISTICS__
58 AInt& aTetrahedronAspectRatioClass,
59 std::vector<double>& offsets,
60 Grid::VertexAttachmentAccessor<APosition>& aaPos);
71 template <
class TIterator>
73 TIterator elemsBegin, TIterator elemsEnd,
74 std::vector<number> intervals)
76 if(intervals.empty()){
85 for(TIterator iter = elemsBegin; iter != elemsEnd; ++iter)
91 for(
size_t i = 0; i < intervals.size(); ++i){
92 if(intervals[i] < quality)
104 template <
class TIterator,
class TAAPos>
111 "Can't evaluate anisotropy statistics for vertices or edges.");
118 vector<number> ratios;
119 for(TIterator i_elem = elemsBegin; i_elem != elemsEnd; ++i_elem){
120 elem_t* elem = *i_elem;
128 number shortest = numeric_limits<double>::max();
132 shortest = min(shortest, l);
133 longest = max(longest, l);
138 ratio = shortest / longest;
140 minRatio = min(minRatio, ratio);
141 maxRatio = max(maxRatio, ratio);
143 ratios.push_back(ratio);
146 int num = (int)ratios.size();
160 UG_LOG(
"min: " << minRatio <<
", max: " << maxRatio <<
", av: " << avRatio);
164 for(
size_t i = 0; i < ratios.size(); ++i)
165 sdSum +=
sq(avRatio - ratios[i]);
Definition: pcl_process_communicator.h:70
void allreduce(const void *sendBuf, void *recBuf, int count, DataType type, ReduceOperation op) const
performs MPI_Allreduce on the processes of the communicator.
Definition: pcl_process_communicator.cpp:318
bool is_ghost(TElem *elem) const
returns true if the element is a ghost
Definition: distributed_grid_impl.hpp:67
Base-class for edges.
Definition: grid_base_objects.h:397
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
DistributedGridManager * distributed_grid_manager()
returns a pointer to the associated distributed grid manager.
Definition: grid_impl.hpp:53
void associated_elements(traits< Vertex >::secure_container &elemsOut, TElem *e)
Puts all elements of type TAss which are contained in 'e' or which contain 'e' into elemsOut.
Definition: grid_impl.hpp:466
Partitions elements of a grid into several subsets.
Definition: subset_handler_grid.h:53
void assign_subset(Vertex *elem, int subsetIndex)
assigns a vertex to a subset.
Definition: subset_handler_grid.cpp:204
Container which holds an array of pointers.
Definition: pointer_const_array.h:84
static void PrintElementEdgeRatios(TDomain &dom)
Definition: domain_bridge.cpp:365
UG_API number EdgeLength(const EdgeVertices *e, TAAPosVRT &aaPos)
Calculates the length of the given edge.
Definition: edge_util_impl.hpp:80
number FaceQuality(FaceVertices *f, Grid::VertexAttachmentAccessor< APosition > aaPos)
a simple measure for the quality of a face
Definition: face_util.cpp:203
#define PCL_RO_SUM
Definition: pcl_methods.h:63
#define PCL_RO_MAX
Definition: pcl_methods.h:61
#define PCL_RO_MIN
Definition: pcl_methods.h:62
#define UG_LOG(msg)
Definition: log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
double number
Definition: types.h:124
TNumber sq(TNumber val)
returns the square of a value (val*val)
Definition: math_util_impl.hpp:91
Definition: smart_pointer.h:814
GridSubsetHandler SubsetHandler
Definition: subset_handler_grid.h:376
Attachment< int > AInt
Definition: common_attachments.h:55
bool AssignTetrahedronAttributesByAspectRatio(Grid &grid, SubsetHandler &shVolume, AInt &aTetrahedronAspectRatioClass, vector< double > &offsets, Grid::VertexAttachmentAccessor< APosition > &aaPos)
assigns attributes to tetrahedral elements of a grid respecting their aspect ratio
Definition: grid_statistics.cpp:54
@ VERTEX
Definition: grid_base_objects.h:60
@ EDGE
Definition: grid_base_objects.h:61
APosition aPosition("position", true)
The standard 3d position type.
Definition: common_attachments.h:84
bool AssignSubsetsByQuality(Grid &grid, SubsetHandler &sh, TIterator elemsBegin, TIterator elemsEnd, std::vector< number > intervals)
assigns a subset based on the quality of the given element.
Definition: grid_statistics.h:72
T value_type
Definition: sparsematrix_interface.h:2
void base_type
Definition: grid_base_objects.h:1011
#define for_each_in_vec(_vfeDecl, _vfeVec)
Allows iteration over all members of an std::vector compatible type.
Definition: vec_for_each.h:52
#define end_for
Allows iteration over all members of an std::vector compatible type.
Definition: vec_for_each.h:56