Commit 1d23372e authored by ahern's avatar ahern

Renamed the "diagonal" expression to "diagonal_ratio". Added "min_diagonal"

and "max_diagonal" expressions.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@7644 18c085ea-50e0-402c-830e-de6fd14e8384
parent 2df3d878
......@@ -1378,6 +1378,10 @@ avtDatabase::Convert1DVarMDsToCurveMDs(avtDatabaseMetaData *md)
//
// Mark C. Miller, Wed Jun 3 14:51:09 PDT 2009
// Added face_planarity expressions.
//
// Sean Ahern, Wed Jun 24 17:13:50 EDT 2009
// Renamed diagonal to diagonal_ratio. Added max_diagonal and
// min_diagonal.
// ****************************************************************************
void
......@@ -1427,34 +1431,37 @@ avtDatabase::AddMeshQualityExpressions(avtDatabaseMetaData *md)
continue;
nmeshes_done++;
const int nPairs = 26;
const int nPairs = 28;
// Static allocation?! Really??!!
MQExprTopoPair exprs[nPairs];
exprs[0] = MQExprTopoPair("area", 2);
exprs[1] = MQExprTopoPair("aspect_gamma", 3);
exprs[2] = MQExprTopoPair("aspect", -1);
exprs[3] = MQExprTopoPair("condition", -1);
exprs[4] = MQExprTopoPair("diagonal", 3);
exprs[5] = MQExprTopoPair("dimension", 3);
exprs[6] = MQExprTopoPair("jacobian", -1);
exprs[7] = MQExprTopoPair("max_edge_length", -1);
exprs[8] = MQExprTopoPair("max_side_volume", 3);
exprs[9] = MQExprTopoPair("maximum_angle", 2);
exprs[10] = MQExprTopoPair("min_edge_length", -1);
exprs[11] = MQExprTopoPair("min_side_volume", 3);
exprs[12] = MQExprTopoPair("minimum_angle", 2);
exprs[13] = MQExprTopoPair("oddy", -1);
exprs[14] = MQExprTopoPair("relative_size", -1);
exprs[15] = MQExprTopoPair("scaled_jacobian", -1);
exprs[16] = MQExprTopoPair("shape", -1);
exprs[17] = MQExprTopoPair("shape_and_size", -1);
exprs[18] = MQExprTopoPair("shear", -1);
exprs[19] = MQExprTopoPair("skew", -1);
exprs[20] = MQExprTopoPair("stretch", -1);
exprs[21] = MQExprTopoPair("taper", -1);
exprs[22] = MQExprTopoPair("volume", 3);
exprs[23] = MQExprTopoPair("warpage", 2);
exprs[24] = MQExprTopoPair("face_planarity", 3);
exprs[25] = MQExprTopoPair("relative_face_planarity", 3);
exprs[4] = MQExprTopoPair("diagonal_ratio", 3);
exprs[5] = MQExprTopoPair("min_diagonal", 3);
exprs[6] = MQExprTopoPair("max_diagonal", 3);
exprs[7] = MQExprTopoPair("dimension", 3);
exprs[8] = MQExprTopoPair("jacobian", -1);
exprs[9] = MQExprTopoPair("max_edge_length", -1);
exprs[10] = MQExprTopoPair("max_side_volume", 3);
exprs[11] = MQExprTopoPair("maximum_angle", 2);
exprs[12] = MQExprTopoPair("min_edge_length", -1);
exprs[13] = MQExprTopoPair("min_side_volume", 3);
exprs[14] = MQExprTopoPair("minimum_angle", 2);
exprs[15] = MQExprTopoPair("oddy", -1);
exprs[16] = MQExprTopoPair("relative_size", -1);
exprs[17] = MQExprTopoPair("scaled_jacobian", -1);
exprs[18] = MQExprTopoPair("shape", -1);
exprs[19] = MQExprTopoPair("shape_and_size", -1);
exprs[20] = MQExprTopoPair("shear", -1);
exprs[21] = MQExprTopoPair("skew", -1);
exprs[22] = MQExprTopoPair("stretch", -1);
exprs[23] = MQExprTopoPair("taper", -1);
exprs[24] = MQExprTopoPair("volume", 3);
exprs[25] = MQExprTopoPair("warpage", 2);
exprs[26] = MQExprTopoPair("face_planarity", 3);
exprs[27] = MQExprTopoPair("relative_face_planarity", 3);
for (int j = 0 ; j < nPairs ; j++)
{
......
......@@ -246,6 +246,9 @@
#
# Brad Whitlock, Tue Jun 2 10:14:37 PDT 2009
# I split up avtExprNode into several files to speed compilation on xlC.
#
# Sean Ahern, Wed Jun 24 15:19:46 EDT 2009
# Renamed Diagonal to DiagonalRatio. Added MaxDiagonal and MinDiagonal.
#
##############################################################################
......@@ -439,7 +442,9 @@ MeshQuality_src= \
MeshQuality/avtVMetricAspectGamma.C \
MeshQuality/avtVMetricAspectRatio.C \
MeshQuality/avtVMetricCondition.C \
MeshQuality/avtVMetricDiagonal.C \
MeshQuality/avtVMetricMaxDiagonal.C \
MeshQuality/avtVMetricMinDiagonal.C \
MeshQuality/avtVMetricDiagonalRatio.C \
MeshQuality/avtVMetricDimension.C \
MeshQuality/avtVMetricJacobian.C \
MeshQuality/avtVMetricMaximumAngle.C \
......
......@@ -49,7 +49,9 @@
#include <avtVMetricAspectGamma.h>
#include <avtVMetricAspectRatio.h>
#include <avtVMetricCondition.h>
#include <avtVMetricDiagonal.h>
#include <avtVMetricDiagonalRatio.h>
#include <avtVMetricMinDiagonal.h>
#include <avtVMetricMaxDiagonal.h>
#include <avtVMetricDimension.h>
#include <avtVMetricJacobian.h>
#include <avtVMetricMaximumAngle.h>
......@@ -154,8 +156,12 @@ avtFunctionExpr::CreateMeshQualityFilters(const string &functionName) const
}
else if (functionName == "stretch")
f = new avtVMetricStretch();
else if (functionName == "diagonal")
f = new avtVMetricDiagonal();
else if (functionName == "diagonal_ratio")
f = new avtVMetricDiagonalRatio();
else if (functionName == "max_diagonal")
f = new avtVMetricMaxDiagonal();
else if (functionName == "min_diagonal")
f = new avtVMetricMinDiagonal();
else if (functionName == "dimension")
f = new avtVMetricDimension();
else if (functionName == "oddy")
......
......@@ -37,10 +37,10 @@
*****************************************************************************/
// ************************************************************************* //
// avtVMetricDiagonal.C //
// avtVMetricDiagonalRatio.C //
// ************************************************************************* //
#include "avtVMetricDiagonal.h"
#include "avtVMetricDiagonalRatio.h"
#include <vtkCellType.h>
#include <vtkDataSet.h>
......@@ -51,17 +51,18 @@
#include <DebugStream.h>
// ****************************************************************************
// Method: avtVMetricDiagonal::Metric
// Method: avtVMetricDiagonalRatio::Metric
//
// Purpose:
// Inspect an element and calculate the diagonal.
// Inspect an element and calculate the diagonal ratio.
//
// Arguments:
// coords The set of xyz points for the cell.
// numPoints The number of xyz points for the cell.
// type The vtk type of the cell.
//
// Returns: The diagonal of the cell, or defaultValue if not supported.
// Returns: The diagonal ratio of the cell, or defaultValue if not
// supported.
//
// Programmer: Akira Haddox
// Creation: June 13, 2002
......@@ -71,16 +72,19 @@
// Hank Childs, Thu Oct 17 08:07:53 PDT 2002
// Update for new verdict interface.
//
// Sean Ahern, Wed Jun 24 15:17:29 EDT 2009
// Renamed to be the diagonal ratio, which is what it actual returns.
//
// ****************************************************************************
double avtVMetricDiagonal::Metric (double coords[][3], int type)
double avtVMetricDiagonalRatio::Metric (double coords[][3], int type)
{
#ifdef HAVE_VERDICT
switch (type)
{
case VTK_HEXAHEDRON:
case VTK_VOXEL:
return v_hex_diagonal(8, coords);
return v_hex_diagonal_ratio(8, coords);
}
#endif
return -1;
......
......@@ -37,31 +37,29 @@
*****************************************************************************/
// ************************************************************************* //
// avtVMetricDiagonal.h //
// avtVMetricDiagonalRatio.h //
// ************************************************************************* //
#ifndef AVT_VMETRIC_DIAGONAL_H
#define AVT_VMETRIC_DIAGONAL_H
#ifndef AVT_VMETRIC_DIAGONAL_RATIO_H
#define AVT_VMETRIC_DIAGONAL_RATIO_H
#include <expression_exports.h>
#include <avtVerdictExpression.h>
// ****************************************************************************
// Class: avtVMetricDiagonal
// Class: avtVMetricDiagonalRatio
//
// Purpose:
// This metric measures aspect ratio.
// This metric measures diagonal ratio.
//
// Programmer: Akira Haddox
// Creation: June 13, 2002
//
// ****************************************************************************
class EXPRESSION_API avtVMetricDiagonal : public avtVerdictExpression
class EXPRESSION_API avtVMetricDiagonalRatio : public avtVerdictExpression
{
public:
double Metric(double coords[][3], int type);
};
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtVMetricMaxDiagonal.C //
// ************************************************************************* //
#include "avtVMetricMaxDiagonal.h"
#include <vtkCellType.h>
#include <vtkDataSet.h>
#include <vtkFloatArray.h>
#include <verdict.h>
#include <DebugStream.h>
// ****************************************************************************
// Method: avtVMetricMaxDiagonal::Metric
//
// Purpose:
// Inspect an element and calculate the max diagonal length.
//
// Arguments:
// coords The set of xyz points for the cell.
// numPoints The number of xyz points for the cell.
// type The vtk type of the cell.
//
// Returns: The max diagonal length of the cell, or defaultValue if not
// supported.
//
// Programmer: Sean Ahern
// Creation: June 24, 2009
//
// Modifications:
//
// ****************************************************************************
double avtVMetricMaxDiagonal::Metric (double coords[][3], int type)
{
#ifdef HAVE_VERDICT
switch (type)
{
case VTK_HEXAHEDRON:
case VTK_VOXEL:
return v_hex_max_diagonal(8, coords);
}
#endif
return -1;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtVMetricMaxDiagonal.h //
// ************************************************************************* //
#ifndef AVT_VMETRIC_MAX_DIAGONAL_H
#define AVT_VMETRIC_MAX_DIAGONAL_H
#include <expression_exports.h>
#include <avtVerdictExpression.h>
// ****************************************************************************
// Class: avtVMetricMaxDiagonal
//
// Purpose:
// This metric measures max diagonal length.
//
// Programmer: Sean Ahern
// Creation: June 24, 2009
//
// ****************************************************************************
class EXPRESSION_API avtVMetricMaxDiagonal : public avtVerdictExpression
{
public:
double Metric(double coords[][3], int type);
};
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtVMetricMinDiagonal.C //
// ************************************************************************* //
#include "avtVMetricMinDiagonal.h"
#include <vtkCellType.h>
#include <vtkDataSet.h>
#include <vtkFloatArray.h>
#include <verdict.h>
#include <DebugStream.h>
// ****************************************************************************
// Method: avtVMetricMinDiagonal::Metric
//
// Purpose:
// Inspect an element and calculate the min diagonal length.
//
// Arguments:
// coords The set of xyz points for the cell.
// numPoints The number of xyz points for the cell.
// type The vtk type of the cell.
//
// Returns: The min diagonal length of the cell, or defaultValue if not
// supported.
//
// Programmer: Sean Ahern
// Creation: June 24, 2009
//
// Modifications:
//
// ****************************************************************************
double avtVMetricMinDiagonal::Metric (double coords[][3], int type)
{
#ifdef HAVE_VERDICT
switch (type)
{
case VTK_HEXAHEDRON:
case VTK_VOXEL:
return v_hex_min_diagonal(8, coords);
}
#endif
return -1;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtVMetricMinDiagonal.h //
// ************************************************************************* //
#ifndef AVT_VMETRIC_MIN_DIAGONAL_H
#define AVT_VMETRIC_MIN_DIAGONAL_H
#include <expression_exports.h>
#include <avtVerdictExpression.h>
// ****************************************************************************
// Class: avtVMetricMinDiagonal
//
// Purpose:
// This metric measures min diagonal length.
//
// Programmer: Sean Ahern
// Creation: June 24, 2009
//
// ****************************************************************************
class EXPRESSION_API avtVMetricMinDiagonal : public avtVerdictExpression
{
public:
double Metric(double coords[][3], int type);
};
#endif
......@@ -168,7 +168,9 @@ const char *expr_meshquality[] = {
"aspect_gamma",
"condition",
"degree",
"diagonal",
"diagonal_ratio",
"min_diagonal",
"max_diagonal",
"dimension",
"jacobian",
"max_edge_length",
......
../../avt/Expressions/MeshQuality/avtVMetricDiagonal.h
\ No newline at end of file
../../avt/Expressions/MeshQuality/avtVMetricDiagonalRatio.h
\ No newline at end of file
../../avt/Expressions/MeshQuality/avtVMetricMaxDiagonal.h
\ No newline at end of file
../../avt/Expressions/MeshQuality/avtVMetricMinDiagonal.h
\ No newline at end of file
......@@ -716,12 +716,33 @@ C_FUNC_DEF VERDICT_REAL v_hex_stretch( int /*num_nodes*/, VERDICT_REAL coordinat
return (VERDICT_REAL) VERDICT_MAX( stretch, -VERDICT_DBL_MAX );
}
/*!
Min diagonal length of a hex
*/
C_FUNC_DEF VERDICT_REAL v_hex_min_diagonal( int /*num_nodes*/, VERDICT_REAL coordinates[][3] )
{
double min_diag = diag_length( 0, coordinates );
return (VERDICT_REAL)min_diag;
}
/*!
Max diagonal length of a hex
*/
C_FUNC_DEF VERDICT_REAL v_hex_max_diagonal( int /*num_nodes*/, VERDICT_REAL coordinates[][3] )
{
double max_diag = diag_length( 1, coordinates );
return (VERDICT_REAL)max_diag;
}
/*!
diagonal ratio of a hex
Minimum diagonal length / maximum diagonal length
*/
C_FUNC_DEF VERDICT_REAL v_hex_diagonal( int /*num_nodes*/, VERDICT_REAL coordinates[][3] )
C_FUNC_DEF VERDICT_REAL v_hex_diagonal_ratio( int /*num_nodes*/, VERDICT_REAL coordinates[][3] )
{
double min_diag = diag_length( 0, coordinates );
......@@ -3010,8 +3031,12 @@ C_FUNC_DEF void v_hex_quality( int num_nodes, VERDICT_REAL coordinates[][3],
}
if(metrics_request_flag & V_HEX_DIAGONAL)
metric_vals->diagonal = v_hex_diagonal(num_nodes, coordinates);
if(metrics_request_flag & V_HEX_DIAGONAL_RATIO)
metric_vals->diagonal_ratio = v_hex_diagonal_ratio(num_nodes, coordinates);
if(metrics_request_flag & V_HEX_MAX_DIAGONAL)
metric_vals->max_diagonal = v_hex_max_diagonal(num_nodes, coordinates);
if(metrics_request_flag & V_HEX_MIN_DIAGONAL)
metric_vals->min_diagonal = v_hex_min_diagonal(num_nodes, coordinates);
if(metrics_request_flag & V_HEX_DIMENSION)
metric_vals->dimension = v_hex_dimension(num_nodes, coordinates);
if(metrics_request_flag & V_HEX_DISTORTION)
......@@ -3049,11 +3074,11 @@ C_FUNC_DEF void v_hex_quality( int num_nodes, VERDICT_REAL coordinates[][3],
else
metric_vals->stretch = (VERDICT_REAL) VERDICT_MAX( metric_vals->stretch, -VERDICT_DBL_MAX );
//diagonal
if( metric_vals->diagonal > 0 )
metric_vals->diagonal = (VERDICT_REAL) VERDICT_MIN( metric_vals->diagonal, VERDICT_DBL_MAX );
//diagonal ratio
if( metric_vals->diagonal_ratio > 0 )
metric_vals->diagonal_ratio = (VERDICT_REAL) VERDICT_MIN( metric_vals->diagonal_ratio, VERDICT_DBL_MAX );
else
metric_vals->diagonal = (VERDICT_REAL) VERDICT_MAX( metric_vals->diagonal, -VERDICT_DBL_MAX );
metric_vals->diagonal_ratio = (VERDICT_REAL) VERDICT_MAX( metric_vals->diagonal_ratio, -VERDICT_DBL_MAX );
//dimension
if( metric_vals->dimension > 0 )
......
......@@ -93,8 +93,12 @@ struct HexMetricVals
VERDICT_REAL volume ;
/** \sa v_hex_stretch */
VERDICT_REAL stretch ;
/** \sa v_hex_diagonal */
VERDICT_REAL diagonal ;
/** \sa v_hex_max_diagonal */
VERDICT_REAL max_diagonal ;
/** \sa v_hex_min_diagonal */
VERDICT_REAL min_diagonal ;
/** \sa v_hex_diagonal_ratio */
VERDICT_REAL diagonal_ratio ;
/** \sa v_hex_dimension */
VERDICT_REAL dimension ;
/** \sa v_hex_oddy */
......@@ -294,30 +298,32 @@ struct TriMetricVals
//!
//@{
#define V_HEX_ASPECT 1 /*!< \hideinitializer */
#define V_HEX_SKEW 2 /*!< \hideinitializer */
#define V_HEX_TAPER 4 /*!< \hideinitializer */
#define V_HEX_VOLUME 8 /*!< \hideinitializer */
#define V_HEX_STRETCH 16 /*!< \hideinitializer */
#define V_HEX_DIAGONAL 32 /*!< \hideinitializer */
#define V_HEX_DIMENSION 64 /*!< \hideinitializer */
#define V_HEX_ODDY 128 /*!< \hideinitializer */
#define V_HEX_CONDITION 256 /*!< \hideinitializer */
#define V_HEX_JACOBIAN 512 /*!< \hideinitializer */
#define V_HEX_SCALED_JACOBIAN 1024 /*!< \hideinitializer */
#define V_HEX_SHEAR 2048 /*!< \hideinitializer */
#define V_HEX_SHAPE 4096 /*!< \hideinitializer */
#define V_HEX_RELATIVE_SIZE_SQUARED 8192 /*!< \hideinitializer */
#define V_HEX_SHAPE_AND_SIZE 16384 /*!< \hideinitializer */
#define V_HEX_SHEAR_AND_SIZE 32768 /*!< \hideinitializer */
#define V_HEX_DISTORTION 65536 /*!< \hideinitializer */
#define V_HEX_ALL 131071 /*!< \hideinitializer */
#define V_HEX_ASPECT 0x000001 /*!< \hideinitializer */
#define V_HEX_SKEW 0x000002 /*!< \hideinitializer */
#define V_HEX_TAPER 0x000004 /*!< \hideinitializer */
#define V_HEX_VOLUME 0x000008 /*!< \hideinitializer */
#define V_HEX_STRETCH 0x000010 /*!< \hideinitializer */
#define V_HEX_DIAGONAL_RATIO 0x000020 /*!< \hideinitializer */
#define V_HEX_DIMENSION 0x000040 /*!< \hideinitializer */
#define V_HEX_ODDY 0x000080 /*!< \hideinitializer */
#define V_HEX_CONDITION 0x000100 /*!< \hideinitializer */
#define V_HEX_JACOBIAN 0x000200 /*!< \hideinitializer */
#define V_HEX_SCALED_JACOBIAN 0x000400 /*!< \hideinitializer */
#define V_HEX_SHEAR 0x000800 /*!< \hideinitializer */
#define V_HEX_SHAPE 0x001000 /*!< \hideinitializer */
#define V_HEX_RELATIVE_SIZE_SQUARED 0x002000 /*!< \hideinitializer */
#define V_HEX_SHAPE_AND_SIZE 0x004000 /*!< \hideinitializer */
#define V_HEX_SHEAR_AND_SIZE 0x008000 /*!< \hideinitializer */
#define V_HEX_DISTORTION 0x010000 /*!< \hideinitializer */
#define V_HEX_MIN_DIAGONAL 0x020000 /*!< \hideinitializer */
#define V_HEX_MAX_DIAGONAL 0x040000 /*!< \hideinitializer */
#define V_HEX_ALL 0x07ffff /*!< \hideinitializer */
/*!< \hideinitializer */
#define V_HEX_TRADITIONAL V_HEX_ASPECT + \
V_HEX_SKEW + \
V_HEX_TAPER + \
V_HEX_STRETCH + \
V_HEX_DIAGONAL + \
V_HEX_DIAGONAL_RATIO + \
V_HEX_ODDY + \
V_HEX_CONDITION + \
V_HEX_JACOBIAN + \
......@@ -626,7 +632,13 @@ struct TriMetricVals
//! Calculates hex diagonal metric
/** Minimum diagonal length / maximum diagonal length.
Reference --- Unknown */
C_FUNC_DEF VERDICT_REAL v_hex_diagonal( int num_nodes, VERDICT_REAL coordinates[][3] );
C_FUNC_DEF VERDICT_REAL v_hex_diagonal_ratio( int num_nodes, VERDICT_REAL coordinates[][3] );
//! Calculates max hex diagonal metric
C_FUNC_DEF VERDICT_REAL v_hex_max_diagonal( int num_nodes, VERDICT_REAL coordinates[][3] );
//! Calculates min hex diagonal metric
C_FUNC_DEF VERDICT_REAL v_hex_min_diagonal( int num_nodes, VERDICT_REAL coordinates[][3] );
//! Calculates hex dimension metric
/** Pronto-specific characteristic length for stable time step calculation.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment