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

Go to the documentation of this file.
00001 
00012 #ifndef _POINT_LOAD_BC_BASSO_H_
00013 #define _POINT_LOAD_BC_BASSO_H_
00014 
00015 // std includes
00016 #include <list>
00017 #include <set>
00018 
00019 // Basso includes
00020 #include "basso.h"
00021 #include "NeumannBC.h"
00022 
00023 namespace basso {
00024 
00025 
00033 class PointLoadBC : public NeumannBC {
00034 
00035 public:
00036         
00037         // PUBLIC DEFS
00038         
00039         // CONSTRUCTORS 
00047         PointLoadBC( const set<int> &nids, const Array<Dof> &dofs, const nArray &n, Numeric sf=1.0  ) 
00048                 : NeumannBC( dofs, sf )  
00049         { 
00050                 if ( n.size()!=dofs.size() )
00051                         WarningMessage("PointLoadBC::PointLoadBC","incorrect dimsnsion for load direction vector");
00052                 fNodeIds = &nids; 
00053                 mDirection=n; 
00054         }
00055         
00056         // CONSTRUCTORS 
00062         PointLoadBC( const set<int> &nids, Dof &ldof, Numeric sf  ) 
00063                 : NeumannBC( ldof, sf ), mDirection(1)  
00064         { 
00065                 fNodeIds = &nids; 
00066                 mDirection[0]=1.0; 
00067         }
00068         
00069         virtual ~PointLoadBC() {  }
00070         
00071         // ACCESSORS
00072         
00073         // MEMBER FUNCTIONS
00074         virtual void ContributeForce( const DofMap &dofmap, nArray &f );
00075         
00076 protected:
00077 
00078 protected:
00080         const set<int> *fNodeIds;
00081         
00083         nArray mDirection;
00084         
00085 };
00086 
00087 void PointLoadBC::ContributeForce( const DofMap &dofmap, nArray &f ) 
00088 {
00089         set<int>::const_iterator nItr;
00090         Array<Dof>::const_iterator dofItr;
00091         for ( nItr=fNodeIds->begin(); nItr!=fNodeIds->end(); ++nItr ) 
00092         {
00093                 int i=0;
00094                 for ( dofItr=this->mDofs.begin(); dofItr!=this->mDofs.end(); ++dofItr, ++i )
00095                 {
00096                         int gdof = dofmap.GlobalDof( *nItr, *dofItr );
00097                         f[gdof] += (this->mScaleFactor)*mDirection[i];
00098                 }
00099         }
00100 }
00101 
00102 
00103 } // end namespace
00104 
00105 #endif
00106 
00107 

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