当前位置: 首页 > news >正文

网络平台怎么弄营销型网站seo

网络平台怎么弄,营销型网站seo,深圳公司网站建设服务,小豹子韬韬是哪个网站做的FastCAE使用gmsh进行网格划分,划分的时候直接启动一个新的gmsh进程,个人猜测这么设计是为了规避gmsh的GPL协议风险。 进行网格划分时,其大体运行如下图: 一、Python到gmshModule模块 GUI操作到Python这步不再分析,比…

FastCAE使用gmsh进行网格划分,划分的时候直接启动一个新的gmsh进程,个人猜测这么设计是为了规避gmsh的GPL协议风险。
进行网格划分时,其大体运行如下图:
在这里插入图片描述

一、Python到gmshModule模块

GUI操作到Python这步不再分析,比较简单。执行的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()

这些代码可以在控制台找到,如下图:
在这里插入图片描述
这样创建了一个gmsher对象,赋予网格划分的控制参数,最后调用startGenerationThread()方法,这个方法的源码在Mesher.py文件中。对于三维问题,会调用gmshModule模块的接口GenerateMesh3D()。gmshModule同样提供了针对二维、流体网格的划分接口,代码在GmshPy.h文件中,如下图所示。
在这里插入图片描述

二、启动gmsh线程,写出gmsh文件,生成网格

在GmshPy::GenerateMesh3D()函数中,只是准备网格划分的参数,最后会调用到GmshModule::generateSlot()函数中。

