|
|
@ -118,6 +118,8 @@ QWidget* nmSubWndGrid::initUiMainWx()
|
|
|
|
this->genGrid();
|
|
|
|
this->genGrid();
|
|
|
|
// 调用gmsh生成2维vtk网格文件
|
|
|
|
// 调用gmsh生成2维vtk网格文件
|
|
|
|
this->genGrid(false);
|
|
|
|
this->genGrid(false);
|
|
|
|
|
|
|
|
// 生成井信息的文件
|
|
|
|
|
|
|
|
this->genWellFile(wellList);
|
|
|
|
// 渲染
|
|
|
|
// 渲染
|
|
|
|
QString sDir = ZxBaseUtil::getDirOf(s_Dir_Temp, "Nm/PreProcessing");
|
|
|
|
QString sDir = ZxBaseUtil::getDirOf(s_Dir_Temp, "Nm/PreProcessing");
|
|
|
|
QString sFile = sDir + "oil.vtk";
|
|
|
|
QString sFile = sDir + "oil.vtk";
|
|
|
@ -143,12 +145,12 @@ void nmSubWndGrid::genGeo(QVector<QPointF> outlinePoints, QVector<QVector<double
|
|
|
|
QVector<double> vWellInfo = vWellsInfo[i];
|
|
|
|
QVector<double> vWellInfo = vWellsInfo[i];
|
|
|
|
QPointF center(vWellInfo[0], vWellInfo[1]);
|
|
|
|
QPointF center(vWellInfo[0], vWellInfo[1]);
|
|
|
|
double radius = vWellInfo[2];
|
|
|
|
double radius = vWellInfo[2];
|
|
|
|
int wellGridNum = 10;
|
|
|
|
int wellGridNum = 13;
|
|
|
|
circles.append(CircleWell(center, radius, wellGridNum));
|
|
|
|
circles.append(CircleWell(center, radius, wellGridNum));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 面网格设置
|
|
|
|
// 面网格设置
|
|
|
|
double gridSize = 0.1;
|
|
|
|
double gridSize = 0.5;
|
|
|
|
nmDataGeo geo(outlinePoints, circles, gridSize);
|
|
|
|
nmDataGeo geo(outlinePoints, circles, gridSize);
|
|
|
|
QString sDir = ZxBaseUtil::getDirOf(s_Dir_Temp, "Nm/PreProcessing");
|
|
|
|
QString sDir = ZxBaseUtil::getDirOf(s_Dir_Temp, "Nm/PreProcessing");
|
|
|
|
QString sFile = sDir + "oil.geo";
|
|
|
|
QString sFile = sDir + "oil.geo";
|
|
|
@ -199,3 +201,27 @@ void nmSubWndGrid::setAnalyzeData(nmDataDemo *newAnalyzeData)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_pAnalyzeData = 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();
|
|
|
|
|
|
|
|
}
|