Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
V_EdgeMetric.cpp File Reference
#include "moab/verdict.h"
#include <cmath>
+ Include dependency graph for V_EdgeMetric.cpp:

Go to the source code of this file.

Macros

#define VERDICT_EXPORTS
 

Functions

C_FUNC_DEF double v_edge_length (int, double coordinates[][3])
 Calculates edge length. More...
 
C_FUNC_DEF void edge_quality (int num_nodes, double coordinates[][3], unsigned int metrics_request_flag, struct EdgeMetricVals *metric_vals)
 

Macro Definition Documentation

◆ VERDICT_EXPORTS

#define VERDICT_EXPORTS

Definition at line 23 of file V_EdgeMetric.cpp.

Function Documentation

◆ edge_quality()

C_FUNC_DEF void edge_quality ( int  num_nodes,
double  coordinates[][3],
unsigned int  metrics_request_flag,
struct EdgeMetricVals metric_vals 
)

higher order function for calculating multiple metrics at once.

for an edge, there is only one metric, edge length.

Definition at line 48 of file V_EdgeMetric.cpp.

52 {
53  if( metrics_request_flag & V_EDGE_LENGTH ) metric_vals->length = v_edge_length( num_nodes, coordinates );
54 }

References EdgeMetricVals::length, V_EDGE_LENGTH, and v_edge_length().

◆ v_edge_length()

C_FUNC_DEF double v_edge_length ( int  num_nodes,
double  coordinates[][3] 
)

Calculates edge length.

length of and edge length is calculated by taking the distance between the end nodes

Definition at line 32 of file V_EdgeMetric.cpp.

33 {
34 
35  double x = coordinates[1][0] - coordinates[0][0];
36  double y = coordinates[1][1] - coordinates[0][1];
37  double z = coordinates[1][2] - coordinates[0][2];
38  return (double)( sqrt( x * x + y * y + z * z ) );
39 }

Referenced by moab::VerdictWrapper::all_quality_measures(), edge_quality(), and moab::VerdictWrapper::quality_measure().