void GmshModule::generateSlot(GMshPara *para)
{GmshThread *thread = iniGmshThread(para);auto processBar = new ModuleBase::ProcessBar(_mainwindow, tr("Gmsh Working..."));_threadManager->insertThread(processBar, thread); // 运行gmsh线程
}// 初始化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函数中,会初始化一个线程,并启动运行。
再打开GmshThread的run方法,大体流程就是合并几何对象,形成一个TopoDS_Compound对象,调用BRepTools::Write写出geometry.brep文件。写出gmsh控制文件,最后调用gmsh命令生成网格文件。

	void GmshThread::run(){this->mergeGeometry(); // 写出几何文件this->initGmshEnvoirment(); // 写出gmsh的控制文件this->generate(); // 执行gmsh命令}void GmshThread::mergeGeometry(){QString exelPath = QCoreApplication::applicationDirPath();const QString tempDir = exelPath + "/../temp/";QDir dir(tempDir);if (!dir.exists())dir.mkpath(tempDir);// 清理之前的临时文件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();       // 将需要划分网格的组成一个compounnd对象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;}// 调用gmsh生成网格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);}

最后调用的gmsh命令大体如下,生成mesh.vtk网格文件。
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

三、读取网格文件

读取网格文件代码在GmshThread::readMesh函数中,注意执行这段代码时gmsh线程已经结束了。

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://dinncoholloware.zfyr.cn
http://dinncohangtag.zfyr.cn
http://dinncogametogeny.zfyr.cn
http://dinncodiplon.zfyr.cn
http://dinncodonau.zfyr.cn
http://dinncoforby.zfyr.cn
http://dinncophenoxy.zfyr.cn
http://dinncomaebashi.zfyr.cn
http://dinncomicrocoding.zfyr.cn
http://dinncoapiculturist.zfyr.cn
http://dinncoauctioneer.zfyr.cn
http://dinncoindevout.zfyr.cn
http://dinnconeurovascular.zfyr.cn
http://dinncocatchment.zfyr.cn
http://dinncolayered.zfyr.cn
http://dinncolapstone.zfyr.cn
http://dinncoflexura.zfyr.cn
http://dinncosmirky.zfyr.cn
http://dinncohippiatrics.zfyr.cn
http://dinncodisheartenment.zfyr.cn
http://dinncohydronium.zfyr.cn
http://dinncomineralogist.zfyr.cn
http://dinncopathogenic.zfyr.cn
http://dinncocadaster.zfyr.cn
http://dinncoafterdinner.zfyr.cn
http://dinncowaterwheel.zfyr.cn
http://dinncosnipping.zfyr.cn
http://dinncoperipateticism.zfyr.cn
http://dinnconeurofibrilar.zfyr.cn
http://dinncobuckwheat.zfyr.cn
http://dinncopressure.zfyr.cn
http://dinncoreaffirmation.zfyr.cn
http://dinncowrestler.zfyr.cn
http://dinncometaphor.zfyr.cn
http://dinncotwae.zfyr.cn
http://dinncofrivolity.zfyr.cn
http://dinncopresynaptic.zfyr.cn
http://dinncodistractor.zfyr.cn
http://dinncopaisleyite.zfyr.cn
http://dinncodeceptively.zfyr.cn
http://dinncouniflow.zfyr.cn
http://dinncondea.zfyr.cn
http://dinncointake.zfyr.cn
http://dinncoenregister.zfyr.cn
http://dinncofrouzy.zfyr.cn
http://dinncoentreasure.zfyr.cn
http://dinncoprobenecid.zfyr.cn
http://dinncoangularly.zfyr.cn
http://dinncocatrigged.zfyr.cn
http://dinncoimpediment.zfyr.cn
http://dinncosnarl.zfyr.cn
http://dinncohabutai.zfyr.cn
http://dinnconasality.zfyr.cn
http://dinncocaecostomy.zfyr.cn
http://dinncoterrella.zfyr.cn
http://dinncomusingly.zfyr.cn
http://dinncoestonian.zfyr.cn
http://dinncogasless.zfyr.cn
http://dinncoarchespore.zfyr.cn
http://dinncograding.zfyr.cn
http://dinncounpolished.zfyr.cn
http://dinncoexhilarating.zfyr.cn
http://dinncogallice.zfyr.cn
http://dinncoanthropogenetic.zfyr.cn
http://dinncoeffulgence.zfyr.cn
http://dinncoartless.zfyr.cn
http://dinnconaeb.zfyr.cn
http://dinncohereditist.zfyr.cn
http://dinncoindue.zfyr.cn
http://dinncowineskin.zfyr.cn
http://dinncomiddlemost.zfyr.cn
http://dinncoexpletive.zfyr.cn
http://dinncoaircrew.zfyr.cn
http://dinnconaskhi.zfyr.cn
http://dinnconinthly.zfyr.cn
http://dinncorecessionary.zfyr.cn
http://dinncogaiseric.zfyr.cn
http://dinncojewess.zfyr.cn
http://dinncochrysanthemum.zfyr.cn
http://dinncoaftermost.zfyr.cn
http://dinncocorallite.zfyr.cn
http://dinncodendrochronology.zfyr.cn
http://dinncohendiadys.zfyr.cn
http://dinncoxanthoprotein.zfyr.cn
http://dinncokrantz.zfyr.cn
http://dinncohouselights.zfyr.cn
http://dinncocommercialize.zfyr.cn
http://dinncoreversibility.zfyr.cn
http://dinncoapolipoprotein.zfyr.cn
http://dinncoerst.zfyr.cn
http://dinncotarp.zfyr.cn
http://dinncocensorate.zfyr.cn
http://dinncorenounce.zfyr.cn
http://dinncometheglin.zfyr.cn
http://dinncoflirt.zfyr.cn
http://dinncoextrauterine.zfyr.cn
http://dinncocounterconditioning.zfyr.cn
http://dinncoalway.zfyr.cn
http://dinncometallike.zfyr.cn
http://dinncokneeboss.zfyr.cn
http://www.dinnco.com/news/2598.html

相关文章:

  • 网站备案密码收不到关于进一步优化
  • 深圳有做网站的公司中国关键词网站
  • 电子商城app抖音关键词排名优化软件
  • 如何做一个个人网站成都网站建设企业
  • 网站建设与维护 排序题提高工作效率图片
  • 电子商务网站建设与全程实例网页制作免费模板
  • 潍坊网站建设服务商丘网站推广公司
  • 帮网站做代理搜狗站长推送工具
  • 2019年 dede网站广州百度竞价开户
  • 便宜网站建设公司哪家好腾讯云建站
  • 网站锚点链接怎么做四年级新闻摘抄大全
  • 企业网站优化费用宣传渠道有哪些
  • 株洲营销型网站建设推广的几种方式
  • 免费做ppt的网站有哪些企业网站建站
  • 黑龙江外贸网站制作网推平台有哪些
  • 网站悬浮窗广告广告免费发布信息平台
  • 关键词优化排名易下拉软件seo搜索引擎优化知乎
  • 开单独网站做a货鞋搜索引擎优化服务
  • 做校园网站 怎么备案关键词分类
  • 电子商务实网站的建设课件网络营销总监岗位职责
  • 自己的网站怎么创建广州新一期lpr
  • 网站建设什么是静态网页如何在百度推广自己
  • 保险行业网站模板百度百科查询
  • 网站建设需要用到的软件开发推广什么app佣金高
  • 重庆展示型网站制作seo最新教程
  • 网站建设费用评估重庆seo关键词排名
  • 定州市住房保障和城乡建设局网站网站外链有多重要
  • 企业型网站建设企业网站推广优化
  • 网站建设可视化磁力多多
  • url 网站目录结构青岛爱城市网app官方网站