Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeneralizedConditionNumberQualityMetric Class Reference

Computes the condition number of given element. The``condition number" is scaled between one and infinity, with an ideal element having condition number one. More...

#include <GeneralizedConditionNumberQualityMetric.hpp>

Inheritance diagram for GeneralizedConditionNumberQualityMetric:
Collaboration diagram for GeneralizedConditionNumberQualityMetric:

Public Member Functions

 GeneralizedConditionNumberQualityMetric ()
 
virtual ~GeneralizedConditionNumberQualityMetric ()
 virtual destructor ensures use of polymorphism during destruction More...
 
bool evaluate_element (PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err)
 evaluate using mesquite objects More...
 
bool evaluate_vertex (PatchData &pd, MsqVertex *vertex, double &fval, MsqError &err)
 Evaluate the "condition number" for a vertex. More...
 
 GeneralizedConditionNumberQualityMetric ()
 
virtual ~GeneralizedConditionNumberQualityMetric ()
 virtual destructor ensures use of polymorphism during destruction More...
 
bool evaluate_element (PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err)
 evaluate using mesquite objects More...
 
bool evaluate_vertex (PatchData &pd, MsqVertex *vertex, double &fval, MsqError &err)
 Evaluate the "condition number" for a vertex. More...
 
- Public Member Functions inherited from ShapeQualityMetric
virtual ~ShapeQualityMetric ()
 virtual destructor ensures use of polymorphism during destruction More...
 
virtual ~ShapeQualityMetric ()
 virtual destructor ensures use of polymorphism during destruction More...
 
- Public Member Functions inherited from QualityMetric
virtual ~QualityMetric ()
 
MetricType get_metric_type ()
 
void set_element_evaluation_mode (ElementEvaluationMode mode, MsqError &err)
 Sets the evaluation mode for the ELEMENT_BASED metrics. More...
 
ElementEvaluationMode get_element_evaluation_mode ()
 Returns the evaluation mode for the metric. More...
 
void set_averaging_method (AveragingMethod method, MsqError &err)
 
void set_feasible_constraint (int alpha)
 
int get_feasible_constraint ()
 Returns the feasible flag for this metric. More...
 
void set_name (msq_std::string st)
 Sets the name of this metric. More...
 
msq_std::string get_name ()
 Returns the name of this metric (as a string). More...
 
double vertex_barrier_function (double det, double delta)
 Escobar Barrier Function for Shape and Other Metrics. More...
 
void set_gradient_type (GRADIENT_TYPE grad)
 Sets gradType for this metric. More...
 
void set_hessian_type (HESSIAN_TYPE ht)
 Sets hessianType for this metric. More...
 
bool compute_vertex_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err)
 Calls compute_vertex_numerical_gradient if gradType equals NUMERCIAL_GRADIENT. Calls compute_vertex_analytical_gradient if gradType equals ANALYTICAL_GRADIENT;. More...
 
bool compute_element_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_gradient() or compute_element_analytical_gradient() for gradType equal NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT, respectively. More...
 
bool compute_element_gradient_expanded (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 
bool compute_element_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err)
 For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_hessian() or compute_element_analytical_hessian() for hessianType equal NUMERICAL_HESSIAN or ANALYTICAL_HESSIAN, respectively. More...
 
void set_negate_flag (int neg)
 
int get_negate_flag ()
 Returns negateFlag. More...
 
virtual void change_metric_type (MetricType t, MsqError &err)
 
virtual ~QualityMetric ()
 
MetricType get_metric_type ()
 
void set_element_evaluation_mode (ElementEvaluationMode mode, MsqError &err)
 Sets the evaluation mode for the ELEMENT_BASED metrics. More...
 
ElementEvaluationMode get_element_evaluation_mode ()
 Returns the evaluation mode for the metric. More...
 
void set_averaging_method (AveragingMethod method, MsqError &err)
 
void set_feasible_constraint (int alpha)
 
int get_feasible_constraint ()
 Returns the feasible flag for this metric. More...
 
void set_name (msq_std::string st)
 Sets the name of this metric. More...
 
msq_std::string get_name ()
 Returns the name of this metric (as a string). More...
 
double vertex_barrier_function (double det, double delta)
 Escobar Barrier Function for Shape and Other Metrics. More...
 
void set_gradient_type (GRADIENT_TYPE grad)
 Sets gradType for this metric. More...
 
void set_hessian_type (HESSIAN_TYPE ht)
 Sets hessianType for this metric. More...
 
bool compute_vertex_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err)
 
