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

simplec.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_SIMPLEC_H__
00030 #define __CSFL_NUM_SEQUENCER_SIMPLEC_H__
00031 
00032 // Include =====================================================================
00033 #include <csfl/num/sequencer/pv.h>
00034 
00035 
00036 // Namespace
00037 namespace csfl {
00038 
00039 //==============================================================================
00040 //              Class ISequencerSimplec
00041 //              Description: Base Class for the SIMPLEC Method
00042 //==============================================================================
00043 
00044 class ISequencerSimplec : 
00045         public ISequencerPV
00046 
00052 
00053 {
00054 
00055 public:
00056         
00064         ISequencerSimplec(
00065         const IString &_id ,
00066                 IContainerEquation *_contEquation,
00067                 ISolver *_solver,
00068                 double _starttime = 0.0, 
00069                 double _finaltime = 1.0, 
00070                 double _steptime = 0.5 );       
00071         ISequencerSimplec( ISequencerSimplec *_s );
00072         ~ISequencerSimplec();
00073 
00075         virtual void Read ( istream &_is );
00076 
00078         virtual void Write( ostream &_os );
00079         
00080 protected:
00081         inline void SetDbCoeficients();
00082 
00083 };
00084 
00085 // =============================================================================
00086 // Inline functions
00087 // =============================================================================
00088 
00089 inline void ISequencerSimplec::SetDbCoeficients()
00090 {
00091     double dbup, dbvp;
00092     int x, y, i, j;
00093             
00094     for( i=0; i<nx; i++ )
00095         for( j=0; j<ny; j++ ) {
00096                     
00097         x = y = (i+1) + (ni*(j+1));                       
00098                     
00099         dbup = 1.0 / ( eqU->LinearSystem()->MatrixA( x, y ) +             // Ap
00100                        eqU->LinearSystem()->MatrixA( x+ni, y ) +          // An
00101                        eqU->LinearSystem()->MatrixA( x-ni, y ) +          // As
00102                        eqU->LinearSystem()->MatrixA( x+1, y ) +           // Ae
00103                        eqU->LinearSystem()->MatrixA( x-1, y ) );          // Aw
00104                     
00105         dbvp = 1.0 / ( eqV->LinearSystem()->MatrixA( x, y ) + 
00106                        eqV->LinearSystem()->MatrixA( x+ni, y ) +
00107                        eqV->LinearSystem()->MatrixA( x-ni, y ) +
00108                        eqV->LinearSystem()->MatrixA( x+1, y ) +
00109                        eqV->LinearSystem()->MatrixA( x-1, y ) );
00110                     
00111         dbu->SetValue( i, j, dbup );
00112         dbv->SetValue( i, j, dbvp );
00113 
00114         }
00115         
00116 }
00117 } // csfl namespace
00118 
00119 #endif // __CSFL_NUM_SEQUENCER_SIMPLEC_H__

 

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

 

© SINMEC/EMC/UFSC, 2001.

All rights reserved.

Last Update: Jan. 18, 2002

 Webmaster