Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/QualityImprover.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  ***************************************************************** */
37 #ifndef Mesquite_QualityImprover_hpp
38 #define Mesquite_QualityImprover_hpp
39 
40 #include <string>
41 
42 #include "Mesquite.hpp"
43 #include "MsqError.hpp"
44 #include "TerminationCriterion.hpp"
45 #include "PatchDataUser.hpp"
46 
47 namespace Mesquite
48 {
49 
50  class MeshSet;
51 
58  {
59  public:
60 
61  // Constructor is protected ... see below.
62 
63  // virtual destructor ensures use of polymorphism during destruction
64  virtual ~QualityImprover() { };
65 
66  virtual double loop_over_mesh(MeshSet &ms, MsqError &err) = 0;
67 
69  void set_name(msq_std::string name)
70  {
71  qualityImproverName = name;
72  };
73 
75  virtual msq_std::string get_name() { return qualityImproverName; }
77 
81  {
83  }
87  {
89  }
90 
91  protected:
92 
97  {
98  //Temporary solution to not having an err object
99  MsqError temp_err;
103  }
104 
105  friend class MeshSet;
106  //friend double QualityMetric::evaluate_element(MsqMeshEntity* element, MsqError &err);
107  //friend double QualityMetric::evaluate_node(MsqNode* node, MsqError &err);
108  //will not be needed when we remove stopping criterion
109  const MeshSet* get_mesh_set() const
110  { return mMeshSet; }
112  { return mMeshSet; }
113 
114 
116  {
117  mMeshSet=ms;
118  }
121  { return outerTerminationCriterion; }
124  { return innerTerminationCriterion; }
125 
126  private:
128  msq_std::string qualityImproverName;
130 
133  //default TerminationCriterion for outer loop will be set in constructor
135  //default TerminationCriterion for inner loop set by concrete improver
137  };
138 
139 }
140 
141 #endif
Used to hold the error state and return it to the application.
Base class for all quality improvers. Mote that the PatchData settings are inherited from the PathDat...
TerminationCriterion * outerTerminationCriterion
The TerminationCriterion class contains functionality to terminate the VertexMover&#39;s optimization...
void set_name(msq_std::string name)
provides a name to the QualityImprover (use it in constructor).
This should be the parent class of all algorithms retrieving information from a MeshSet object...
TerminationCriterion * innerTerminationCriterion
virtual msq_std::string get_name()
retrieves the QualityImprover name. A default name should be set in the constructor.
TerminationCriterion * get_inner_termination_criterion()
return the inner termination criterion pointer
virtual AlgorithmType get_algorithm_type()
Return the algorithm type (to avoid RTTI use).
TerminationCriterion * get_outer_termination_criterion()
return the outer termination criterion pointer
Terminates when the number of iterations exceeds a given integer.
void set_outer_termination_criterion(TerminationCriterion *crit)
Sets in the termination criterion for the outer loop over patches.
void add_criterion_type_with_int(TCType tc_type, int bound, MsqError &err)
Sets the criterion by specifing the TCType and the integer value.
void set_inner_termination_criterion(TerminationCriterion *crit)
Sets in the termination criterion for the concrete solver&#39;s optimization.
The MeshSet class stores one or more Mesquite::Mesh pointers and manages access to the mesh informati...
virtual double loop_over_mesh(MeshSet &ms, MsqError &err)=0
This is the &quot;run&quot; function of PatchDataUser. It can do anything really.