diff --git a/Include/nmNum/nmSubWnd/nmSubWndGrid.h b/Include/nmNum/nmSubWnd/nmSubWndGrid.h index 31ce6fe..e1e97c3 100644 --- a/Include/nmNum/nmSubWnd/nmSubWndGrid.h +++ b/Include/nmNum/nmSubWnd/nmSubWndGrid.h @@ -35,6 +35,9 @@ private: // 生成网格文件 void genGrid(bool is3D = true); + // 生成井文件 + void genWellFile(QVector> vWellsInfo); + private: nmDataDemo* m_pAnalyzeData; }; diff --git a/Src/nmNum/nmPlot/nmObjPointWell.cpp b/Src/nmNum/nmPlot/nmObjPointWell.cpp index 59b443c..7a7564b 100644 --- a/Src/nmNum/nmPlot/nmObjPointWell.cpp +++ b/Src/nmNum/nmPlot/nmObjPointWell.cpp @@ -276,6 +276,4 @@ ZxDataWell *nmObjPointWell::getWellData() const const QString &nmObjPointWell::getWellID() const { return m_sWellID; -} - - +} \ No newline at end of file diff --git a/Src/nmNum/nmSubWnd/nmSubWndGrid.cpp b/Src/nmNum/nmSubWnd/nmSubWndGrid.cpp index 55c13b9..90d3ecb 100644 --- a/Src/nmNum/nmSubWnd/nmSubWndGrid.cpp +++ b/Src/nmNum/nmSubWnd/nmSubWndGrid.cpp @@ -118,6 +118,8 @@ QWidget* nmSubWndGrid::initUiMainWx() this->genGrid(); // 调用gmsh生成2维vtk网格文件 this->genGrid(false); + // 生成井信息的文件 + this->genWellFile(wellList); // 渲染 QString sDir = ZxBaseUtil::getDirOf(s_Dir_Temp, "Nm/PreProcessing"); QString sFile = sDir + "oil.vtk"; @@ -143,12 +145,12 @@ void nmSubWndGrid::genGeo(QVector outlinePoints, QVector vWellInfo = vWellsInfo[i]; QPointF center(vWellInfo[0], vWellInfo[1]); double radius = vWellInfo[2]; - int wellGridNum = 10; + int wellGridNum = 13; circles.append(CircleWell(center, radius, wellGridNum)); } // 面网格设置 - double gridSize = 0.1; + double gridSize = 0.5; nmDataGeo geo(outlinePoints, circles, gridSize); QString sDir = ZxBaseUtil::getDirOf(s_Dir_Temp, "Nm/PreProcessing"); QString sFile = sDir + "oil.geo"; @@ -199,3 +201,27 @@ void nmSubWndGrid::setAnalyzeData(nmDataDemo *newAnalyzeData) { m_pAnalyzeData = newAnalyzeData; } + +void nmSubWndGrid::genWellFile(QVector> vWellsInfo) +{ + // 面网格设置 + double gridNum = 12; + QString sDir = ZxBaseUtil::getDirOf(s_Dir_Temp, "Nm/PreProcessing"); + QString sFile = sDir + "oil-2d-wells.txt"; + + QFile file(sFile); + + //检查 + if(!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + qWarning("Cannot open file for writing: %s", qPrintable(file.errorString())); + return; + } + + QTextStream out(&file); + out << vWellsInfo.size()<< "\n"; + for (int i=0;i < vWellsInfo.size();i++) { + QVector wellInfo = vWellsInfo[i]; + out<< wellInfo[0]<<" "<< wellInfo[1]<<" "<< wellInfo[2]<<" "<