00001 #include "fwellssource.h"
00002
00003
00004 FWellsSource::FWellsSource(VecWellInfo wells)
00005 :_wells(wells)
00006 {
00007 _v.reinit(wells.size());
00008 unsigned i=0;
00009 for (VecWellInfo::iterator it=wells.begin();it!=wells.end();it++)
00010 {
00011 _v(i++)=it->getSourceInjRate()/it->volume();
00012 }
00013 }
00014
00015
00016
00017 double FWellsSource::operator() (const VecDouble &p, const unsigned int component) const
00018 {
00019 assert(component==0);
00020 for (unsigned i=0;i<_wells.size();i++)
00021 {
00022 if (_wells[i].isPointInWell(p))
00023 return _v(i);
00024 }
00025 return 0.0;
00026 }