Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
src/Control/InstructionQueue.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 MSQ_INSTRUCTION_QUEUE_HPP
39 #define MSQ_INSTRUCTION_QUEUE_HPP
40 
41 #include "Mesquite.hpp"
42 
43 #ifdef MSQ_USE_OLD_STD_HEADERS
44 # include <list.h>
45 #else
46 # include <list>
47 #endif
48 
49 namespace Mesquite {
50 
51  class MsqError;
52  class QualityImprover;
53  class QualityAssessor;
54  class MeshSet;
55  class PatchDataUser;
56  class PatchData;
57  class TargetCalculator;
58 
73  class InstructionQueue
74  {
75 
76  public:
78 
79  virtual ~InstructionQueue() {};
80 
82 
83  void add_preconditioner(QualityImprover* instr, MsqError &err);
84  void remove_preconditioner(size_t index, MsqError &err);
85  void insert_preconditioner(QualityImprover* instr, size_t index, MsqError &err);
86 
88  void remove_quality_assessor(size_t index, MsqError &err);
89  void insert_quality_assessor(QualityAssessor* instr, size_t index, MsqError &err);
90 
92 
94  { autoQualAssess = false; }
96  { autoQualAssess = true; }
97 
99  { autoAdjMidNodes = false; }
101  { autoAdjMidNodes = true; }
102 
105  virtual void run_instructions(MeshSet &msc, MsqError &err);
106  void clear();
107 
127  void trap_floating_point_exception( bool enable )
128  { trapFPE = enable; }
130  { return trapFPE; }
131 
132 
133  protected:
134 
135  private:
136  msq_std::list<PatchDataUser*>::iterator clear_master(MsqError &err);
137 
138  msq_std::list<PatchDataUser*> instructions;
139 
140  bool autoQualAssess;
141  bool autoAdjMidNodes;
142 
143  size_t nbPreConditionners;
144  bool isMasterSet;
145  size_t masterInstrIndex;
146 
149 
151  bool trapFPE;
152  };
153 
154 
155 } //namespace
156 
157 
158 #endif // InstructionQueue_hpp
msq_std::list< PatchDataUser * >::iterator clear_master(MsqError &err)
void remove_quality_assessor(size_t index, MsqError &err)
removes a QualityAssessor* from the instruction queue
Used to hold the error state and return it to the application.
PatchData * globalPatch
Used to prevent reallocating a global patch for successive global algorithms.
void set_master_quality_improver(QualityImprover *instr, MsqError &err)
Base class for all quality improvers. Mote that the PatchData settings are inherited from the PathDat...
void remove_preconditioner(size_t index, MsqError &err)
removes a QualityImprover* from the instruction queue
void add_target_calculator(TargetCalculator *tc, MsqError &err)
msq_std::list< PatchDataUser * > instructions
A QualityAssessor instance can be inserted into an InstructionQueue to calculate and summarize regist...
void add_quality_assessor(QualityAssessor *instr, MsqError &err)
adds a QualityAssessor to the instruction queue.
void add_preconditioner(QualityImprover *instr, MsqError &err)
adds a QualityImprover at the end of the instruction list
void trap_floating_point_exception(bool enable)
Generate SIGFPE whenever a floating point exception occurs.
Base class that provides the interface for computing the target corner matrices used in the context b...
virtual void run_instructions(MeshSet &msc, MsqError &err)
This function is virtual so that it may be redefined in the wraper classes.
void insert_quality_assessor(QualityAssessor *instr, size_t index, MsqError &err)
inserts a QualityAssessor* into the instruction queue.
void insert_preconditioner(QualityImprover *instr, size_t index, MsqError &err)
inserts a QualityImprover* into the instruction queue.
The MeshSet class stores one or more Mesquite::Mesh pointers and manages access to the mesh informati...