/Users/jack/Code/basso_dev/inc/DiffusionFormulation.h

Go to the documentation of this file.
00001 
00012 #ifndef _DIFFUSION_FORUMULATION_BASSO_H_
00013 #define _DIFFUSION_FORUMULATION_BASSO_H_
00014 
00015 // std includes
00016 #include <list>
00017 
00018 // Basso includes
00019 #include "basso.h"
00020 #include "Formulation.h"
00021 
00022 namespace basso {
00023 
00024 
00032 class DiffusionFormulation : public Formulation {
00033 
00034 public:
00035         
00036         // PUBLIC DEFS
00037         
00038         // CONSTRUCTORS 
00040         DiffusionFormulation( list< Element > &elem, const Array< Node > &nodes, const Material *material ) 
00041                 : Formulation( elem, nodes ) { fMat=material; Initialize(); }
00042         
00043         virtual ~DiffusionFormulation() {  }
00044         
00045         // ACCESSORS
00047         virtual int NumLocalDofs() const { return 1; }
00048         
00049 protected:
00051         virtual void GetElementStiffnessMatrix( nMatrix &ke, list<Element>::const_iterator eItr  );
00052         
00054         virtual void Initialize(  );
00055         
00062         virtual bool SetElementParameters( list<Element>::const_iterator eItr, int qorder=2 );
00063 
00065         virtual Numeric MassFactor() const { return fMat->Density(); }
00066         
00068         virtual Numeric StiffnessFactor() const { return fMat->Diffusivity(); }
00069         
00070 protected:
00071         
00072         const Material *fMat;  
00074 };
00075 
00076 void DiffusionFormulation::ActivateDofs( DofMap &dofmap )  
00077 {
00078         fDofMap=&dofmap;
00079         list< Element >::const_iterator eItr;
00080         Element::const_iterator nItr;
00081         for ( eItr=this->fElement->begin(); eItr!=this->fElement->end(); ++eItr ) 
00082                 for ( nItr=eItr->begin(); nItr!=eItr->end(); ++nItr ) 
00083                         for ( int s=0; s<NumLocalDofs(); ++s )
00084                                 fDofMap->AddNodalDof( *nItr, this->activeLocalDofs[s] );
00085         fDofMap->RenumberGlobalDofs();          
00086 }
00087 
00088 
00089 
00090 void DiffusionFormulation::Initialize(  ) 
00091 { 
00092         resize( activeLocalDofs, NumLocalDofs() );
00093         activeLocalDofs[0]=kCONCENTRATION; 
00094 }
00095 
00096 
00097 } // end namespace
00098 
00099 #endif
00100 
00101 

Generated on Sat Jan 19 09:03:57 2008 for Basso by  doxygen 1.5.2