bool compute_element_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_gradient() or compute_element_analytical_gradient() for gradType equal NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT, respectively. More...
 
bool compute_element_gradient_expanded (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 
bool compute_element_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err)
 For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_hessian() or compute_element_analytical_hessian() for hessianType equal NUMERICAL_HESSIAN or ANALYTICAL_HESSIAN, respectively. More...
 
void set_negate_flag (int neg)
 
int get_negate_flag ()
 Returns negateFlag. More...
 
virtual void change_metric_type (MetricType t, MsqError &err)
 

Protected Member Functions

bool compute_condition_number (PatchData &pd, MsqMeshEntity *elem, Vector3D *jacobian_vectors, int num_jacobian_vectors, double &fval, MsqError &err)
 
bool compute_condition_number (PatchData &pd, MsqMeshEntity *elem, Vector3D *jacobian_vectors, int num_jacobian_vectors, double &fval, MsqError &err)
 
- Protected Member Functions inherited from ShapeQualityMetric
bool condition_number_2d (Vector3D temp_vec[], size_t v_ind, PatchData &pd, double &fval, MsqError &err)
 Given the 2-d jacobian matrix, compute the condition number, fval. More...
 
bool condition_number_3d (Vector3D temp_vec[], PatchData &pd, double &fval, MsqError &err)
 Given the 3-d jacobian matrix, compute the condition number, fval. More...
 
bool condition_number_2d (Vector3D temp_vec[], size_t v_ind, PatchData &pd, double &fval, MsqError &err)
 Given the 2-d jacobian matrix, compute the condition number, fval. More...
 
bool condition_number_3d (Vector3D temp_vec[], PatchData &pd, double &fval, MsqError &err)
 Given the 3-d jacobian matrix, compute the condition number, fval. More...
 
- Protected Member Functions inherited from QualityMetric
 QualityMetric ()
 
void set_metric_type (MetricType t)
 This function should be used in the constructor of every concrete quality metric. More...
 
double average_metrics (const double metric_values[], const int &num_values, MsqError &err)
 average_metrics takes an array of length num_values and averages the contents using averaging method data member avgMethod . More...
 
double average_metric_and_weights (double metric_values[], int num_metric_values, MsqError &err)
 Given a list of metric values, calculate the average metric valude according to the current avgMethod and write into the passed metric_values array the the value weight/count to use when averaging gradient vectors for the metric. More...
 
double weighted_average_metrics (const double coef[], const double metric_values[], const int &num_values, MsqError &err)
 takes an array of coefficients and an array of metrics (both of length num_value) and averages the contents using averaging method 'method'. More...
 
bool compute_vertex_numerical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err)
 
bool compute_element_numerical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 Non-virtual function which numerically computes the gradient of a QualityMetric of a given element for a given set of free vertices on that element. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More...
 
virtual bool compute_vertex_analytical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err)
 Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is VERTEX_BASED. More...
 
virtual bool compute_element_analytical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More...
 
bool compute_element_numerical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err)
 
virtual bool compute_element_analytical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err)
 
 QualityMetric ()
 
void set_metric_type (MetricType t)
 This function should be used in the constructor of every concrete quality metric. More...
 
double average_metrics (const double metric_values[], const int &num_values, MsqError &err)
 average_metrics takes an array of length num_values and averages the contents using averaging method data member avgMethod . More...
 
double average_metric_and_weights (double metric_values[], int num_metric_values, MsqError &err)
 Given a list of metric values, calculate the average metric valude according to the current avgMethod and write into the passed metric_values array the the value weight/count to use when averaging gradient vectors for the metric. More...
 
double weighted_average_metrics (const double coef[], const double metric_values[], const int &num_values, MsqError &err)
 takes an array of coefficients and an array of metrics (both of length num_value) and averages the contents using averaging method 'method'. More...
 
bool compute_vertex_numerical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err)
 
bool compute_element_numerical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 Non-virtual function which numerically computes the gradient of a QualityMetric of a given element for a given set of free vertices on that element. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More...
 
virtual bool compute_vertex_analytical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err)
 Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is VERTEX_BASED. More...
 
virtual bool compute_element_analytical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err)
 Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More...
 
bool compute_element_numerical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err)
 
virtual bool compute_element_analytical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err)
 

Additional Inherited Members

- Public Types inherited from QualityMetric
enum  MetricType {
  MT_UNDEFINED, VERTEX_BASED, ELEMENT_BASED, VERTEX_BASED_FREE_ONLY,
  MT_UNDEFINED, VERTEX_BASED, ELEMENT_BASED, VERTEX_BASED_FREE_ONLY
}
 
