vtf-logo

quality.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__geom_mesh_simplicial_quality_h__)
00009 #define __geom_mesh_simplicial_quality_h__
00010 
00011 #include "SimpMeshRed.h"
00012 
00013 #include "../iss/quality.h"
00014 
00015 BEGIN_NAMESPACE_GEOM
00016 
00018 
00021 template<int N, int M, typename T,
00022          template<class> class Node,
00023          template<class> class Cell,
00024          template<class,class> class Cont>
00025 void
00026 countAdjacencies(const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh,
00027                  ads::FixedArray<M+2,int>* counts);
00028 
00029 
00031 template<int N, int M, typename T,
00032          template<class> class Node,
00033          template<class> class Cell,
00034          template<class,class> class Cont>
00035 inline
00036 T
00037 computeContent(const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh) {
00038   return computeContent<M,T>(mesh.getSimplicesBeginning(), 
00039                              mesh.getSimplicesEnd());
00040 }
00041 
00042 
00044 template<int N, int M, typename T,
00045          template<class> class Node,
00046          template<class> class Cell,
00047          template<class,class> class Cont>
00048 inline
00049 void
00050 computeContentStatistics(const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh,
00051                          T* minContent, 
00052                          T* maxContent,
00053                          T* meanContent) {
00054   computeContentStatistics<M,T>(mesh.getSimplicesBeginning(), 
00055                                 mesh.getSimplicesEnd(),
00056                                 minContent, maxContent, meanContent);
00057 }
00058 
00059 
00061 template<int N, int M, typename T,
00062          template<class> class Node,
00063          template<class> class Cell,
00064          template<class,class> class Cont>
00065 void
00066 computeEdgeLengthStatistics(const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh,
00067                             T* minLength, T* maxLength, T* meanLength);
00068 
00069 
00071 template<int N, int M, typename T,
00072          template<class> class Node,
00073          template<class> class Cell,
00074          template<class,class> class Cont>
00075 inline
00076 void
00077 printEdgeLengthStatistics(std::ostream& out,
00078                           const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh)
00079 {
00080   T minLength, maxLength, meanLength;
00081   computeEdgeLengthStatistics(mesh, &minLength, &maxLength, &meanLength);
00082   out << "edge lengths:"
00083       << " min = " << minLength
00084       << " max = " << maxLength
00085       << " mean = " << meanLength << "\n";
00086 }
00087 
00088 
00090 template<int N, int M, typename T,
00091          template<class> class Node,
00092          template<class> class Cell,
00093          template<class,class> class Cont>
00094 inline
00095 void
00096 computeDeterminantStatistics(const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh,
00097                              T* minDeterminant, 
00098                              T* maxDeterminant,
00099                              T* meanDeterminant) {
00100   computeDeterminantStatistics<M,T>(mesh.getSimplicesBeginning(), 
00101                                     mesh.getSimplicesEnd(),
00102                                     minDeterminant, 
00103                                     maxDeterminant,
00104                                     meanDeterminant);
00105 }
00106 
00107 
00108 
00110 template<int N, int M, typename T,
00111          template<class> class Node,
00112          template<class> class Cell,
00113          template<class,class> class Cont>
00114 inline
00115 void
00116 computeModifiedMeanRatioStatistics
00117 (const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh,
00118  T* minModifiedMeanRatio, 
00119  T* maxModifiedMeanRatio,
00120  T* meanModifiedMeanRatio) {
00121   computeModifiedMeanRatioStatistics<M,T>(mesh.getSimplicesBeginning(), 
00122                                           mesh.getSimplicesEnd(),
00123                                           minModifiedMeanRatio, 
00124                                           maxModifiedMeanRatio,
00125                                           meanModifiedMeanRatio);
00126 }
00127 
00128 
00129 
00131 template<int N, int M, typename T,
00132          template<class> class Node,
00133          template<class> class Cell,
00134          template<class,class> class Cont>
00135 inline
00136 void
00137 computeModifiedConditionNumberStatistics
00138 (const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh,
00139  T* minModifiedConditionNumber, 
00140  T* maxModifiedConditionNumber,
00141  T* meanModifiedConditionNumber) {
00142   computeModifiedMeanRatioStatistics<M,T>(mesh.getSimplicesBeginning(), 
00143                                           mesh.getSimplicesEnd(),
00144                                           minModifiedConditionNumber, 
00145                                           maxModifiedConditionNumber,
00146                                           meanModifiedConditionNumber);
00147 }
00148 
00149 
00150 
00152 template<int N, int M, typename T,
00153          template<class> class Node,
00154          template<class> class Cell,
00155          template<class,class> class Cont>
00156 inline
00157 void
00158 computeQualityStatistics(const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh,
00159                          T* minContent, 
00160                          T* maxContent,
00161                          T* meanContent,
00162                          T* minDeterminant, 
00163                          T* maxDeterminant,
00164                          T* meanDeterminant,
00165                          T* minModifiedMeanRatio,
00166                          T* maxModifiedMeanRatio,
00167                          T* meanModifiedMeanRatio,
00168                          T* minModifiedConditionNumber, 
00169                          T* maxModifiedConditionNumber,
00170                          T* meanModifiedConditionNumber) {
00171   computeQualityStatistics<M,T>(mesh.getSimplicesBeginning(), 
00172                                 mesh.getSimplicesEnd(),
00173                                 minContent, 
00174                                 maxContent,
00175                                 meanContent,
00176                                 minDeterminant, 
00177                                 maxDeterminant,
00178                                 meanDeterminant,
00179                                 minModifiedMeanRatio,
00180                                 maxModifiedMeanRatio,
00181                                 meanModifiedMeanRatio,
00182                                 minModifiedConditionNumber, 
00183                                 maxModifiedConditionNumber,
00184                                 meanModifiedConditionNumber);
00185 }
00186 
00187 
00188 
00190 template<int N, int M, typename T,
00191          template<class> class Node,
00192          template<class> class Cell,
00193          template<class,class> class Cont>
00194 inline
00195 void
00196 printQualityStatistics(std::ostream& out,
00197                        const SimpMeshRed<N,M,T,Node,Cell,Cont>& mesh) {
00198   out << "Number of vertices = " << mesh.computeNodesSize() << "\n";
00199   printQualityStatistics<N,M,T>(out, mesh.getSimplicesBeginning(), 
00200                                 mesh.getSimplicesEnd());
00201 }
00202 
00203 
00205 // CONTINUE
00206 /*
00207 template<int N, typename T,
00208            template<class> class Node,
00209            template<class> class Cell,
00210            template<class,class> class Cont>
00211 inline
00212 void
00213 printQualityStatistics(std::ostream& out,
00214                const SimpMeshRed<N,N-1,T,Node,Cell,Cont>& mesh)
00215 {
00216   typedef Simplex<N-1,ads::FixedArray<N-1,T>,T> Simp;
00217   std::vector<Simp> simplices;
00218   simplices.reserve(mesh.cells_size());
00219   project_and_get_simplices(mesh, std::back_inserter(simplices));
00220   printQualityStatistics<N-1,T>(out, simplices.begin(), simplices.end());
00221 }
00222 */
00223 
00224 END_NAMESPACE_GEOM
00225 
00226 #define __geom_mesh_simplicial_quality_ipp__
00227 #include "quality.ipp"
00228 #undef __geom_mesh_simplicial_quality_ipp__
00229 
00230 #endif

Generated on Fri Aug 24 12:55:56 2007 for Computational Geometry Package by  doxygen 1.4.7