Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/I_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 I_DFT_hpp
38 #define I_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 
69  class I_DFT : public DistanceFromTarget
70  {
71  public:
72 
74  {
75  MsqError err;
80  set_name("I_DFT");
81  mAlpha = 1/2.0;
82  mBeta = 1.0;
84  useBarrierDelta = true;
85  }
86 
88  virtual ~I_DFT()
89  {};
90 
91  bool evaluate_element(PatchData &pd,
92  MsqMeshEntity *e,
93  double &m, MsqError &err);
94 
96  MsqMeshEntity *e,
97  MsqVertex *fv[],
98  Vector3D g[],
99  int nfv,
100  double &m,
101  MsqError &err);
102 
104  MsqMeshEntity *e,
105  MsqVertex *fv[],
106  Vector3D g[],
107  Matrix3D h[],
108  int nfv,
109  double &m,
110  MsqError &err);
111 
112 
113  protected:
114 
116  void p_set_alpha(double alpha)
117  {mAlpha = alpha;}
119  double p_get_alpha()
120  {return mAlpha;}
122  void p_set_beta(double beta)
123  {mBeta = beta;}
125  double p_get_beta()
126  {return mBeta;}
128  void p_set_gamma(double gamma)
129  {mGamma = gamma;}
131  double p_get_gamma()
132  {return mGamma;}
134  void p_set_use_barrier_delta(bool use_delta)
135  {useBarrierDelta = use_delta;}
138  {return useBarrierDelta;}
139 
140 
141  private:
142  // variables used in the definition of the metric (2d and 3d)
143  double mAlpha;
144  double mBeta;
147  // variables used during the analytic gradient calculations
148  Vector3D mNormals[4]; // Normal vector for merit function
149  Vector3D mCoords[4]; // Vertex coordinates
150  Vector3D mGrads[4]; // Gradients for element
151  Vector3D mAccGrads[8]; // Accumulated gradients
152  Matrix3D mHessians[10]; // Hessian values for element
153  Matrix3D mR; // R (in QR factorization of W)
154  Matrix3D invR; // Inverse matrix of R (in QR factorization)
155  Matrix3D mQ; // Q (in QR factorization of W)
156  };
157 
158 } //namespace
159 
160 
161 #endif // I_DFT_hpp
void set_averaging_method(AveragingMethod method, MsqError &err)
static const double MSQ_TWO_THIRDS
Definition: Mesquite.hpp:129
Base class for the computation of the distance from target between the target matrices W and the actu...
double p_get_gamma()
access function to get mGamma
Used to hold the error state and return it to the application.
double p_get_alpha()
access function to get mAlpha
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...
bool p_get_use_barrier_delta()
access function to get useBarrierDelta
bool compute_element_analytical_hessian(PatchData &pd, MsqMeshEntity *e, MsqVertex *fv[], Vector3D g[], Matrix3D h[], int nfv, double &m, MsqError &err)
void set_hessian_type(HESSIAN_TYPE ht)
Sets hessianType for this metric.
void p_set_gamma(double gamma)
access function to set mGamma
void p_set_alpha(double alpha)
access function to set mAlpha
void p_set_use_barrier_delta(bool use_delta)
access function to set useBarrierDelta
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 p_set_beta(double beta)
access function to set mBeta
double p_get_beta()
access function to get mBeta
virtual ~I_DFT()
virtual destructor ensures use of polymorphism during destruction
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...
void set_name(msq_std::string st)
Sets the name of this metric.
Class containing the target corner matrices for the context based smoothing.