enum  ElementEvaluationMode {
  EEM_UNDEFINED, ELEMENT_VERTICES, LINEAR_GAUSS_POINTS, QUADRATIC_GAUSS_POINTS,
  CUBIC_GAUSS_POINTS, EEM_UNDEFINED, ELEMENT_VERTICES, LINEAR_GAUSS_POINTS,
  QUADRATIC_GAUSS_POINTS, CUBIC_GAUSS_POINTS
}
 
enum  AveragingMethod {
  NONE, LINEAR, RMS, HMS,
  MINIMUM, MAXIMUM, HARMONIC, GEOMETRIC,
  SUM, SUM_SQUARED, GENERALIZED_MEAN, STANDARD_DEVIATION,
  MAX_OVER_MIN, MAX_MINUS_MIN, SUM_OF_RATIOS_SQUARED, NONE,
  LINEAR, RMS, HMS, MINIMUM,
  MAXIMUM, HARMONIC, GEOMETRIC, SUM,
  SUM_SQUARED, GENERALIZED_MEAN, STANDARD_DEVIATION, MAX_OVER_MIN,
  MAX_MINUS_MIN, SUM_OF_RATIOS_SQUARED
}
 
enum  GRADIENT_TYPE { NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT, NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT }
 
enum  HESSIAN_TYPE { NUMERICAL_HESSIAN, ANALYTICAL_HESSIAN, NUMERICAL_HESSIAN, ANALYTICAL_HESSIAN }
 
enum  MetricType {
  MT_UNDEFINED, VERTEX_BASED, ELEMENT_BASED, VERTEX_BASED_FREE_ONLY,
  MT_UNDEFINED, VERTEX_BASED, ELEMENT_BASED, VERTEX_BASED_FREE_ONLY
}
 
enum  ElementEvaluationMode {
  EEM_UNDEFINED, ELEMENT_VERTICES, LINEAR_GAUSS_POINTS, QUADRATIC_GAUSS_POINTS,
  CUBIC_GAUSS_POINTS, EEM_UNDEFINED, ELEMENT_VERTICES, LINEAR_GAUSS_POINTS,
  QUADRATIC_GAUSS_POINTS, CUBIC_GAUSS_POINTS
}
 
enum  AveragingMethod {
  NONE, LINEAR, RMS, HMS,
  MINIMUM, MAXIMUM, HARMONIC, GEOMETRIC,
  SUM, SUM_SQUARED, GENERALIZED_MEAN, STANDARD_DEVIATION,
  MAX_OVER_MIN, MAX_MINUS_MIN, SUM_OF_RATIOS_SQUARED, NONE,
  LINEAR, RMS, HMS, MINIMUM,
  MAXIMUM, HARMONIC, GEOMETRIC, SUM,
  SUM_SQUARED, GENERALIZED_MEAN, STANDARD_DEVIATION, MAX_OVER_MIN,
  MAX_MINUS_MIN, SUM_OF_RATIOS_SQUARED
}
 
enum  GRADIENT_TYPE { NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT, NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT }
 
enum  HESSIAN_TYPE { NUMERICAL_HESSIAN, ANALYTICAL_HESSIAN, NUMERICAL_HESSIAN, ANALYTICAL_HESSIAN }
 
- Protected Attributes inherited from QualityMetric
AveragingMethod avgMethod
 
int feasible
 
msq_std::string metricName
 

Detailed Description

Computes the condition number of given element. The``condition number" is scaled between one and infinity, with an ideal element having condition number one.

Constructor defaults the metric to the LINEAR averaging method and ELEMENT_VERTICES sample points. The default metric name is "Condition Number". It does require a feasible region, and the metric needs to be maximized.

Definition at line 61 of file includeLinks/GeneralizedConditionNumberQualityMetric.hpp.

Constructor & Destructor Documentation

Definition at line 51 of file QualityMetric/Shape/GeneralizedConditionNumberQualityMetric.cpp.

References MSQ_CHKERR.

52 {
53  MsqError err;
57  feasible=1;
58  set_name("Generalized Condition Number");
59 }
Used to hold the error state and return it to the application.
void set_element_evaluation_mode(ElementEvaluationMode mode, MsqError &err)
Sets the evaluation mode for the ELEMENT_BASED metrics.
#define MSQ_CHKERR(err)
Mesquite&#39;s Error Checking macro.
void set_metric_type(MetricType t)
This function should be used in the constructor of every concrete quality metric. ...
void set_name(msq_std::string st)
Sets the name of this metric.
virtual ~GeneralizedConditionNumberQualityMetric ( )
inlinevirtual

