00001
00012 #ifndef _POINT_LOAD_BC_BASSO_H_
00013 #define _POINT_LOAD_BC_BASSO_H_
00014
00015
00016 #include <list>
00017 #include <set>
00018
00019
00020 #include "basso.h"
00021 #include "NeumannBC.h"
00022
00023 namespace basso {
00024
00025
00033 class PointLoadBC : public NeumannBC {
00034
00035 public:
00036
00037
00038
00039
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
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
00072
00073
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 }
00104
00105 #endif
00106
00107