38 #include "QualityMetric.hpp"
39 #include "PatchData.hpp"
69 for (index=0; index<num_elements; index++){
91 for (index=0; index<num_vertices;index++){
107 MSQ_SETERR(err)(
"Make sure MetricType is initialised in concrete "
121 MSQ_SETERR(err)(
"The MaxTemplate is not sufficient for methods requiring\n"
122 " gradient information. If you neeed to try this anyway, \n"
123 " set the gradient type to numerical.\n",
void set_gradient_type(GRADIENT_TYPE grad)
Set gradType to either NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT.
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
MetricType get_metric_type()
void set_quality_metric(QualityMetric *qm)
Set the value of qMetric.
virtual bool compute_analytical_gradient(PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size)
int get_negate_flag()
Returns negateFlag.
Used to hold the error state and return it to the application.
Base class for concrete quality metrics.
MsqMeshEntity is the Mesquite object that stores information about the elements in the mesh...
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
virtual bool concrete_evaluate(PatchData &patch, double &fval, MsqError &err)
every differentiable function should have an analytical gradient implemented.
QualityMetric * get_quality_metric()
size_t num_elements() const
number of elements in the Patch.
#define MSQ_CHKERR(err)
Mesquite's Error Checking macro.
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
void set_negate_flag(int neg)
Set the value of ObjectiveFunction's negateFlag. Unless composite, concrete ObjectiveFunctions should...
size_t num_vertices() const
number of vertices in the patch.
virtual bool evaluate_element(PatchData &, MsqMeshEntity *, double &, MsqError &err)
Evaluate the metric for an element.
virtual bool evaluate_vertex(PatchData &, MsqVertex *, double &, MsqError &err)
Evaluate the metric for a vertex.
const MsqVertex * get_vertex_array(MsqError &err) const
Returns a pointer to the start of the vertex array.
object is in an invalid state
const MsqMeshEntity * get_element_array(MsqError &err) const
Returns a pointer to the start of the element array.
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
MaxTemplate(QualityMetric *)