1、增加生成井信息文件的代码;

feature/ribbon-menu-20240927
simonyan 4 days ago
parent 1d095fd589
commit 5ceefee4a8

@ -35,6 +35,9 @@ private:
// 生成网格文件
void genGrid(bool is3D = true);
// 生成井文件
void genWellFile(QVector<QVector<double >> vWellsInfo);
private:
nmDataDemo* m_pAnalyzeData;
};

@ -276,6 +276,4 @@ ZxDataWell *nmObjPointWell::getWellData() const
const QString &nmObjPointWell::getWellID() const
{
return m_sWellID;
}
}

@ -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<QPointF> outlinePoints, QVector<QVector<double
QVector<double> 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<QVector<double >> 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<double> wellInfo = vWellsInfo[i];
out<< wellInfo[0]<<" "<< wellInfo[1]<<" "<< wellInfo[2]<<" "<<gridNum<<"\n";
}
file.close();
}
Loading…
Cancel
Save