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

field.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_FIELD_CORE_FIELD_H__
00030 #define __CSFL_FIELD_CORE_FIELD_H__
00031 
00032 
00033 // Include
00034 #include <csfl/sys/core/sflobject.h>
00035 #include <csfl/geom/grid/grid.h>
00036 
00037 
00038 // Namespace
00039 namespace csfl {
00040 
00041 //==============================================================================
00042 //              Class IField
00043 //              Description: Represents a physical discretized field of any     property
00044 //==============================================================================
00045 
00046 class IField : 
00047         virtual public ISFLObject
00048 
00052 
00053 {
00054 
00055 public:
00060         IField( const IString &_name = IString::empty, IGrid *_grid = NULL );
00065         IField( const IString &_name, const ISize &_size );
00070         IField( const IString &_name, int _row, int _col );
00071         
00073         IField( IField *_field );
00074 
00075         ~IField();
00076 
00078         inline const IField & operator = ( const IField &_field );
00079         
00081         inline virtual double Value( const IPoint &_p = IPoint::zero ) const;
00082         inline virtual double Value( int _x = 0, int _y = 0 ) const;
00083 
00084 
00086         IString ID() { return name; }
00087         
00089         void SetID( const IString & _id )
00090                 { name = _id; }
00091         
00093     IString Name() { return name; }
00094 
00096         void SetName( const IString & _s ) { name = _s; }
00097 
00099         ISize Size() { return fsize; }
00100 
00101 public:
00102         
00103         virtual void Read( ifstream & ) {}
00104         virtual void Read( ifstream &, ifstream & ) {}
00105  
00106     virtual void Write( ofstream & ) {}
00107     virtual void Write( ofstream &, ofstream & ) {}
00108 
00109 protected:
00110         IString name;
00111         ISize fsize;
00112 
00113 };
00114 
00115 
00116 // =============================================================================
00117 // Inline functions
00118 // =============================================================================
00119 
00120 inline const IField & IField::operator = ( const IField &_field )
00121 {
00122         name = _field.name;
00123         fsize = _field.fsize;
00124 
00125         return *this;
00126 }
00127 
00128 inline double IField::Value( const IPoint &_p ) const
00129 {
00130         return 1.0;
00131 }
00132 
00133 inline double IField::Value( int _x, int _y ) const
00134 {
00135         return 1.0;
00136 }
00137 } // csfl namespace
00138 
00139 #endif// __CSFL_FIELD_CORE_FIELD_H__

 

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

 

© SINMEC/EMC/UFSC, 2001.

All rights reserved.

Last Update: Jan. 18, 2002

 Webmaster