virtual destructor ensures use of polymorphism during destruction

Definition at line 68 of file includeLinks/GeneralizedConditionNumberQualityMetric.hpp.

69  {}
virtual ~GeneralizedConditionNumberQualityMetric ( )
inlinevirtual

virtual destructor ensures use of polymorphism during destruction

Definition at line 68 of file src/QualityMetric/Shape/GeneralizedConditionNumberQualityMetric.hpp.

69  {}

Member Function Documentation

bool compute_condition_number ( PatchData pd,
MsqMeshEntity elem,
Vector3D jacobian_vectors,
int  num_jacobian_vectors,
double &  fval,
MsqError err 
)
inlineprotected

Definition at line 90 of file includeLinks/GeneralizedConditionNumberQualityMetric.hpp.

References PatchData::domain_set(), PatchData::get_domain_normal_at_vertex(), MsqMeshEntity::get_vertex_index(), Mesquite::length(), MSQ_ERRZERO, Mesquite::MSQ_MAX_CAP, Mesquite::MSQ_MIN, and sqrt().

93  {
94  //PRINT_INFO("INSIDE CONDITION NUMBER COMPUTE_CON\n");
95  double temp_var=0;
96  if(num_jacobian_vectors==2){
97  size_t vert=element->get_vertex_index(0);
98  Vector3D cross_vec=jacobian_vectors[0]*jacobian_vectors[1];
99  if ( pd.domain_set() ) {
100  Vector3D norm_vec;
101  pd.get_domain_normal_at_vertex(vert,false,norm_vec,err);MSQ_ERRZERO(err);
102  if(cross_vec%norm_vec<0.0){
103  return false;
104  }
105  }
106 
107  temp_var=fabs((cross_vec).length());
108  fval=jacobian_vectors[0].length_squared();
109  fval+=jacobian_vectors[1].length_squared();
110  if(temp_var>=MSQ_MIN){ //if not degenerate
111  fval/=(2.0*temp_var);
112  }
113  else{
114  fval=MSQ_MAX_CAP;
115  }
116  return true;
117  }
118 
119  //if three jacobian vectors (3D elem)
120  else if(num_jacobian_vectors==3){
121  //norm squared of J
122  double term1=jacobian_vectors[0]%jacobian_vectors[0]+
123  jacobian_vectors[1]%jacobian_vectors[1]+
124  jacobian_vectors[2]%jacobian_vectors[2];
125  //norm squared of adjoint of J
126  double term2=(jacobian_vectors[0]*jacobian_vectors[1])%
127  (jacobian_vectors[0]*jacobian_vectors[1])+
128  (jacobian_vectors[1]*jacobian_vectors[2])%
129  (jacobian_vectors[1]*jacobian_vectors[2])+
130  (jacobian_vectors[2]*jacobian_vectors[0])%
131  (jacobian_vectors[2]*jacobian_vectors[0]);
132  //det of J
133  temp_var=jacobian_vectors[0]%(jacobian_vectors[1]*jacobian_vectors[2]);
134  if(temp_var<=0.0){
135  return false;
136  }
137 
138  fval=sqrt(term1*term2);
139  if(fval>MSQ_MIN){
140  //if not degenerate or inverted???
141  fval/=(3*temp_var);
142  }
143  else{
144  fval=MSQ_MAX_CAP;
145  }
146  }
147 
148  else{
149  fval=MSQ_MAX_CAP;
150  }
151 
152  return true;
153  }
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
const double MSQ_MAX_CAP
Definition: Mesquite.hpp:173
double sqrt(double d)
Definition: double.h:73
double length(Vector3D *const v, int n)
NVec< 3, double > Vector3D
const double MSQ_MIN
Definition: Mesquite.hpp:160

Here is the call graph for this function:

bool compute_condition_number ( PatchData pd,
MsqMeshEntity elem,
Vector3D jacobian_vectors,
int  num_jacobian_vectors,
double &  fval,
MsqError err 
)
protected
bool evaluate_element ( PatchData pd,
MsqMeshEntity element,
double &  fval,
MsqError err 
)
virtual

evaluate using mesquite objects

Reimplemented from QualityMetric.

bool evaluate_element ( PatchData pd,
MsqMeshEntity element,
double &  fval,
MsqError err 
)
virtual

evaluate using mesquite objects

Reimplemented from QualityMetric.

