00001 #include "fwellcondition.h"
00002 #include "numericmethods.h"
00003 #include "exception.h"
00004
00005 FWellCondition::FWellCondition(VecWellInfo &wells,double value)
00006 :m_wells(wells)
00007 {
00008 m_values.reinit(m_wells.size());
00009 m_values=value;
00010 }
00011
00012 FWellCondition::FWellCondition(VecWellInfo &wells,const VecDouble& values)
00013 :m_wells(wells),m_values(values)
00014 {
00015
00016 }
00017
00018
00019 bool FWellCondition::isInDomain(const VecDouble &p,unsigned component) const
00020 {
00021 assert(component==0);
00022 for (unsigned i=0;i<m_wells.size();i++)
00023 {
00024 if (m_wells[i].isPointInWell(p))
00025 return true;
00026 }
00027 return false;
00028 }
00029
00030 double FWellCondition::operator() (const VecDouble &p, const unsigned int component) const
00031 {
00032 assert(component==0);
00033 for (unsigned i=0;i<m_wells.size();i++)
00034 {
00035 if (m_wells[i].isPointInWell(p))
00036 return m_values(i);
00037 }
00038 throw new Exception("FWellCondition: Point <%g,%g,%g> is outside the function domain",p(0),p(1),p(2));
00039 }
00040
00041
00042 FWellCondition::~FWellCondition()
00043 {
00044
00045 }
00046
00047
00048
00049