MOAB: Mesh Oriented datABase  (version 5.4.1)
UntangleBetaQualityMetric.cpp File Reference
#include "UntangleBetaQualityMetric.hpp"
#include "Vector3D.hpp"
#include "PatchData.hpp"
#include "MsqError.hpp"
+ Include dependency graph for UntangleBetaQualityMetric.cpp:

Go to the source code of this file.

Functions

static void untangle_function_2d (double beta, const Vector3D temp_vec[], size_t e_ind, PatchData &pd, double &fval, MsqError &err)
static void untangle_function_3d (double beta, const Vector3D temp_vec[], double &fval)

Detailed Description

UntangleBeta is an untangle quality metric which can be used to evaluate the quality of two- or three-dimensional elements.

Author:
Michael Brewer
Date:
2002-10-10

Definition in file UntangleBetaQualityMetric.cpp.


Function Documentation

static void untangle_function_2d ( double  beta,
const Vector3D  temp_vec[],
size_t  e_ind,
PatchData pd,
double &  fval,
MsqError err 
) [inline, static]

Definition at line 42 of file UntangleBetaQualityMetric.cpp.

References beta, MBMesquite::PatchData::get_domain_normal_at_element(), MBMesquite::Vector3D::length(), and MSQ_ERRRTN.

Referenced by MBMesquite::UntangleBetaQualityMetric::evaluate().

{
    Vector3D surface_normal;
    pd.get_domain_normal_at_element( e_ind, surface_normal, err );MSQ_ERRRTN( err );
    Vector3D cross_vec = temp_vec[0] * temp_vec[1];
    // cout<<"\nsurface_normal "<<surface_normal;
    // cout<<"\cross_vec "<<cross_vec;
    double temp_var = cross_vec.length();
    if( cross_vec % surface_normal < 0.0 )
    {
        temp_var *= -1;
    }
    temp_var -= beta;
    // cout<<"temp_var == "<<temp_var;
    fval = 0.0;
    if( temp_var < 0.0 )
    {
        fval = fabs( temp_var ) - temp_var;
    }
    //  cout<<"\nfval == "<<fval<<"  e_ind "<<e_ind;
}
static void untangle_function_3d ( double  beta,
const Vector3D  temp_vec[],
double &  fval 
) [inline, static]

Definition at line 69 of file UntangleBetaQualityMetric.cpp.

References beta.

Referenced by MBMesquite::UntangleBetaQualityMetric::evaluate().

{
    double temp_var = temp_vec[0] % ( temp_vec[1] * temp_vec[2] );
    temp_var -= beta;
    fval = 0.0;
    if( temp_var < 0.0 )
    {
        fval = fabs( temp_var ) - temp_var;
    }
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines