Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/RI_DFT.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 
37 #ifndef RI_DFT_hpp
38 #define RI_DFT_hpp
39 
40 #include "Mesquite.hpp"
41 #include "MsqError.hpp"
42 #include "DistanceFromTarget.hpp"
43 #include "Exponent.hpp"
44 
45 namespace Mesquite
46 {
47 
51  class RI_DFT : public DistanceFromTarget
52  {
53  public:
54 
56  : a(pow(2.0, MSQ_ONE_THIRD)), b(1.0), c(-4.0/3.0)
57  {
58  MsqError err;
63  }
64 
66  virtual ~RI_DFT()
67  {};
68 
69  bool evaluate_element(PatchData &pd,
70  MsqMeshEntity *e,
71  double &m, MsqError &err);
72 
74  MsqMeshEntity *e,
75  MsqVertex *fv[],
76  Vector3D g[],
77  int nfv,
78  double &m,
79  MsqError &err);
80 
82  MsqMeshEntity *e,
83  MsqVertex *fv[],
84  Vector3D g[],
85  Matrix3D h[],
86  int nfv,
87  double &m,
88  MsqError &err);
89 
90  protected:
91 
92  private:
93  // variables used in the definition of the metric (2d and 3d)
94  double a;
97 
98  // variables used during the analytic gradient calculations
99  Vector3D mNormal; // Normal vector for merit function
100  Vector3D mCoords[4]; // Vertex coordinates
101  Vector3D mGrads[4]; // Gradients for element
102  Vector3D mAccGrads[8]; // Accumulated gradients
103  Matrix3D mHessians[10]; // Hessian values for element
104  Matrix3D invW; // Inverse matrix
105  };
106 
107 
108 } //namespace
109 
110 
111 #endif // RI_DFT_hpp
void set_averaging_method(AveragingMethod method, MsqError &err)
static const double MSQ_ONE_THIRD
Definition: Mesquite.hpp:128
Base class for the computation of the distance from target between the target matrices W and the actu...
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...
virtual ~RI_DFT()
virtual destructor ensures use of polymorphism during destruction
bool compute_element_analytical_gradient(PatchData &pd, MsqMeshEntity *e, MsqVertex *fv[], Vector3D g[], int nfv, double &m, MsqError &err)
Virtual function that computes the gradient of the QualityMetric analytically. The base class impleme...
void set_hessian_type(HESSIAN_TYPE ht)
Sets hessianType for this metric.
bool compute_element_analytical_hessian(PatchData &pd, MsqMeshEntity *e, MsqVertex *fv[], Vector3D g[], Matrix3D h[], int nfv, double &m, MsqError &err)
Class containing the target corner matrices for the context based smoothing.
#define MSQ_CHKERR(err)
Mesquite's Error Checking macro.
3*3 Matric class, row-oriented, 0-based [i][j] indexing.
bool evaluate_element(PatchData &pd, MsqMeshEntity *e, double &m, MsqError &err)
Evaluate the metric for an element.
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...
double pow(double value, const Exponent &exp)