Definition at line 103 of file QualityMetric/Shape/GeneralizedConditionNumberQualityMetric.cpp.

References MsqMeshEntity::compute_weighted_jacobian(), MsqMeshEntity::get_sample_points(), i, MSQ_CHKERR, and MSQ_ERRZERO.

107 {
108  int num_sample_points;
109  bool return_flag;
110  vector<Vector3D> sample_points;
112  element->get_sample_points(eval_mode,sample_points,err); MSQ_ERRZERO(err);
113  vector<Vector3D>::iterator iter=sample_points.begin();
114  // loop over sample points
115  Vector3D jacobian_vectors[3];
116  short num_jacobian_vectors;
117  int i=0;
118  num_sample_points=sample_points.size();
119  std::vector<double> metric_values(num_sample_points);
120  //Vector3D* current_sample_point;
121  for(i=0;i<num_sample_points;++i){
122  // compute weighted jacobian
123  element->compute_weighted_jacobian(pd, (*iter),
124  jacobian_vectors,
125  num_jacobian_vectors, err); MSQ_ERRZERO(err);
126  // evaluate condition number at ith sample point
127  //if 2 jacobian vectors (2D elem)
128 
129  return_flag=compute_condition_number(pd, element, jacobian_vectors,
130  num_jacobian_vectors,
131  metric_values[i],err);
132  if(MSQ_CHKERR(err) || !return_flag){
133  return false;
134  }
135 
136  ++iter;
137  }// end loop over sample points
138  fval=average_metrics(&metric_values[0],num_sample_points,err); MSQ_ERRZERO(err);
139  return true;
140 }
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
ElementEvaluationMode get_element_evaluation_mode()
Returns the evaluation mode for the metric.
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
#define MSQ_CHKERR(err)
Mesquite&#39;s Error Checking macro.
blockLoc i
Definition: read.cpp:79
void compute_weighted_jacobian(PatchData &pd, Vector3D &sample_point, Vector3D jacobian_vectors[], short &num_jacobian_vectors, MsqError &err)
double average_metrics(const double metric_values[], const int &num_values, MsqError &err)
average_metrics takes an array of length num_values and averages the contents using averaging method ...
void get_sample_points(QualityMetric::ElementEvaluationMode mode, msq_std::vector< Vector3D > &coords, MsqError &err)
Returns a list of sample points given an evaluationmode.
bool compute_condition_number(PatchData &pd, MsqMeshEntity *elem, Vector3D *jacobian_vectors, int num_jacobian_vectors, double &fval, MsqError &err)

Here is the call graph for this function:

bool evaluate_vertex ( PatchData pd,
MsqVertex vertex,
double &  fval,
MsqError err 
)
virtual

Evaluate the "condition number" for a vertex.

Reimplemented from QualityMetric.

Definition at line 142 of file QualityMetric/Shape/GeneralizedConditionNumberQualityMetric.cpp.

References MSQ_SETERR.

146 {
147  MSQ_SETERR(err)("Condition Number's evaluate_vertex is currently "
148  "being implemented", MsqError::NOT_IMPLEMENTED);
149  fval=0.0;
150  return false;
151 
152  /*
153  fval=0.0;
154  size_t this_vert = pd.get_vertex_index(vert);
155  vector<size_t> adj_elems;
156  pd.get_vertex_element_indices(this_vert, adg_elems, err);
157  double num_elems = adj_elems.size();
158  double *metric_values=new double[ num_elems ];
159  int num_jacobian_vectors;
160  Vector3D sample_point;
161  Vecotr3D jacobian_vectors[3];
162 
163  int i;
164  for ( i = 0; i<num_elems; i++){
165  elems[i]->get_sample_point(vertex, sample_point, err); MSQ_CHKERR(err);
166  elems[i]->compute_weighted_jacobian(&current_sample_point,
167  jacobian_vectors,
168  num_jacobian_vectors, err);
169  MSQ_CHKERR(err);
170  metric_values[i]=compute_condition_number(jacobian_vectors,
171  num_jacobian_vectors, err);
172  MSQ_CHKERR(err);
173  }
174  total_metric=average_metrics(metric_values, num_elems, err);
175  MSQ_CHKERR(err);
176  delete metric_values;
177  */
178 }
requested functionality is not (yet) implemented
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
bool evaluate_vertex ( PatchData pd,
MsqVertex vertex,
double &  fval,
MsqError err 
)
virtual

Evaluate the "condition number" for a vertex.

Reimplemented from QualityMetric.


The documentation for this class was generated from the following files: