32 return 1. / 6. * ( ( ( v1 - v0 ) * ( v2 - v0 ) ) % ( v3 - v0 ) );
35 double edge_length(
const double* start_vtx_coords,
const double* end_vtx_coords )
37 const CartVect* start =
reinterpret_cast< const CartVect*
>( start_vtx_coords );
39 return ( *start - *end ).
length();
42 double measure( moab::EntityType type,
int num_vertices,
const double* vertex_coordinates )
44 const CartVect* coords =
reinterpret_cast< const CartVect*
>( vertex_coordinates );
48 return ( coords[0] - coords[1] ).length();
50 return 0.5 * ( ( coords[1] - coords[0] ) * ( coords[2] - coords[0] ) ).
length();
56 for(
int i = 0; i < num_vertices; ++i )
61 for(
int i = 0; i < num_vertices; ++i )
63 int j = ( i + 1 ) % num_vertices;
64 sum += ( ( mid - coords[i] ) * ( mid - coords[j] ) ).
length();
69 return tet_volume( coords[0], coords[1], coords[2], coords[3] );
71 return tet_volume( coords[0], coords[1], coords[2], coords[4] ) +
72 tet_volume( coords[0], coords[2], coords[3], coords[4] );
74 return tet_volume( coords[0], coords[1], coords[2], coords[5] ) +
75 tet_volume( coords[3], coords[5], coords[4], coords[0] ) +
76 tet_volume( coords[1], coords[4], coords[5], coords[0] );
78 return tet_volume( coords[0], coords[1], coords[3], coords[4] ) +
79 tet_volume( coords[7], coords[3], coords[6], coords[4] ) +
80 tet_volume( coords[4], coords[5], coords[1], coords[6] ) +
81 tet_volume( coords[1], coords[6], coords[3], coords[4] ) +
82 tet_volume( coords[2], coords[6], coords[3], coords[1] );