Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/IdealWeightMeanRatio.hpp
Go to the documentation of this file.
1 /* *****************************************************************
2  MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4  Copyright 2004 Sandia Corporation and Argonne National
5  Laboratory. Under the terms of Contract DE-AC04-94AL85000
6  with Sandia Corporation, the U.S. Government retains certain
7  rights in this software.
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  (lgpl.txt) along with this library; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 
23  diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov,
24  pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov
25 
26  ***************************************************************** */
27 // -*- Mode : c++; tab-width: 3; c-tab-always-indent: t; indent-tabs-mode: nil; c-basic-offset: 3 -*-
28 
39 #ifndef IdealWeightMeanRatio_hpp
40 #define IdealWeightMeanRatio_hpp
41 
42 #include "Mesquite.hpp"
43 #include "MsqError.hpp"
44 #include "ShapeQualityMetric.hpp"
45 #include "Vector3D.hpp"
46 #include "Matrix3D.hpp"
47 #include "Exponent.hpp"
48 
49 namespace Mesquite
50 {
62  {
63  public:
64 
66  : a2Con(2.0),
67  b2Con(-1.0),
68  c2Con(1.0),
69  a3Con(3.0),
70  b3Con(-1.0),
71  c3Con(2.0/3.0)
72  {
73  MsqError err;
76  set_negate_flag(-1);
80  feasible=1;
81  set_name("Mean Ratio");
82  }
83 
86  }
87 
89  bool evaluate_element(PatchData &pd, MsqMeshEntity *element,
90  double &fval, MsqError &err);
91 
93  MsqMeshEntity *element,
94  MsqVertex *free_vtces[],
95  Vector3D grad_vec[],
96  int num_vtx,
97  double &metric_value,
98  MsqError &err);
99 
101  MsqMeshEntity *e,
102  MsqVertex *v[],
103  Vector3D g[],
104  Matrix3D h[],
105  int nv,
106  double &m,
107  MsqError &err);
108 
109  private:
110  // arrays used in Hessian computations
111  // We allocate them here, so that one allocation only is done.
112  // This gives a big computation speed increase.
113  Vector3D mCoords[4]; // Vertex coordinates for the (decomposed) elements
114  Vector3D mGradients[32]; // Gradient of metric with respect to the coords
115  Vector3D mAccumGrad[8]; // Accumulated gradients (composed merit)
116  Matrix3D mHessians[80]; // Hessian of metric with respect to the coords
117  double mMetrics[8]; // Metric values for the (decomposed) elements
118 
119  const double a2Con;
122 
123  const double a3Con;
126 
127  };
128 } //namespace
129 
130 
131 #endif // IdealWeightMeanRatio_hpp
132 
133 
Used to hold the error state and return it to the application.
MsqMeshEntity is the Mesquite object that stores information about the elements in the mesh...
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void set_hessian_type(HESSIAN_TYPE ht)
Sets hessianType for this metric.
virtual ~IdealWeightMeanRatio()
virtual destructor ensures use of polymorphism during destruction
void set_element_evaluation_mode(ElementEvaluationMode mode, MsqError &err)
Sets the evaluation mode for the ELEMENT_BASED metrics.
bool compute_element_analytical_gradient(PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err)
Virtual function that computes the gradient of the QualityMetric analytically. The base class impleme...
3*3 Matric class, row-oriented, 0-based [i][j] indexing.
bool evaluate_element(PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err)
evaluate using mesquite objects
Computes the mean ratio quality metric of given element.
bool compute_element_analytical_hessian(PatchData &pd, MsqMeshEntity *e, MsqVertex *v[], Vector3D g[], Matrix3D h[], int nv, double &m, MsqError &err)
void set_gradient_type(GRADIENT_TYPE grad)
Sets gradType for this metric.
void set_metric_type(MetricType t)
This function should be used in the constructor of every concrete quality metric. ...
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
void set_name(msq_std::string st)
Sets the name of this metric.