Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/IdealWeightInverseMeanRatio.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 IdealWeightInverseMeanRatio_hpp
40 #define IdealWeightInverseMeanRatio_hpp
41 
42 #include "Mesquite.hpp"
43 #include "ShapeQualityMetric.hpp"
44 #include "Vector3D.hpp"
45 #include "Matrix3D.hpp"
46 #include "Exponent.hpp"
47 
48 namespace Mesquite
49 {
50  class MsqMeshEntity;
51  class PatchData;
52  class MsqError;
53 
72  {
73  public:
74  IdealWeightInverseMeanRatio(MsqError& err, double pow_dbl = 1.0);
75 
78  }
79 
81  bool evaluate_element(PatchData &pd, MsqMeshEntity *element,
82  double &fval, MsqError &err);
83 
85  MsqMeshEntity *element,
86  MsqVertex *free_vtces[],
87  Vector3D grad_vec[],
88  int num_vtx,
89  double &metric_value,
90  MsqError &err);
91 
93  MsqMeshEntity *e,
94  MsqVertex *v[],
95  Vector3D g[],
96  Matrix3D h[],
97  int nv,
98  double &m,
99  MsqError &err);
100 
101  private:
103  void set_metric_power(double pow_dbl, MsqError& err);
104 
105  // arrays used in Hessian computations
106  // We allocate them here, so that one allocation only is done.
107  // This gives a big computation speed increase.
108  Vector3D mCoords[4]; // Vertex coordinates for the (decomposed) elements
109  Vector3D mGradients[32]; // Gradient of metric with respect to the coords
110  Vector3D mAccumGrad[8]; // Accumulated gradients (composed merit)
111  Matrix3D mHessians[80]; // Hessian of metric with respect to the coords
112  double mMetrics[8]; // Metric values for the (decomposed) elements
113  double g_factor[8]; // Metric values for the (decomposed) elements
114  double h_factor[8]; // Metric values for the (decomposed) elements
115  //variables used in the definition of the metric (2d and 3d)
116  double a2Con;
119 
120  double a3Con;
123  };
124 } //namespace
125 
126 
127 #endif // IdealWeightInverseMeanRatio_hpp
Used to hold the error state and return it to the application.
Computes the inverse mean ratio of given element.
bool evaluate_element(PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err)
evaluate using mesquite objects
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...
virtual ~IdealWeightInverseMeanRatio()
virtual destructor ensures use of polymorphism during destruction
*********************************************************************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
bool compute_element_analytical_hessian(PatchData &pd, MsqMeshEntity *e, MsqVertex *v[], Vector3D g[], Matrix3D h[], int nv, double &m, MsqError &err)
3*3 Matric class, row-oriented, 0-based [i][j] indexing.
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...
void set_metric_power(double pow_dbl, MsqError &err)
Sets the power value in the metric computation.
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...