00001 /* 00002 * Copyright (c) 2001 The AUTHORS 00003 * Romeu Andre' Pieritz, Ph.D. - romeu_pieritz@hotmail.com 00004 * Rafael Mendes, Eng. – mendes_rafael@yahoo.com 00005 * Rodrigo Ferraz de Andrade, Eng. – rferraz@iname.com 00006 * All rights reserved. 00007 * 00008 * Permission to use, copy and distribute this software and its 00009 * documentation for educational and personal use, without fee is hereby granted, 00010 * provided that the above copyright notice and the following 00011 * two paragraphs appear in all copies of this software. 00012 * 00013 * IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR 00014 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 00015 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHORS 00016 * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00017 * 00018 * THE AUTHORS SPECIFICALLY DISCLAIMS ANY WARRANTIES, 00019 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 00020 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HERE UNDER IS 00021 * ON AN "AS IS" BASIS, AND THE AUTHORS HAVE NO OBLIGATION TO 00022 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 00023 * 00024 * SINMEC Lab. - CFD Sinflow Project - http://www.sinmec.ufsc.br/cfd 00025 */ 00026 00027 00028 // File Define 00029 #ifndef __CSFL_NUM_SEQUENCER_SEQUENCER_H__ 00030 #define __CSFL_NUM_SEQUENCER_SEQUENCER_H__ 00031 00032 // Include ===================================================================== 00033 #include <csfl/sys/core/action.h> 00034 00035 #include <csfl/sys/container/equation.h> 00036 #include <csfl/sys/math/linearsys9d.h> 00037 00038 #include <csfl/math/solver/solver.h> 00039 00040 #include <csfl/field/value/scalar.h> 00041 #include <csfl/field/value/vector.h> 00042 00043 00044 // Namespace 00045 namespace csfl { 00046 00047 //============================================================================== 00048 // Class ISequencer 00049 // Description: Base Class for the sequence objects 00050 //============================================================================== 00051 class ISequencerIO; 00052 00053 class ISequencer : 00054 virtual public ISFLObject 00055 00059 { 00060 00061 public: 00062 00070 ISequencer( 00071 const IString &_id = IString( "Base Sequencer") , 00072 IContainerEquation *_contEquation = NULL, 00073 ISolver *_solver = NULL, 00074 double _starttime = 0.0, 00075 double _finaltime = 1.0, 00076 double _steptime = 0.5 ); 00077 ISequencer( ISequencer *_s ); 00078 ~ISequencer(); 00079 00081 const IString ID() { return id; } 00082 00084 virtual void Run(); 00085 00087 int IteratorGlobal() { return itGlobal; } 00088 00092 void SetMaximumIteratorGlobal( int _v ) { itGlobalMax = _v; } 00093 00098 void SetIterMax( int _v ); 00099 00101 double RunTime() { return runtime; } 00102 00104 double StartTime() { return starttime; } 00105 00107 double FinalTime() { return finaltime; } 00108 00110 virtual ILinearSystem * LSys(){ return lsys; } 00111 00116 int IterationToWriteFile() { return iterwrite; } 00117 00122 void SetIterationToWriteFile( int _v ) { iterwrite = _v; } 00123 00125 double StepTime() { return steptime; } 00126 00130 void SetStepTime( double _v ) { steptime = _v; } 00131 00135 bool Iteract() { return iteract; } 00136 00141 void SetIteract( bool _v ) { iteract = _v; } 00142 00147 virtual void SetSolver( ISolver *_solver ); 00148 00152 ISolver * Solver() { return solver; } 00153 00155 void SetTimeFunction( IFunction *_f ); 00156 00159 IFunction * TimeFunction() { return timefunction; } 00160 00165 IContainerEquation * ContainerEquation(){ return contEquation; } 00166 00172 IAction ActionRequestBegin, ActionBegin, 00173 ActionRequestEnd, ActionEnd, 00174 ActionIteract, 00175 ActionIteractError, ActionSolutionError, //only for PVs-Energy 00176 ActionRequestIteract, ActionRequestRun; 00177 00178 public: 00179 00181 virtual void Write( ostream & ); 00182 00184 virtual void Read ( istream & ); 00185 00186 00187 protected: 00188 ISolver *solver; 00189 ILinearSystem9D *lsys; 00190 IContainerEquation *contEquation; 00191 IFunction *timefunction; 00192 00193 double starttime, finaltime, steptime, runtime; 00194 int itermax, iterwrite, niterwrite; 00195 bool iteract, iteractsteptime, convergence; 00196 00197 IString id; 00198 int nx, ny; 00199 int itGlobal, itGlobalMax; 00200 00201 //virtual em todas as derivadas..... 00202 virtual void Begin() {} 00203 virtual void Solution( double = 0.0 ) {} 00204 virtual void End() {} 00205 00206 virtual bool IteractError() { return false; } 00207 virtual bool SolutionError() { return false; } 00208 00209 virtual void InitVariables() {} 00210 virtual void ActualizeVariables() {} 00211 00212 double VariableError( IFieldScalar *, IFieldScalar * ); 00213 double VariableError( IFieldVector *, IFieldVector * ); 00214 friend class ISequencerIO; 00215 00216 }; 00217 } // csfl namespace 00218 00219 #endif // __CSFL_NUM_SEQUENCER_SEQUENCER_H__
CFD Project
|
Documents |
Downloads |
Contact us |
Use Terms |
|
|||
© SINMEC/EMC/UFSC,
2001. |
All rights
reserved. |
Last Update: Jan. 18, 2002 |
|