Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

mesh.h

Go to the documentation of this file.
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_MESH_H__
00030 #define __CSFL_NUM_SEQUENCER_MESH_H__
00031 
00032 // Include =====================================================================
00033 #include <csfl/num/sequencer/sequencer.h>
00034 #include <csfl/math/equation/mesh_x.h>
00035 #include <csfl/math/equation/mesh_y.h>
00036 #include <csfl/sys/geom/dline.h>
00037 #include <csfl/sys/geom/dpolygon.h>
00038 
00039 
00040 // Namespace
00041 namespace csfl {
00042 
00043 //==============================================================================
00044 //              enum MeshGenerationType: Mesh Generation Type
00045 //==============================================================================
00046 typedef
00047         enum _MeshGenerationType {
00048                 mgtKsiInterpolation,
00049                 mgtEtaInterpolation,
00050                 mgtElliptical
00051         }
00052         MeshGenerationType;
00053 //==============================================================================
00054 //              Class ISequencerMesh
00055 //              Description: Class for the sequence objects
00056 //==============================================================================
00057 
00058 class ISequencerMesh : 
00059         public ISequencer
00063 {
00064 
00065 public:
00072         ISequencerMesh(
00073                 const IString &_id = IString( "MESH Sequencer") ,
00074                 IContainerEquation *_contEquation =NULL ,
00075                 ISolver *_solver = NULL,
00076                 MeshGenerationType _mot = mgtElliptical
00077                 );
00078         ISequencerMesh( ISequencerMesh *_s );
00079         ~ISequencerMesh();
00080 
00081 
00082 public:
00083 
00088         virtual IEquationMeshX * EquationX() { return eqX; }
00089         
00094         virtual IEquationMeshY * EquationY() { return eqY; }
00095         
00097         const IString ID() { return id; }
00098 
00100         virtual void Run();
00101 
00106         virtual void SetTolerance( const double & _d ){ tolerance =_d; }
00107 
00109         virtual void EstimateMesh();
00110 
00115         virtual void SetEstimateMesh( bool _b ){ estimatemesh = _b; }
00116 
00118         virtual IMesh * Mesh(){ return mesh ;}
00119 
00121         virtual void InitVariables();
00122 
00124         virtual void ActualizeVariables();
00125 
00127         virtual ILinearSystem * LSys(){ return eqX->LinearSystem(); }
00128         
00129         /* O Argumento “_v” define o número máximo de iterações do Solver.*/
00130         void SetMaximumIteratorSolver( int _v ){ solver->SetIterMax( _v ); }
00131 
00132         /* O Argumento “_mot” define o método de obtenção da malha.*/
00133         virtual void SetMeshGenerationType( MeshGenerationType _mot ){ mot = _mot; }
00134 
00140         IAction         ActionCalculateX, ActionCalculateY;
00141 
00143         void OutPutMesh( ostream & );
00144 
00146         double MeshError(){ return mesherror; }
00147 
00152         void SetAtraction( const bool _b )
00153                 { isatracted = _b; }
00154 
00156         void SetFixedPoints();
00157                 
00159         void SetYRelaxation( const double & _d ){ alphay = _d; }
00160         
00162         void SetXRelaxation( const double & _d ){ alphax = _d; }
00163 
00164 
00165 
00166 protected:      
00167 
00168         void SetX();
00169         void SetY();
00170 
00171         IEquationMeshX *eqX;
00172         IEquationMeshY *eqY;
00173 
00174         MeshGenerationType mot;
00175 
00176         bool estimatemesh, isatracted;
00177         double tolerance, mesherror;
00178         double alphax, alphay;
00179 
00180         IMesh *mesh, *meshAnt;
00181 
00182         virtual void Begin();
00183     virtual void Solution();
00184         virtual void End(){};
00185         virtual void Find();
00186         
00187         virtual bool SolutionError();
00188 
00189         double VariableError( IMesh *, IMesh * );
00190 };
00191 } // csfl namespace
00192 
00193 #endif // __CSFL_NUM_SEQUENCER_MESH_H__

 

CFD Project | Documents | Downloads | Contact us | Use Terms

 

© SINMEC/EMC/UFSC, 2001.

All rights reserved.

Last Update: Jan. 18, 2002

 Webmaster