Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/EdgeLengthRangeQualityMetric.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 
38 #ifndef EdgeLengthRangeQualityMetric_hpp
39 #define EdgeLengthRangeQualityMetric_hpp
40 
41 #include "Mesquite.hpp"
42 #include "MsqError.hpp"
44 
45 namespace Mesquite
46 {
60  class MsqMeshEntity;
61  class MsqVertex;
62 
64  {
65  public:
66 
67  //This is the form of the constructor that should beused.
68  EdgeLengthRangeQualityMetric(double low_a, double high_a, MsqError &err)
69  {
70  if(low_a>high_a){
71  MSQ_SETERR(err)("Edge Length Range values given in descending order.",
73  }
74  lowVal=low_a;
75  highVal=high_a;
76  avgMethod=SUM;
77  feasible=0;
79  set_name("Edge Length Range Metric");
80  }
81 
82  // virtual destructor ensures use of polymorphism during destruction
84  {}
85 
86 
87  protected:
88 
89  bool evaluate_vertex(PatchData &pd, MsqVertex *vert, double &fval,
90  MsqError &err);
91 
92  private:
93 
94  //Generally, this constructor should not be used.
96  {
97  lowVal=0;
98  highVal=0;
99  avgMethod=SUM;
100  feasible=0;
102  set_name("Edge Length Range Metric Default Constructor");
103  }
104 
105  double highVal;
106  double lowVal;
107 
108  };
109 
110 
111 } //namespace
112 
113 
114 #endif // EdgeLengthRangeQualityMetric_hpp
115 
116 
bool evaluate_vertex(PatchData &pd, MsqVertex *vert, double &fval, MsqError &err)
Computes the edge length range metric for a given vertex.
EdgeLengthRangeQualityMetric(double low_a, double high_a, MsqError &err)
Used to hold the error state and return it to the application.
invalid function argument passed
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
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.