00001 #include "monitorwells.h" 00002 #include <ostream> 00003 #include "arrayofvecdouble.h" 00004 #include "dynamicbase.h" 00005 #include "transportbase.h" 00006 00007 MonitorWells::~MonitorWells() 00008 { 00009 _out.close(); 00010 } 00011 00012 MonitorWells::MonitorWells() 00013 { 00014 00015 } 00016 00017 void MonitorWells::printSelf(std::ostream &out) 00018 { 00019 for (unsigned i=0;i<_wells.size();i++) 00020 { 00021 out << "Point: " << _wells[i].P[0] << " " << _wells[i].P[1] << " " << _wells[i].P[2] << "Index: " << _wells[i].cell_index << std::endl; 00022 00023 00024 } 00025 } 00026 00027 void MonitorWells::openFileName(std::string fileName) 00028 { 00029 _out.close(); 00030 _out.open(fileName.c_str()); 00031 00032 } 00033 00034 00035 void MonitorWells::outputData(double time,DynamicBase &dyn,TransportBase &trans) 00036 { 00037 assert(_out.good()); 00038 const VecDouble &vP = dyn.getPressureAtCells(); 00039 ArrayOfVecDouble &vT = trans.getSolutionAtCells(); 00040 00041 _out << time << "\t"; 00042 for (unsigned i=0;i<_wells.size();i++) 00043 { 00044 unsigned index = _wells[i].cell_index; 00045 _out << vP(index) << "\t" << vT(index,0) << std::endl; 00046 } 00047 } 00048 00049