#include "moab/verdict.h"
#include "VerdictVector.hpp"
#include "verdict_defines.hpp"
#include "V_GaussIntegration.hpp"
#include <memory.h>
Go to the source code of this file.
Macros | |
#define | VERDICT_EXPORTS |
Functions | |
int | get_weight (double &m11, double &m21, double &m12, double &m22) |
C_FUNC_DEF void | v_set_quad_size (double size) |
return the average area of a quad More... | |
VerdictBoolean | is_collapsed_quad (double coordinates[][3]) |
returns whether the quad is collapsed or not More... | |
void | make_quad_edges (VerdictVector edges[4], double coordinates[][3]) |
void | signed_corner_areas (double areas[4], double coordinates[][3]) |
void | localize_quad_coordinates (VerdictVector nodes[4]) |
void | localize_quad_for_ef (VerdictVector node_pos[4]) |
VerdictVector | quad_normal (double coordinates[][3]) |
C_FUNC_DEF double | v_quad_edge_ratio (int, double coordinates[][3]) |
Calculates quad edge ratio. More... | |
C_FUNC_DEF double | v_quad_max_edge_ratio (int, double coordinates[][3]) |
Calculates quad maximum of edge ratio. More... | |
C_FUNC_DEF double | v_quad_aspect_ratio (int, double coordinates[][3]) |
Calculates quad aspect ratio. More... | |
C_FUNC_DEF double | v_quad_radius_ratio (int, double coordinates[][3]) |
Calculates quad radius ratio. More... | |
C_FUNC_DEF double | v_quad_med_aspect_frobenius (int, double coordinates[][3]) |
Calculates quad average Frobenius aspect. More... | |
C_FUNC_DEF double | v_quad_max_aspect_frobenius (int, double coordinates[][3]) |
Calculates quad maximum Frobenius aspect. More... | |
C_FUNC_DEF double | v_quad_skew (int, double coordinates[][3]) |
Calculates quad skew metric. More... | |
C_FUNC_DEF double | v_quad_taper (int, double coordinates[][3]) |
Calculates quad taper metric. More... | |
C_FUNC_DEF double | v_quad_warpage (int, double coordinates[][3]) |
Calculates quad warpage metric. More... | |
C_FUNC_DEF double | v_quad_area (int, double coordinates[][3]) |
Calculates quad area. More... | |
C_FUNC_DEF double | v_quad_stretch (int, double coordinates[][3]) |
Calculates quad strech metric. More... | |
C_FUNC_DEF double | v_quad_maximum_angle (int, double coordinates[][3]) |
Calculates quad's largest angle. More... | |
C_FUNC_DEF double | v_quad_minimum_angle (int, double coordinates[][3]) |
Calculates quad's smallest angle. More... | |
C_FUNC_DEF double | v_quad_oddy (int, double coordinates[][3]) |
Calculates quad oddy metric. More... | |
C_FUNC_DEF double | v_quad_condition (int, double coordinates[][3]) |
Calculates quad condition number metric. More... | |
C_FUNC_DEF double | v_quad_jacobian (int, double coordinates[][3]) |
Calculates quad jacobian. More... | |
C_FUNC_DEF double | v_quad_scaled_jacobian (int, double coordinates[][3]) |
Calculates quad scaled jacobian. More... | |
C_FUNC_DEF double | v_quad_shear (int, double coordinates[][3]) |
Calculates quad shear metric. More... | |
C_FUNC_DEF double | v_quad_shape (int, double coordinates[][3]) |
Calculates quad shape metric. More... | |
C_FUNC_DEF double | v_quad_relative_size_squared (int, double coordinates[][3]) |
Calculates quad relative size metric. More... | |
C_FUNC_DEF double | v_quad_shape_and_size (int num_nodes, double coordinates[][3]) |
Calculates quad shape-size metric. More... | |
C_FUNC_DEF double | v_quad_shear_and_size (int num_nodes, double coordinates[][3]) |
Calculates quad shear-size metric. More... | |
C_FUNC_DEF double | v_quad_distortion (int num_nodes, double coordinates[][3]) |
Calculates quad distortion metric. More... | |
C_FUNC_DEF void | v_quad_quality (int num_nodes, double coordinates[][3], unsigned int metrics_request_flag, QuadMetricVals *metric_vals) |
Calculates quality metrics for quadrilateral elements. More... | |
Variables | |
double | verdict_quad_size = 0 |
the average area of a quad More... | |
#define VERDICT_EXPORTS |
Definition at line 23 of file V_QuadMetric.cpp.
int get_weight | ( | double & | m11, |
double & | m21, | ||
double & | m12, | ||
double & | m22 | ||
) |
weights based on the average size of a quad
Definition at line 37 of file V_QuadMetric.cpp.
References verdict_quad_size.
Referenced by v_quad_quality(), and v_quad_relative_size_squared().
VerdictBoolean is_collapsed_quad | ( | double | coordinates[][3] | ) |
returns whether the quad is collapsed or not
Definition at line 62 of file V_QuadMetric.cpp.
References VERDICT_FALSE, and VERDICT_TRUE.
Referenced by v_quad_condition(), v_quad_distortion(), v_quad_jacobian(), v_quad_maximum_angle(), v_quad_minimum_angle(), v_quad_quality(), and v_quad_scaled_jacobian().
void localize_quad_coordinates | ( | VerdictVector | nodes[4] | ) |
localize the coordinates of a quad
localizing puts the centriod of the quad at the orgin and also rotates the quad such that edge (0,1) is aligned with the x axis and the quad normal lines up with the y axis.
Definition at line 121 of file V_QuadMetric.cpp.
References center(), VerdictVector::normalize(), VerdictVector::set(), VerdictVector::x(), VerdictVector::y(), and VerdictVector::z().
void localize_quad_for_ef | ( | VerdictVector | node_pos[4] | ) |
moves and rotates the quad such that it enables us to use components of ef's
Definition at line 170 of file V_QuadMetric.cpp.
References VerdictVector::normalize(), VerdictVector::x(), and VerdictVector::y().
void make_quad_edges | ( | VerdictVector | edges[4], |
double | coordinates[][3] | ||
) |
Definition at line 72 of file V_QuadMetric.cpp.
References VerdictVector::set().
Referenced by signed_corner_areas(), v_quad_aspect_ratio(), v_quad_edge_ratio(), v_quad_max_aspect_frobenius(), v_quad_med_aspect_frobenius(), v_quad_quality(), v_quad_radius_ratio(), v_quad_scaled_jacobian(), v_quad_shape(), v_quad_stretch(), and v_quad_warpage().
VerdictVector quad_normal | ( | double | coordinates[][3] | ) |
returns the normal vector of a quad
Definition at line 204 of file V_QuadMetric.cpp.
References VerdictVector::normalize(), and VerdictVector::set().
Referenced by v_quad_distortion().
void signed_corner_areas | ( | double | areas[4], |
double | coordinates[][3] | ||
) |
Definition at line 85 of file V_QuadMetric.cpp.
References make_quad_edges(), and VerdictVector::normalize().
Referenced by v_quad_area(), v_quad_condition(), v_quad_jacobian(), v_quad_maximum_angle(), v_quad_quality(), v_quad_scaled_jacobian(), and v_quad_shape().
C_FUNC_DEF double v_quad_area | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad area.
the area of a quad
jacobian at quad center
Definition at line 611 of file V_QuadMetric.cpp.
References signed_corner_areas(), VERDICT_DBL_MAX, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), v_quad_quality(), and v_quad_relative_size_squared().
C_FUNC_DEF double v_quad_aspect_ratio | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad aspect ratio.
the aspect ratio of a quad
NB (P. Pebay 01/20/07): this is a generalization of the triangle aspect ratio using Heron's formula.
Definition at line 351 of file V_QuadMetric.cpp.
References VerdictVector::length(), make_quad_edges(), mb, VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_quality().
C_FUNC_DEF double v_quad_condition | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad condition number metric.
the condition of a quad
maximum condition number of the Jacobian matrix at 4 corners
Definition at line 828 of file V_QuadMetric.cpp.
References is_collapsed_quad(), VerdictVector::set(), signed_corner_areas(), v_tri_condition(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, VERDICT_MIN, and VERDICT_TRUE.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_distortion | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad distortion metric.
the distortion of a quad
Definition at line 1052 of file V_QuadMetric.cpp.
References GaussIntegration::calculate_derivative_at_nodes(), GaussIntegration::calculate_shape_function_2d_quad(), dot_product(), moab::GeomUtil::first(), GaussIntegration::get_shape_func(), GaussIntegration::initialize(), is_collapsed_quad(), VerdictVector::length(), length(), maxNumberNodes, maxTotalNumberGaussPoints, VerdictVector::normalize(), quad_normal(), VerdictVector::set(), VERDICT_DBL_MAX, VERDICT_MIN, and VERDICT_TRUE.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_quality().
C_FUNC_DEF double v_quad_edge_ratio | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad edge ratio.
the edge ratio of a quad
NB (P. Pebay 01/19/07): Hmax / Hmin where Hmax and Hmin are respectively the maximum and the minimum edge lengths
Definition at line 271 of file V_QuadMetric.cpp.
References VerdictVector::length_squared(), make_quad_edges(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_quality().
C_FUNC_DEF double v_quad_jacobian | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad jacobian.
the jacobian of a quad
minimum pointwise volume of local map at 4 corners and center of quad
Definition at line 870 of file V_QuadMetric.cpp.
References is_collapsed_quad(), signed_corner_areas(), v_tri_area(), VERDICT_DBL_MAX, VERDICT_MAX, VERDICT_MIN, and VERDICT_TRUE.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_max_aspect_frobenius | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad maximum Frobenius aspect.
the maximum Frobenius aspect of a quad
NB (P. Pebay 01/20/07): this metric is calculated by taking the maximum of the 4 Frobenius aspects at each corner of the quad, when the reference triangle is right isosceles.
Definition at line 484 of file V_QuadMetric.cpp.
References VerdictVector::length(), VerdictVector::length_squared(), make_quad_edges(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_quality().
C_FUNC_DEF double v_quad_max_edge_ratio | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad maximum of edge ratio.
maximum of edge ratio of a quad
maximum edge length ratio at quad center
Definition at line 321 of file V_QuadMetric.cpp.
References VerdictVector::length(), VerdictVector::set(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_maximum_angle | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad's largest angle.
the largest angle of a quad
largest included quad area (degrees)
Definition at line 670 of file V_QuadMetric.cpp.
References moab::angle(), is_collapsed_quad(), VerdictVector::length(), length(), VerdictVector::set(), signed_corner_areas(), v_tri_maximum_angle(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, VERDICT_MIN, VERDICT_PI, and VERDICT_TRUE.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_med_aspect_frobenius | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad average Frobenius aspect.
the average Frobenius aspect of a quad
NB (P. Pebay 01/20/07): this metric is calculated by averaging the 4 Frobenius aspects at each corner of the quad, when the reference triangle is right isosceles.
Definition at line 442 of file V_QuadMetric.cpp.
References VerdictVector::length(), VerdictVector::length_squared(), make_quad_edges(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_quality().
C_FUNC_DEF double v_quad_minimum_angle | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad's smallest angle.
the smallest angle of a quad
smallest included quad angle (degrees)
Definition at line 734 of file V_QuadMetric.cpp.
References moab::angle(), is_collapsed_quad(), VerdictVector::length(), length(), VerdictVector::set(), v_tri_minimum_angle(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, VERDICT_MIN, VERDICT_PI, and VERDICT_TRUE.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_oddy | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad oddy metric.
the oddy of a quad
general distortion measure based on left Cauchy-Green Tensor
Definition at line 788 of file V_QuadMetric.cpp.
References moab::GeomUtil::first(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF void v_quad_quality | ( | int | num_nodes, |
double | coordinates[][3], | ||
unsigned int | metrics_request_flag, | ||
QuadMetricVals * | metric_vals | ||
) |
Calculates quality metrics for quadrilateral elements.
multiple quality measures of a quad
Definition at line 1258 of file V_QuadMetric.cpp.
References QuadMetricVals::area, QuadMetricVals::aspect_ratio, QuadMetricVals::condition, determinant(), QuadMetricVals::distortion, QuadMetricVals::edge_ratio, get_weight(), is_collapsed_quad(), QuadMetricVals::jacobian, VerdictVector::length(), VerdictVector::length_squared(), length_squared(), make_quad_edges(), QuadMetricVals::max_aspect_frobenius, QuadMetricVals::max_edge_ratio, QuadMetricVals::maximum_angle, QuadMetricVals::med_aspect_frobenius, QuadMetricVals::minimum_angle, normalize(), QuadMetricVals::oddy, QuadMetricVals::radius_ratio, QuadMetricVals::relative_size_squared, QuadMetricVals::scaled_jacobian, VerdictVector::set(), QuadMetricVals::shape, QuadMetricVals::shape_and_size, QuadMetricVals::shear, QuadMetricVals::shear_and_size, signed_corner_areas(), QuadMetricVals::skew, QuadMetricVals::stretch, QuadMetricVals::taper, V_QUAD_AREA, v_quad_area(), V_QUAD_ASPECT_RATIO, v_quad_aspect_ratio(), V_QUAD_CONDITION, V_QUAD_DISTORTION, v_quad_distortion(), V_QUAD_EDGE_RATIO, v_quad_edge_ratio(), V_QUAD_JACOBIAN, V_QUAD_MAX_ASPECT_FROBENIUS, v_quad_max_aspect_frobenius(), V_QUAD_MAX_EDGE_RATIO, V_QUAD_MAXIMUM_ANGLE, V_QUAD_MED_ASPECT_FROBENIUS, v_quad_med_aspect_frobenius(), V_QUAD_MINIMUM_ANGLE, V_QUAD_ODDY, V_QUAD_RADIUS_RATIO, v_quad_radius_ratio(), V_QUAD_RELATIVE_SIZE_SQUARED, V_QUAD_SCALED_JACOBIAN, V_QUAD_SHAPE, V_QUAD_SHAPE_AND_SIZE, V_QUAD_SHEAR, V_QUAD_SHEAR_AND_SIZE, V_QUAD_SKEW, V_QUAD_STRETCH, V_QUAD_TAPER, V_QUAD_WARPAGE, v_set_quad_size(), v_tri_area(), v_tri_maximum_angle(), v_tri_minimum_angle(), v_tri_scaled_jacobian(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_FALSE, VERDICT_MAX, VERDICT_MIN, VERDICT_PI, VERDICT_TRUE, and QuadMetricVals::warpage.
Referenced by moab::VerdictWrapper::all_quality_measures().
C_FUNC_DEF double v_quad_radius_ratio | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad radius ratio.
the radius ratio of a quad
NB (P. Pebay 01/19/07): this metric is called "radius ratio" by extension of a concept that does not exist in general with quads – although a different name should probably be used in the future.
Definition at line 386 of file V_QuadMetric.cpp.
References VerdictVector::length(), VerdictVector::length_squared(), make_quad_edges(), VerdictVector::set(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_quality().
C_FUNC_DEF double v_quad_relative_size_squared | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad relative size metric.
the relative size of a quad
Min( J, 1/J ), where J is determinant of weighted Jacobian matrix
Definition at line 988 of file V_QuadMetric.cpp.
References determinant(), get_weight(), v_quad_area(), v_set_quad_size(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), v_quad_shape_and_size(), and v_quad_shear_and_size().
C_FUNC_DEF double v_quad_scaled_jacobian | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad scaled jacobian.
scaled jacobian of a quad
Minimum Jacobian divided by the lengths of the 2 edge vector
Definition at line 888 of file V_QuadMetric.cpp.
References is_collapsed_quad(), VerdictVector::length(), length(), make_quad_edges(), signed_corner_areas(), v_tri_scaled_jacobian(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, VERDICT_MIN, and VERDICT_TRUE.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_shear().
C_FUNC_DEF double v_quad_shape | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad shape metric.
the shape of a quad
2/Condition number of weighted Jacobian matrix
Definition at line 944 of file V_QuadMetric.cpp.
References VerdictVector::length_squared(), length_squared(), make_quad_edges(), signed_corner_areas(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_shape_and_size().
C_FUNC_DEF double v_quad_shape_and_size | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad shape-size metric.
the relative shape and size of a quad
Product of Shape and Relative Size
Definition at line 1020 of file V_QuadMetric.cpp.
References size, v_quad_relative_size_squared(), v_quad_shape(), VERDICT_DBL_MAX, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_shear | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad shear metric.
the shear of a quad
2/Condition number of Jacobian Skew matrix
Definition at line 929 of file V_QuadMetric.cpp.
References v_quad_scaled_jacobian(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure(), and v_quad_shear_and_size().
C_FUNC_DEF double v_quad_shear_and_size | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad shear-size metric.
the shear and size of a quad
product of shear and relative size
Definition at line 1037 of file V_QuadMetric.cpp.
References size, v_quad_relative_size_squared(), v_quad_shear(), VERDICT_DBL_MAX, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_skew | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad skew metric.
skew of a quad
maximum ||cos A|| where A is the angle between edges at quad center
Definition at line 530 of file V_QuadMetric.cpp.
References normalize(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_stretch | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad strech metric.
the stretch of a quad
sqrt(2) * minimum edge length / maximum diagonal length
Definition at line 628 of file V_QuadMetric.cpp.
References VerdictVector::length_squared(), make_quad_edges(), VerdictVector::set(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_taper | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad taper metric.
taper of a quad
maximum ratio of lengths derived from opposite edges
Definition at line 553 of file V_QuadMetric.cpp.
References VerdictVector::length(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF double v_quad_warpage | ( | int | num_nodes, |
double | coordinates[][3] | ||
) |
Calculates quad warpage metric.
warpage of a quad
deviation of element from planarity
Definition at line 583 of file V_QuadMetric.cpp.
References make_quad_edges(), normalize(), VERDICT_DBL_MAX, VERDICT_DBL_MIN, VERDICT_MAX, and VERDICT_MIN.
Referenced by moab::VerdictWrapper::quality_measure().
C_FUNC_DEF void v_set_quad_size | ( | double | size | ) |
return the average area of a quad
Sets average size (area) of quad, needed for v_quad_relative_size(...)
Definition at line 56 of file V_QuadMetric.cpp.
References size, and verdict_quad_size.
Referenced by moab::VerdictWrapper::set_size(), v_quad_quality(), and v_quad_relative_size_squared().
double verdict_quad_size = 0 |
the average area of a quad
Definition at line 32 of file V_QuadMetric.cpp.
Referenced by get_weight(), and v_set_quad_size().