中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

網(wǎng)絡(luò)平臺(tái)怎么弄湖南seo推廣

網(wǎng)絡(luò)平臺(tái)怎么弄,湖南seo推廣,六安seo曝光行者seo,安慶市建設(shè)局網(wǎng)站首頁FastCAE使用gmsh進(jìn)行網(wǎng)格劃分,劃分的時(shí)候直接啟動(dòng)一個(gè)新的gmsh進(jìn)程,個(gè)人猜測(cè)這么設(shè)計(jì)是為了規(guī)避gmsh的GPL協(xié)議風(fēng)險(xiǎn)。 進(jìn)行網(wǎng)格劃分時(shí),其大體運(yùn)行如下圖: 一、Python到gmshModule模塊 GUI操作到Python這步不再分析,比…

FastCAE使用gmsh進(jìn)行網(wǎng)格劃分,劃分的時(shí)候直接啟動(dòng)一個(gè)新的gmsh進(jìn)程,個(gè)人猜測(cè)這么設(shè)計(jì)是為了規(guī)避gmsh的GPL協(xié)議風(fēng)險(xiǎn)。
進(jìn)行網(wǎng)格劃分時(shí),其大體運(yùn)行如下圖:
在這里插入圖片描述

一、Python到gmshModule模塊

GUI操作到Python這步不再分析,比較簡(jiǎn)單。執(zhí)行的Python代碼大概如下:

gmsher = Mesher.Gmsher()
gmsher.setDim(3)
gmsher.selectedAll()
gmsher.setElementType("Tet")
gmsher.setElementOrder(1)
gmsher.setMethod(1)
gmsher.setSizeFactor(1)
gmsher.setMinSize(0)
gmsher.setMaxSize(100)
gmsher.cleanGeo()
gmsher.startGenerationThread()

這些代碼可以在控制臺(tái)找到,如下圖:
在這里插入圖片描述
這樣創(chuàng)建了一個(gè)gmsher對(duì)象,賦予網(wǎng)格劃分的控制參數(shù),最后調(diào)用startGenerationThread()方法,這個(gè)方法的源碼在Mesher.py文件中。對(duì)于三維問題,會(huì)調(diào)用gmshModule模塊的接口GenerateMesh3D()。gmshModule同樣提供了針對(duì)二維、流體網(wǎng)格的劃分接口,代碼在GmshPy.h文件中,如下圖所示。
在這里插入圖片描述

二、啟動(dòng)gmsh線程,寫出gmsh文件,生成網(wǎng)格

在GmshPy::GenerateMesh3D()函數(shù)中,只是準(zhǔn)備網(wǎng)格劃分的參數(shù),最后會(huì)調(diào)用到GmshModule::generateSlot()函數(shù)中。

void GmshModule::generateSlot(GMshPara *para)
{GmshThread *thread = iniGmshThread(para);auto processBar = new ModuleBase::ProcessBar(_mainwindow, tr("Gmsh Working..."));_threadManager->insertThread(processBar, thread); // 運(yùn)行g(shù)msh線程
}// 初始化gmsh線程
GmshThread *GmshModule::iniGmshThread(GMshPara *para)
{if (_threadManager->isRuning()){delete para;ModuleBase::Message m(Common::Message::Error, QString("Gmsh is running !"));emit printMessageToMessageWindow(m);}GmshThread *thread = new GmshThread(_mainwindow, _preWindow, this, para->_dim);thread->setPara(para);delete para;return thread;
}

