From: Nabil Ghodbane Date: Sat, 12 Feb 2022 13:20:21 +0000 (+0100) Subject: spns #19079: top-ii-vol integration in SMESH X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d83b63b2c3a2defe15dec30687b0cc92476497e1;p=modules%2Fsmesh.git spns #19079: top-ii-vol integration in SMESH --- diff --git a/doc/salome/gui/SMESH/input/tools.rst b/doc/salome/gui/SMESH/input/tools.rst index f9b53c046..0812a8e92 100644 --- a/doc/salome/gui/SMESH/input/tools.rst +++ b/doc/salome/gui/SMESH/input/tools.rst @@ -9,6 +9,7 @@ The following plugins are accessible via **Mesh > SMESH plugins** menu: * `SpherePadder plugin `_ * `MGSurfOpt plugin `_ * `MGCleaner plugin `_ +* `topIIVolMesh plugin `_ * `Z-cracks plugin `_ * `MacMesh plugin `_ * `blocFissure plugin `_ diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt index 2c8c20781..ca7f5a1ff 100644 --- a/src/Tools/CMakeLists.txt +++ b/src/Tools/CMakeLists.txt @@ -26,6 +26,7 @@ ADD_SUBDIRECTORY(MacMesh) IF(SALOME_BUILD_GUI) ADD_SUBDIRECTORY(MGCleanerPlug) ADD_SUBDIRECTORY(YamsPlug) + ADD_SUBDIRECTORY(TopIIVolMeshPlug) # ADD_SUBDIRECTORY(ZCracksPlug) ENDIF(SALOME_BUILD_GUI) diff --git a/src/Tools/TopIIVolMeshPlug/CMakeLists.txt b/src/Tools/TopIIVolMeshPlug/CMakeLists.txt new file mode 100644 index 000000000..7edc1b5ad --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/CMakeLists.txt @@ -0,0 +1,60 @@ +# Copyright (C) 2013-2021 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +IF(SALOME_BUILD_DOC) + ADD_SUBDIRECTORY(doc) +ENDIF(SALOME_BUILD_DOC) + +IF(SALOME_BUILD_GUI) + INCLUDE(UsePyQt) +ENDIF(SALOME_BUILD_GUI) + +# --- scripts --- + +# scripts / static +SET(_plugin_SCRIPTS + TopIIVolMeshPluginDialog.py + TopIIVolMeshPlugin.py + TopIIVolMeshPlugin_plugin.py + TopIIVolMeshMonitor.py + README +) + +IF(SALOME_BUILD_GUI) + # uic files / to be processed by pyuic + SET(_pyuic_FILES + TopIIVolMeshPluginDialog.ui + TopIIVolMeshMonitor.ui + ) + # scripts / pyuic wrappings + PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) +ENDIF(SALOME_BUILD_GUI) + +# --- rules --- + +SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) +MESSAGE(VERBOSE "iNSTALLATION FOLDER ${SALOME_SMESH_INSTALL_PLUGINS}") +IF(SALOME_BUILD_GUI) + SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS} TARGET_NAME _target_name_pyuic_py) + # add dependency of compiled py files on uic files in order + # to avoid races problems when compiling in parallel + ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) + # Install the CMake configuration files: + INSTALL(FILES "${PROJECT_SOURCE_DIR}/README" DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}") +ENDIF(SALOME_BUILD_GUI) diff --git a/src/Tools/TopIIVolMeshPlug/README b/src/Tools/TopIIVolMeshPlug/README new file mode 100644 index 000000000..fbcad999b --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/README @@ -0,0 +1,37 @@ +****************************** +About SALOME TopIIVolMesh plug-in +****************************** + +SALOME TopIIVolMesh plug-in implements an interface to the topIIvol meshing tool. + +SALOME TopIIVolMesh plug-in is integrated into SALOME platform via the SALOME Mesh +module. + +For more information please visit the SALOME platform web site: + + + +======= +License +======= + +SALOME platform is distributed under the GNU Lesser General Public License. +See COPYING file for more details. + +Also, additional information can be found at SALOME platform web site: + + + +============ +Installation +============ + +============= +Documentation +============= + +=============== +Troubleshooting +=============== + +Please, send a mail to webmaster.salome@opencascade.com. diff --git a/src/Tools/TopIIVolMeshPlug/TopIIVolMeshMonitor.py b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshMonitor.py new file mode 100644 index 000000000..119aba9b0 --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshMonitor.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2020 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import os +import sys +import string +import types +import tempfile +import traceback +import pprint as PP #pretty print + +from qtsalome import * + +# Import des panels + +from TopIIVolMeshMonitor_ui import Ui_qdLogger + +verbose = True + +class TopIIVolMeshMonitor(Ui_qdLogger, QDialog): + def __init__(self, parent, txt): + QDialog.__init__(self,parent) + self.setupUi(self) + self.resize( QSize(1000,600).expandedTo(self.minimumSizeHint()) ) + self.qpbOK.clicked.connect( self.OnQpbOKClicked ) + # Button OK is disabled until computation is finished + self.qpbOK.setEnabled(False) + self.qpbSave.clicked.connect( self.OnQpbSaveClicked ) + self.qpbSave.setToolTip("Save trace in log file") + self.qpbOK.setToolTip("Close view") + self.myExecutable=QProcess(self) + self.myExecutable.readyReadStandardOutput.connect( self.readFromStdOut ) + self.myExecutable.readyReadStandardError.connect( self.readFromStdErr ) + self.myExecutable.finished.connect( self.computationFinished ) + self.myExecutable.errorOccurred.connect( self.computationOnError ) + if os.path.exists(self.parent().outputMesh): + os.remove(self.parent().outputMesh) + self.myExecutable.start(txt) + self.myExecutable.closeWriteChannel() + self.show() + + def OnQpbOKClicked(self): + self.close() + + def OnQpbSaveClicked(self): + outputDirectory=os.path.expanduser("~") + fn, mask = QFileDialog.getSaveFileName(None,"Save File",outputDirectory) + if not fn: + return + ulfile = os.path.abspath(str(fn)) + try: + f = open(fn, 'wb') + f.write(self.qtbLogWindow.toPlainText().encode("utf-8")) + f.close() + except IOError as why: + QMessageBox.critical(self, 'Save File', + 'The file %s could not be saved.
Reason: %s'%(str(fn), str(why))) + + def readFromStdErr(self): + a=self.myExecutable.readAllStandardError() + aa=a.data().decode(errors='ignore') + self.qtbLogWindow.append(aa) + + def readFromStdOut(self) : + a=self.myExecutable.readAllStandardOutput() + aa=a.data().decode(errors='ignore') + self.qtbLogWindow.append(aa) + + def computationFinished(self): + self.qpbOK.setEnabled(True) + if self.myExecutable.exitCode() == 0: + self.parent().saveOutputMesh() + else: + QMessageBox.critical(self, 'Computation failed', + 'The computation has failed.
Please, check the log message.') + + def computationOnError(self): + self.qpbOK.setEnabled(True) + QMessageBox.critical(self, 'Computation failed', + 'The computation has failed.
Please, check the log message.') diff --git a/src/Tools/TopIIVolMeshPlug/TopIIVolMeshMonitor.ui b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshMonitor.ui new file mode 100644 index 000000000..5bded345b --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshMonitor.ui @@ -0,0 +1,38 @@ + + + qdLogger + + + + 0 + 0 + 469 + 489 + + + + Run TopIIVolMesh + + + + + + Save log + + + + + + + + + + Ok + + + + + + + + diff --git a/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPlugin.py b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPlugin.py new file mode 100644 index 000000000..e53b61699 --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPlugin.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2020 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# if you already have plugins defined in a salome_plugins.py file, add this file at the end. +# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py + +def TopIIVolMeshLct(context): + # get context study, salomeGui + study = context.study + sg = context.sg + + import os + import subprocess + import tempfile + from qtsalome import QFileDialog, QMessageBox + + import TopIIVolMeshPluginDialog + window = TopIIVolMeshPluginDialog.getInstance() + window.show() diff --git a/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPluginDialog.py b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPluginDialog.py new file mode 100644 index 000000000..91988c1ee --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPluginDialog.py @@ -0,0 +1,164 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2020 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + + +import os, subprocess +import random +import getpass +import time +import pathlib + +# set seed +from datetime import datetime +random.seed(datetime.now()) + +import platform +import tempfile +from TopIIVolMeshPluginDialog_ui import Ui_TopIIVolMeshMainFrame +from TopIIVolMeshMonitor import TopIIVolMeshMonitor +from qtsalome import * + +verbose = True + +class TopIIVolMeshPluginDialog(Ui_TopIIVolMeshMainFrame,QWidget): + """ + """ + def __init__(self): + QWidget.__init__(self) + self.setupUi(self) + self.qpbHelp.clicked.connect(self.OnQpbHelpClicked) + self.qpbCompute.clicked.connect(self.OnQpbComputeClicked) + self.qpbMeshFile.clicked.connect(self.OnQpbMeshFileClicked) + self.qpbMeshFile.setToolTip("Select input DEM file") + self.qpbClose.clicked.connect(self.OnQpbCloseClicked) + self.qcbDistributed.stateChanged[int].connect(self.OnqcbDistributedClicked) + self.qlbXParts.setVisible(False) + self.qlbYParts.setVisible(False) + self.qlbZParts.setVisible(False) + self.qsbXParts.setVisible(False) + self.qsbYParts.setVisible(False) + self.qsbZParts.setVisible(False) + self.SALOME_TMP_DIR = None + try: + self.qleTmpDir.setText(os.path.join('/tmp',getpass.getuser(),'top-ii-vol')) + except: + self.qleTmpDir.setText('/tmp') + self.resize(800, 500) + self.outputMesh = '' + + def OnQpbHelpClicked(self): + import SalomePyQt + sgPyQt = SalomePyQt.SalomePyQt() + try: + mydir=os.environ["SMESH_ROOT_DIR"] + except Exception: + QMessageBox.warning(self, "Help", "Help unavailable $SMESH_ROOT_DIR not found") + return + + myDoc=mydir + "/share/doc/salome/gui/SMESH/TopIIVolMesh/index.html" + sgPyQt.helpContext(myDoc,"") + + def OnQpbMeshFileClicked(self): + fd = QFileDialog(self, "select an existing Mesh file", self.qleMeshFile.text(), "Mesh-Files (*.xyz);;All Files (*)") + if fd.exec_(): + infile = fd.selectedFiles()[0] + self.qleMeshFile.setText(infile) + + def OnQpbComputeClicked(self): + if self.qleMeshFile.text() == '': + QMessageBox.critical(self, "Mesh", "select an input mesh") + return + inputMesh = self.qleMeshFile.text() + # retrieve x,y,z and depth parameters + xPoints = self.qsbXPoints.value() + yPoints = self.qsbYPoints.value() + zPoints = self.qsbZPoints.value() + depth = self.qsbDepth.value() + nProcs = self.qsbNBprocs.value() + if not self.qcbDistributed.isChecked(): + if nProcs == 1: + shellCmd = "topIIvol_Mesher" + else: + shellCmd = "mpirun -np {} topIIvol_ParMesher".format(nProcs) + shellCmd+= " --xpoints " + str(xPoints) + shellCmd+= " --ypoints " + str(yPoints) + shellCmd+= " --zpoints " + str(zPoints) + shellCmd+= " --depth " + str(depth) + shellCmd+= " --in " + inputMesh + else: + xParts = self.qsbXParts.value() + yParts = self.qsbYParts.value() + zParts = self.qsbZParts.value() + shellCmd = "mpirun -np {} topIIvol_DistMesher".format(nProcs) + shellCmd+= " --xpoints " + str(xPoints) + shellCmd+= " --ypoints " + str(yPoints) + shellCmd+= " --zpoints " + str(zPoints) + shellCmd+= " --depth " + str(depth) + shellCmd+= " --partition_x " + str(xParts) + shellCmd+= " --partition_y " + str(xParts) + shellCmd+= " --partition_z " + str(xParts) + shellCmd+= " --in " + inputMesh + if platform.system()=="Windows" : + self.SALOME_TMP_DIR = os.getenv("SALOME_TMP_DIR") + else: + self.SALOME_TMP_DIR = os.path.join(self.qleTmpDir.text(), time.strftime("%Y-%m-%d-%H-%M-%S")) + pathlib.Path(self.SALOME_TMP_DIR).mkdir(parents=True, exist_ok=True) + self.outputMesh= os.path.join(self.SALOME_TMP_DIR, inputMesh.split('/').pop().replace('.xyz','.mesh')) + shellCmd+= " --out " + self.outputMesh + print("INFO: ", shellCmd) + myMonitorView=TopIIVolMeshMonitor(self, shellCmd) + + def OnqcbDistributedClicked(self): + state = self.qcbDistributed.isChecked() + self.qlbXParts.setVisible(state) + self.qlbYParts.setVisible(state) + self.qlbZParts.setVisible(state) + self.qsbXParts.setVisible(state) + self.qsbYParts.setVisible(state) + self.qsbZParts.setVisible(state) + + def OnQpbCloseClicked(self): + self.close() + + def saveOutputMesh(self): + if not self.qcbDisplayMesh.isChecked(): + return True + import salome + import SMESH, SALOMEDS + from salome.smesh import smeshBuilder + smesh = smeshBuilder.New() + self.outputMesh.split('/') + for mesh in pathlib.Path(self.SALOME_TMP_DIR).glob('*.mesh'): + (outputMesh, status) = smesh.CreateMeshesFromGMF(os.path.join(self.SALOME_TMP_DIR, mesh)) + if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser() + return True + +__instance = None + +def getInstance(): + """ + This function returns a singleton instance of the plugin dialog. + It is mandatory in order to call show without a parent ... + """ + global __instance + if __instance is None: + __instance = TopIIVolMeshPluginDialog() + return __instance diff --git a/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPluginDialog.ui b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPluginDialog.ui new file mode 100644 index 000000000..c148582f6 --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPluginDialog.ui @@ -0,0 +1,474 @@ + + + TopIIVolMeshMainFrame + + + + 0 + 0 + 780 + 411 + + + + Tetra Mesh from cloud of xyz points mesh generator + + + + + 10 + 10 + 761 + 101 + + + + + 10 + + + + Input Mesh + + + + + 10 + 50 + 151 + 31 + + + + + 10 + + + + DEM input file + + + + 18 + 18 + + + + + + + 170 + 50 + 531 + 31 + + + + + 10 + + + + + + + + 10 + 120 + 761 + 231 + + + + Options + + + + + 10 + 30 + 62 + 22 + + + + 0 + + + 999999999 + + + 10 + + + + + + 80 + 30 + 201 + 20 + + + + Number of points in X direction + + + + + + 10 + 70 + 62 + 22 + + + + 0 + + + 999999999 + + + 10 + + + + + + 10 + 110 + 62 + 22 + + + + 0 + + + 999999999 + + + 10 + + + + + + 80 + 70 + 211 + 20 + + + + Number of points in Y direction + + + + + + 80 + 110 + 211 + 20 + + + + Number of points in Z direction + + + + + + 10 + 150 + 62 + 22 + + + + -999999999 + + + 999999999 + + + 0 + + + + + + 80 + 150 + 201 + 20 + + + + Depth in Z direction + + + + + + 630 + 30 + 91 + 21 + + + + + + + + + + 370 + 30 + 151 + 16 + + + + Number of processors + + + + + + 660 + 30 + 101 + 16 + + + + Distributed + + + + + + 370 + 70 + 261 + 16 + + + + Number of partitions in X direction + + + + + + 370 + 110 + 251 + 16 + + + + Number of partitions in Y direction + + + + + + 370 + 150 + 251 + 16 + + + + Number of partitions in Z direction + + + + + + 300 + 30 + 62 + 22 + + + + 0 + + + 999999999 + + + 1 + + + + + + 300 + 70 + 62 + 22 + + + + 0 + + + 999999999 + + + 1 + + + + + + 300 + 110 + 62 + 22 + + + + 0 + + + 999999999 + + + 1 + + + + + + 300 + 150 + 62 + 22 + + + + 0 + + + 999999999 + + + 1 + + + + + + 10 + 200 + 611 + 23 + + + + + + + + + + 10 + 180 + 391 + 16 + + + + Workspace + + + + + + 630 + 70 + 91 + 21 + + + + + + + + + + 660 + 70 + 101 + 16 + + + + Display mesh + + + + + + + 10 + 370 + 761 + 27 + + + + + + + Compute + + + + + + + Close + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 10 + + + + Help + + + + + + + + + diff --git a/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPlugin_plugin.py b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPlugin_plugin.py new file mode 100644 index 000000000..2468401a8 --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/TopIIVolMeshPlugin_plugin.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2020 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# if you already have plugins defined in a salome_plugins.py file, add this file at the end. +# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py + +def TopIIVolMeshLct(context): + # get context study, salomeGui + study = context.study + sg = context.sg + + import os + import subprocess + import tempfile + from qtsalome import QFileDialog, QMessageBox + + import TopIIVolMeshPluginDialog + window = TopIIVolMeshPluginDialog.getDialog() + window.show() diff --git a/src/Tools/TopIIVolMeshPlug/doc/CMakeLists.txt b/src/Tools/TopIIVolMeshPlug/doc/CMakeLists.txt new file mode 100644 index 000000000..b7649123e --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/doc/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright (C) 2012-2021 CEA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +SALOME_CONFIGURE_FILE(conf.py.in conf.py) + +SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees ${CMAKE_CURRENT_SOURCE_DIR} docutils) +SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}" CONTEXT TopIIVolMeshPlug_DOC) +ADD_CUSTOM_TARGET(html_docs_TopIIVolMeshPlug COMMAND ${_cmd}) + +INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs_TopIIVolMeshPlug)") +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docutils/ DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH/TopIIVolMesh) + +SET(make_clean_files docutils doctrees) +SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}") diff --git a/src/Tools/TopIIVolMeshPlug/doc/TopIIVolMesh.rst b/src/Tools/TopIIVolMeshPlug/doc/TopIIVolMesh.rst new file mode 100644 index 000000000..48e3f873a --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/doc/TopIIVolMesh.rst @@ -0,0 +1,63 @@ +Introduction +============ + +**topIIvol** meshing tool provides sequential/parallel tools for creating volumetric tetrahedral meshes from a given topology (point-cloud `*.xyz`). + +Running topIIvol Plug-in +======================== + +**topIIVolMesh** plug-in can be invoked via SMESH Plugin item in Mesh menu bar + +.. image:: images/callTopIIVolMesh.png + :align: center + + +**topIIVolMesh** Options +======================== + + +Sequential mode +--------------- +If the number of processors is set to 1, **topIIvol_Mesher** sequential tool is called for creating volumetric tetrahedral meshes from a given topology. The volumetric mesh can be displayed in SALOME by ticking the "Display mesh" check-box. + +The list of input parameters are: + +- DEM input file: input point cloud file; +- Number of X points present in the input point cloud; +- Number of Y points present in the input point cloud; +- Number of Z points intended in the z direction; +- Depth of the mesh needed; +- temporary directory for calculation. + +Parallel mode +--------------- +If the number of processors is greater than one, **topIIvol_ParMesher** parallel computing tool is called for creating volumetric tetrahedral meshes from a given topology. The volumetric mesh can be displayed in SALOME by ticking the "Display mesh" check-box. + +The list of input parameters are: + +- DEM input file: input point cloud file; +- Number of X points present in the input point cloud; +- Number of Y points present in the input point cloud; +- Number of Z points intended in the z direction; +- Depth of the mesh needed; +- Number of MPI ranks +- temporary directory for calculation. + + +Distributed mode +----------------- +If the check-box **Distributed** is ticked, **topIIvol_DistMesher** computing tool is called for creating embarassingly parallel distributed meshes from a given topology. + +The list of input parameters are: + +- DEM input file: input point cloud file; +- Number of X points present in the input point cloud; +- Number of Y points present in the input point cloud; +- Number of Z points intended in the z direction; +- Number of partitions in X direction; +- Number of partitions in Y direction; +- Number of partitions in Z direction; +- Depth of the mesh needed; +- Number of MPI ranks +- temporary directory for calculation. + diff --git a/src/Tools/TopIIVolMeshPlug/doc/conf.py.in b/src/Tools/TopIIVolMeshPlug/doc/conf.py.in new file mode 100644 index 000000000..56b7819ba --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/doc/conf.py.in @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# +# TopIIVolMesh PlugIn documentation build configuration file +# + +import sys, os +import sphinx + +# If your extensions are in another directory, add it here. If the directory +# is relative to the documentation root, use os.path.abspath to make it +# absolute, like shown here. +#sys.path.append(os.path.abspath('some/directory')) + +# General configuration +# --------------------- + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc'] +try: + import sphinx_rtd_theme + extensions += ['sphinx_rtd_theme'] + use_rtd_theme = True +except: + use_rtd_theme = False + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['.templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General substitutions. +project = 'topIIvol Plug-in' +copyright = '2007-2021 CEA' + +# The default replacements for |version| and |release|, also used in various +# other places throughout the built documents. +# +# The short X.Y version. +version = '@SALOMESMESH_VERSION@' +# The full version, including alpha/beta/rc tags. +release = '@SALOMESMESH_VERSION@' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# List of directories, relative to source directories, that shouldn't be searched +# for source files. +#exclude_dirs = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# Options for HTML output +# ----------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +if use_rtd_theme: + html_theme = 'sphinx_rtd_theme' +else: + html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic' + +themes_options = {} +themes_options['classic'] = { + 'body_max_width':'none', + 'body_min_width':0, +} +html_theme_options = themes_options.get(html_theme, {}) + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (within the static path) to place at the top of +# the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +#html_static_path = ['.static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_use_modindex = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, the reST sources are included in the HTML build as _sources/. +#html_copy_source = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'TopIIVolMeshPlug-in doc' + + +# Options for LaTeX output +# ------------------------ + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, document class [howto/manual]). +latex_documents = [ + ('index', 'TopIIVolMeshPlugIn.tex', 'TopIIVolMesh PlugIn Documentation', + 'CEA', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_use_modindex = True diff --git a/src/Tools/TopIIVolMeshPlug/doc/images/callTopIIVolMesh.png b/src/Tools/TopIIVolMeshPlug/doc/images/callTopIIVolMesh.png new file mode 100644 index 000000000..72a9d5d943 Binary files /dev/null and b/src/Tools/TopIIVolMeshPlug/doc/images/callTopIIVolMesh.png differ diff --git a/src/Tools/TopIIVolMeshPlug/doc/index.rst b/src/Tools/TopIIVolMeshPlug/doc/index.rst new file mode 100644 index 000000000..3cd237947 --- /dev/null +++ b/src/Tools/TopIIVolMeshPlug/doc/index.rst @@ -0,0 +1,22 @@ +.. TopIIVolMesh documentation master file, created by sphinx-quickstart. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +topIIvol plugin documentation +===================================== + +This documentation covers the usage of **top-ii-vol** as plug-in in SALOME that can be used within the SALOME +Mesh module. + +TopIIVolMesh plug-in uses CEA **top-ii-Vol** meshing tool,which provides sequential/parallel tools for creating volumetric tetrahedral meshes from a given topology. +This plug-in offers only the most common functionalities of the tool. + +Contents: + +.. toctree:: + :maxdepth: 2 + + TopIIVolMesh.rst + + + diff --git a/src/Tools/smesh_plugins.py b/src/Tools/smesh_plugins.py index 7c726820a..66aa07bd9 100644 --- a/src/Tools/smesh_plugins.py +++ b/src/Tools/smesh_plugins.py @@ -91,3 +91,14 @@ except Exception as e: #print 'probleme zcracks' salome_pluginsmanager.logger.info('ERROR: Zcrack plug-in is unavailable: {}'.format(e)) pass + +# Topological to volumic mesh plugin +try: + from TopIIVolMeshPlugin import TopIIVolMeshLct + salome_pluginsmanager.AddFunction('Run Topological Volumic mesher', + 'run topological volumic mesher', + TopIIVolMeshLct) +except Exception as e: + #print 'probleme zcracks' + salome_pluginsmanager.logger.info('ERROR: TopIIVolMesh plug-in is unavailable: {}'.format(e)) + pass