35 #include "Vector3D.hpp"
36 #include "ShapeQualityMetric.hpp"
37 #include "QualityMetric.hpp"
39 #ifdef MSQ_USE_OLD_STD_HEADERS
46 using namespace Mesquite;
67 vector<size_t> adj_elems;
80 MSQ_SETERR(err)(
"ASM quality metric not implemented for this "
84 int num_samp=adj_elems.size();
89 double* met_vals =
new double [num_samp];
96 for(i=0;i<num_samp;++
i){
99 if((temp_double+met_vals[i])>
MSQ_MIN){
100 met_vals[
i]=fabs((temp_double-met_vals[i])/(temp_double+
111 for(i=0;i<num_samp;++
i){
113 if((temp_double+met_vals[i])>
MSQ_MIN){
114 met_vals[
i]=fabs((temp_double-met_vals[i])/(temp_double+
122 MSQ_SETERR(err)(
"ASM quality metric not implemented for this "
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
bool evaluate_element(PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err)
evaluate using mesquite objects
Used to hold the error state and return it to the application.
requested functionality is not (yet) implemented
MsqMeshEntity is the Mesquite object that stores information about the elements in the mesh...
double compute_unsigned_volume(PatchData &pd, MsqError &err)
Computes the volume of the element.
void get_adjacent_entities_via_n_dim(int n, size_t ent_ind, msq_std::vector< size_t > &adj_ents, MsqError &err)
Get the indices of entities attached to entity (given by ent_ind). adj_ents is filled with the indice...
void set_element_evaluation_mode(ElementEvaluationMode mode, MsqError &err)
Sets the evaluation mode for the ELEMENT_BASED metrics.
#define MSQ_CHKERR(err)
Mesquite's Error Checking macro.
size_t get_element_index(MsqMeshEntity *element)
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
double compute_unsigned_area(PatchData &pd, MsqError &err)
Computes the area of the element.
EntityTopology get_element_type() const
Returns element type.
void set_metric_type(MetricType t)
This function should be used in the constructor of every concrete quality metric. ...
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 ...
const MsqMeshEntity * get_element_array(MsqError &err) const
Returns a pointer to the start of the element array.
AveragingMethod avgMethod
void set_name(msq_std::string st)
Sets the name of this metric.