在GmshModule::generateSlot函數(shù)中,會(huì)初始化一個(gè)線程,并啟動(dòng)運(yùn)行。
再打開GmshThread的run方法,大體流程就是合并幾何對(duì)象,形成一個(gè)TopoDS_Compound對(duì)象,調(diào)用BRepTools::Write寫出geometry.brep文件。寫出gmsh控制文件,最后調(diào)用gmsh命令生成網(wǎng)格文件。

	void GmshThread::run(){this->mergeGeometry(); // 寫出幾何文件this->initGmshEnvoirment(); // 寫出gmsh的控制文件this->generate(); // 執(zhí)行g(shù)msh命令}void GmshThread::mergeGeometry(){QString exelPath = QCoreApplication::applicationDirPath();const QString tempDir = exelPath + "/../temp/";QDir dir(tempDir);if (!dir.exists())dir.mkpath(tempDir);// 清理之前的臨時(shí)文件const QString meshfilename = exelPath + "/../temp/mesh.vtk";if (QFile::exists(meshfilename))QFile::remove(meshfilename);const QString geofilename = exelPath + "/../temp/geometry.brep";if (QFile::exists(geofilename))QFile::remove(geofilename);const QString gmshfilename = exelPath + "/../temp/gmsh.Geo";if (QFile::exists(gmshfilename))QFile::remove(gmshfilename);const QString tempPath = tempDir + QString("geometry.brep");if (_fluidMesh)_fluidMeshProcess->mergeFluidField(_compounnd, _solidHash);else if (_selectall)mergeAllGeo();       // 將需要?jiǎng)澐志W(wǎng)格的組成一個(gè)compounnd對(duì)象else if (_selectvisible)mergeVisibleGeo();elsemergeSelectGeo();QByteArray arr = tempPath.toLatin1();BRepTools::Write(*_compounnd, arr.data()); // 使用BRepTools寫出geometry.brep文件}void GmshThread::initGmshEnvoirment(){QString exelPath = QCoreApplication::applicationDirPath();const QString tempDir = exelPath + "/../temp/";// const QString gmshDir = exelPath + "/gmsh/";QFile::remove(tempDir + "gmsh.Geo");_scriptWriter->setCompound(_compounnd);setGmshScriptData();if (_fluidMesh){QList<int> curve = _fluidMeshProcess->getInerMember(1);QList<int> surface = _fluidMeshProcess->getInerMember(2);_scriptWriter->writeFluidMeshScript(tempDir, _solidHash, curve, surface);}else_scriptWriter->writeGmshScript(tempDir); //  寫出gmsh控制文件}void GmshThread::generate(){QString exelPath = QCoreApplication::applicationDirPath();const QString tempDir = exelPath + "/../temp/";// const QString gmshDir = exelPath + "/gmsh/";QString gmshexe = exelPath + "/gmsh";bool ok = false;
#ifdef Q_OS_WINok = QFile::exists(gmshexe + ".exe");
#endif
#ifdef Q_OS_LINUXok = QFile::exists(gmshexe);
#endifif (!ok){QMessageBox::warning(_mainwindow, QString(tr("Warning")), QString(tr("Gmsh is not exist !")));return;}// 調(diào)用gmsh生成網(wǎng)格QString startProcess = QString("%1 %2 -format vtk -bin -o %3 -%4").arg(gmshexe).arg(tempDir + "gmsh.Geo").arg(tempDir + "mesh.vtk").arg(_dim);if (gmshexe.contains(" "))startProcess = QString("\"%1\"").arg(startProcess);qDebug() << startProcess;_process.start(startProcess);}

最后調(diào)用的gmsh命令大體如下,生成mesh.vtk網(wǎng)格文件。
C:/workspace/FastCAE/build/Debug/gmsh C:/workspace/FastCAE/build/Debug/…/temp/gmsh.Geo -format vtk -bin -o C:/workspace/FastCAE/build/Debug/…/temp/mesh.vtk -3

三、讀取網(wǎng)格文件

讀取網(wǎng)格文件代碼在GmshThread::readMesh函數(shù)中,注意執(zhí)行這段代碼時(shí)gmsh線程已經(jīng)結(jié)束了。

void GmshThread::readMesh()
{MeshData::MeshData *data = MeshData::MeshData::getInstance();QString exelPath = QCoreApplication::applicationDirPath();const QString fileName = exelPath + "/../temp/mesh.vtk";QTextCodec *codec = QTextCodec::codecForName("GB18030");QByteArray ba = codec->fromUnicode(fileName);vtkSmartPointer<vtkDataSetReader> vtkReader = vtkSmartPointer<vtkDataSetReader>::New();vtkReader->SetFileName(ba);vtkReader->Update();vtkDataSet *dataset = vtkReader->GetOutput();if (dataset == nullptr)return;if (!_isSaveToKernal)emit writeToSolveFileSig(dataset);else{auto k = new MeshData::MeshKernal();k->setName(QString("Mesh_%1").arg(k->getID()));k->setMeshData(dataset);data->appendMeshKernal(k);if (!_fluidMesh)setGmshSettingData(k);emit _gmshModule->updateMeshTree();emit _gmshModule->updateSetTree();//			emit _preWindow->updateMeshActorSig();emit _gmshModule->updateActions();emit updateMeshActor();}
}

由于gmsh輸出的是vtk文件,這里直接使用vtkDataSetReader讀取的。

http://www.risenshineclean.com/news/5188.html

相關(guān)文章:

  • wordpress qtan專業(yè)搜索引擎優(yōu)化電話
  • 投票網(wǎng)站制作廣州市疫情最新
  • 哪些網(wǎng)站做外鏈好瀏陽廖主任打人案
  • 網(wǎng)站設(shè)計(jì)導(dǎo)航欄高度中國(guó)萬網(wǎng)域名注冊(cè)
  • 網(wǎng)站建設(shè)_超速云建站重慶seo標(biāo)準(zhǔn)
  • 微號(hào)網(wǎng)站開發(fā)長(zhǎng)沙網(wǎng)站seo哪家公司好
  • 網(wǎng)站上的搜索功能是怎么做的seo技術(shù)快速網(wǎng)站排名
  • 云南網(wǎng)站建設(shè)優(yōu)選平臺(tái)專業(yè)seo整站優(yōu)化
  • 速賣通開店流程及費(fèi)用星巴克seo網(wǎng)絡(luò)推廣
  • 視頻網(wǎng)站會(huì)員系統(tǒng)怎么做seo交互論壇
  • 網(wǎng)站防護(hù)找誰做seo實(shí)戰(zhàn)密碼在線閱讀
  • 商城網(wǎng)站建設(shè)哪家好站長(zhǎng)平臺(tái)官網(wǎng)
  • 網(wǎng)站如何做rss訂閱長(zhǎng)沙做網(wǎng)站的公司有哪些
  • 怎么做網(wǎng)頁鏈接教程網(wǎng)站首頁關(guān)鍵詞如何優(yōu)化
  • 網(wǎng)架加工安裝一體的公司外鏈seo
  • 校園網(wǎng)站建設(shè)背景國(guó)內(nèi)做網(wǎng)站比較好的公司
  • wordpress點(diǎn)贊 1岳陽seo快速排名
  • 石家莊商城網(wǎng)站搭建多少錢西安百度推廣運(yùn)營(yíng)
  • 百度做的網(wǎng)站seo實(shí)戰(zhàn)
  • 綜合商城網(wǎng)站程序營(yíng)銷策劃書范文案例
  • 襄陽營(yíng)銷型網(wǎng)站寶雞seo培訓(xùn)
  • 江西網(wǎng)站制作企業(yè)qq一年多少費(fèi)用
  • 哪個(gè)網(wǎng)站可以做旅行攻略seo推廣排名公司
  • 網(wǎng)站建設(shè)思路品牌推廣專員
  • 蕪湖哪家公司做網(wǎng)站不錯(cuò)什么叫seo網(wǎng)絡(luò)推廣
  • 互聯(lián)網(wǎng)app網(wǎng)站建設(shè)方案模板百度seo關(guān)鍵詞優(yōu)化公司
  • 攜程特牌 的同時(shí)做別的網(wǎng)站蘭州做網(wǎng)站的公司
  • 上海網(wǎng)站建設(shè)備案號(hào)鄭州seo代理外包公司
  • 富錦建設(shè)局網(wǎng)站現(xiàn)在網(wǎng)絡(luò)推廣方式
  • 自己搭建服務(wù)器 發(fā)布網(wǎng)站 域名如何申請(qǐng)秦皇島seo招聘