Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
inks/CornerJacobianQualityMetric.cpp
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  ***************************************************************** */
34 #include "CornerJacobianQualityMetric.hpp"
35 #include "Vector3D.hpp"
36 #include "ShapeQualityMetric.hpp"
37 #include "QualityMetric.hpp"
38 
39 #ifdef MSQ_USE_OLD_STD_HEADERS
40 # include <vector.h>
41 #else
42 # include <vector>
43  using std::vector;
44 #endif
45 
46 using namespace Mesquite;
47 
49 {
50  MsqError err;
54  feasible=0;
55  set_name("Corner Jacobian Volume (or Area)");
56 }
57 
59  MsqMeshEntity *element,
60  double &fval,
61  MsqError &err)
62 {
63  switch(element->get_element_type()){
64  case TRIANGLE:
65  case QUADRILATERAL:
66  fval=element->compute_unsigned_area(pd,err); MSQ_ERRZERO(err);
67  break;
68  case TETRAHEDRON:
69  case HEXAHEDRON:
70  fval=element->compute_unsigned_volume(pd,err); MSQ_ERRZERO(err);
71  break;
72  default:
73  fval=MSQ_MAX_CAP;
74  }// end switch over element type
75  return true;
76 }
77 
78 
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
const double MSQ_MAX_CAP
Definition: Mesquite.hpp:173
Used to hold the error state and return it to the application.
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...
double compute_unsigned_volume(PatchData &pd, MsqError &err)
Computes the volume of the element.
void set_element_evaluation_mode(ElementEvaluationMode mode, MsqError &err)
Sets the evaluation mode for the ELEMENT_BASED metrics.
#define MSQ_CHKERR(err)
Mesquite&#39;s Error Checking macro.
double compute_unsigned_area(PatchData &pd, MsqError &err)
Computes the area of the element.
EntityTopology get_element_type() const
Returns element type.
void set_metric_type(MetricType t)
This function should be used in the constructor of every concrete quality metric. ...
void set_name(msq_std::string st)
Sets the name of this metric.