From: rnc Date: Mon, 2 Sep 2013 12:20:44 +0000 (+0000) Subject: Merge from V7_main X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2a0ff88cf124a67aaf24a217b3a52d1b2414dbc5;p=plugins%2Fghs3dplugin.git Merge from V7_main --- diff --git a/Makefile.am b/Makefile.am index 91c9c4f..ec3f2d1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,13 +29,11 @@ if GHS3DPLUGIN_ENABLE_GUI ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ - -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files else !GHS3DPLUGIN_ENABLE_GUI ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ - -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files endif diff --git a/build_configure b/build_configure index ef04e8c..c532a52 100755 --- a/build_configure +++ b/build_configure @@ -53,10 +53,10 @@ fi ######################################################################## # Test if the MED_ROOT_DIR is set correctly -if test ! -d "${MED_ROOT_DIR}"; then - echo "failed : MED_ROOT_DIR variable is not correct !" - exit -fi +# if test ! -d "${MED_ROOT_DIR}"; then +# echo "failed : MED_ROOT_DIR variable is not correct !" +# exit +# fi ######################################################################## # Test if the SMESH_ROOT_DIR is set correctly @@ -84,13 +84,11 @@ if test -d "${GUI_ROOT_DIR}"; then aclocal -I adm_local/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ - -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1 else aclocal -I adm_local/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ - -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1 fi diff --git a/configure.ac b/configure.ac index 8f57e4a..b561e46 100644 --- a/configure.ac +++ b/configure.ac @@ -331,14 +331,6 @@ echo CHECK_GEOM -echo -echo --------------------------------------------- -echo Testing Med -echo --------------------------------------------- -echo - -CHECK_MED - echo echo --------------------------------------------- echo Testing SMesh @@ -363,11 +355,11 @@ echo echo Configure if test "${gui_ok}" = "yes"; then - variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok OpenGL_ok qt_ok vtk_ok" + variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok SMesh_ok MeshGems_Tetra_ok OpenGL_ok qt_ok vtk_ok" elif test "${SalomeGUI_need}" != "no"; then - variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok vtk_ok" + variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok SMesh_ok MeshGems_Tetra_ok vtk_ok" else - variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok vtk_ok" + variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok Geom_ok SMesh_ok MeshGems_Tetra_ok vtk_ok" fi for var in $variables diff --git a/doc/salome/gui/GHS3DPLUGIN/CMakeLists.txt b/doc/salome/gui/GHS3DPLUGIN/CMakeLists.txt index 13068c9..94dad40 100755 --- a/doc/salome/gui/GHS3DPLUGIN/CMakeLists.txt +++ b/doc/salome/gui/GHS3DPLUGIN/CMakeLists.txt @@ -44,8 +44,6 @@ IF(WINDOWS) @SET PATH=$ENV{KERNEL_ROOT_DIR}/lib/salome\;%PATH% @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/bin/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% - @SET PYTHONPATH=$ENV{MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% - @SET PYTHONPATH=$ENV{MED_ROOT_DIR}/bin/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/bin/salome\;%PYTHONPATH% @SET PYTHONPATH=$ENV{SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% @@ -57,8 +55,8 @@ IF(WINDOWS) SET(EXT "bat") SET(CALL_STR "call") ELSE(WINDOWS) - SET(DOC_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${SMESH_ROOT_DIR}/bin/salome:${SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT_USER}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT_USER}/lib64/python${PYTHON_VERSION}/site-packages) - SET(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${MED_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome") + SET(DOC_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${SMESH_ROOT_DIR}/bin/salome:${SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT_USER}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT_USER}/lib64/python${PYTHON_VERSION}/site-packages) + SET(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome") SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:\${PYTHONPATH} export LD_LIBRARY_PATH=${DOC_LD_LIBRARY_PATH}:\${LD_LIBRARY_PATH} export SMESH_MeshersList=${DOC_SMESH_MeshersList} diff --git a/doc/salome/gui/GHS3DPLUGIN/Makefile.am b/doc/salome/gui/GHS3DPLUGIN/Makefile.am index b7dd89a..4250603 100755 --- a/doc/salome/gui/GHS3DPLUGIN/Makefile.am +++ b/doc/salome/gui/GHS3DPLUGIN/Makefile.am @@ -23,8 +23,8 @@ EXTRA_DIST += images input static/footer.html static/salome_extra.css guidocdir = $(docdir)/gui/GHS3DPLUGIN guidoc_DATA = images/head.png -DOC_PYTHONPATH=$(prefix)/bin/salome:$(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(SMESH_ROOT_DIR)/bin/salome:$(SMESH_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(MED_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(GEOM_ROOT_DIR)/bin/salome:$(GEOM_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages -DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:$(SMESH_ROOT_DIR)/lib/salome:$(MED_ROOT_DIR)/lib/salome:$(GEOM_ROOT_DIR)/lib/salome:$(KERNEL_ROOT_DIR)/lib/salome +DOC_PYTHONPATH=$(prefix)/bin/salome:$(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(SMESH_ROOT_DIR)/bin/salome:$(SMESH_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(GEOM_ROOT_DIR)/bin/salome:$(GEOM_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages +DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:$(SMESH_ROOT_DIR)/lib/salome:$(GEOM_ROOT_DIR)/lib/salome:$(KERNEL_ROOT_DIR)/lib/salome DOC_SMESH_MeshersList=GHS3DPlugin tmp/smeshBuilder.py: $(top_srcdir)/src/GHS3DPlugin/GHS3DPluginBuilder.py diff --git a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png index e272cef..e71688e 100644 Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png differ diff --git a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc index 9cececf..0930956 100644 --- a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc +++ b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc @@ -22,6 +22,10 @@ create mesh in the holes inside a solid shape, else only the outermost shape will be meshed. Volumic elements created within holes are bound to the solid. +- To make groups of domains - if checked, the algorithm will +create groups of just generated elements corresponding to each mesh +domain.
+ - Optimization level - allows choosing the required optimization level (higher level of optimisation provides better mesh, but can be time-consuming): diff --git a/idl/GHS3DPlugin_Algorithm.idl b/idl/GHS3DPlugin_Algorithm.idl index 2a608dd..01be915 100644 --- a/idl/GHS3DPlugin_Algorithm.idl +++ b/idl/GHS3DPlugin_Algorithm.idl @@ -19,7 +19,6 @@ // File : GHS3D_Algorithm.idl // Author : Julia DOROVSKIKH -// $Header$ // #ifndef _GHS3D_Algorithm_IDL_ #define _GHS3D_Algorithm_IDL_ @@ -72,6 +71,13 @@ module GHS3DPlugin */ void SetToMeshHoles(in boolean toMesh); boolean GetToMeshHoles(); + /*! + * To make groups of volumes of different domains when mesh is generated from skin. + * Default is to make groups. + * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true + */ + void SetToMakeGroupsOfDomains(in boolean toMakeGroups); + boolean GetToMakeGroupsOfDomains(); /*! * Maximal size of memory to be used by the algorithm (in Megabytes). * Negative value means not to use this option diff --git a/idl/Makefile.am b/idl/Makefile.am index 723911d..638da85 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -49,14 +49,12 @@ libSalomeIDLGHS3DPLUGIN_la_CPPFLAGS = \ $(CORBA_INCLUDES) \ $(KERNEL_CXXFLAGS) \ $(GEOM_CXXFLAGS) \ - $(MED_CXXFLAGS) \ $(SMESH_CXXFLAGS) libSalomeIDLGHS3DPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0 libSalomeIDLGHS3DPLUGIN_la_LIBADD = \ $(KERNEL_LDFLAGS) -lSalomeIDLKernel \ $(GEOM_LDFLAGS) -lSalomeIDLGEOM \ - $(MED_LDFLAGS) -lSalomeIDLMED \ $(SMESH_LDFLAGS) -lSalomeIDLSMESH \ @CORBA_LIBS@ @@ -68,7 +66,6 @@ OMNIORB_IDLPYFLAGS = \ -I$(top_builddir)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \ - -I$(MED_ROOT_DIR)/idl/salome \ -I$(SMESH_ROOT_DIR)/idl/salome IDLCXXFLAGS = \ @@ -77,13 +74,11 @@ IDLCXXFLAGS = \ -I$(top_builddir)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \ - -I$(MED_ROOT_DIR)/idl/salome \ -I$(SMESH_ROOT_DIR)/idl/salome IDLPYFLAGS = \ @IDLPYFLAGS@ \ -I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \ - -I$(MED_ROOT_DIR)/idl/salome \ -I$(SMESH_ROOT_DIR)/idl/salome # potential problem on parallel make on the following - multiple outputs @@ -121,7 +116,7 @@ mostlyclean-local: @for dep in $^ dummy; do \ if [ $$dep != "dummy" ]; then \ echo Building dependencies for $$dep; \ - $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \ + $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \ sed 's/\.o/\SK.cc/' >>$@; \ fi; \ done ; diff --git a/resources/GHS3DPlugin.xml b/resources/GHS3DPlugin.xml index 144cb6d..8d0ac36 100644 --- a/resources/GHS3DPlugin.xml +++ b/resources/GHS3DPlugin.xml @@ -27,6 +27,7 @@ diff --git a/src/GHS3DPlugin/GHS3DPluginBuilder.py b/src/GHS3DPlugin/GHS3DPluginBuilder.py index 4e07a2e..08dfb09 100644 --- a/src/GHS3DPlugin/GHS3DPluginBuilder.py +++ b/src/GHS3DPlugin/GHS3DPluginBuilder.py @@ -86,6 +86,14 @@ class GHS3D_Algorithm(Mesh_Algorithm): self.Parameters().SetToMeshHoles(toMesh) pass + ## To make groups of volumes of different domains when mesh is generated from skin. + # Default is to make groups. + # This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true + # @param toMesh "mesh holes" flag value + def SetToMakeGroupsOfDomains(self, toMakeGroups): + self.Parameters().SetToMakeGroupsOfDomains(toMakeGroups) + pass + ## Set Optimization level: # @param level optimization level, one of the following values # - None_Optimization diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 87588cb..0ff403a 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -29,23 +29,24 @@ #include -//#include "SMESH_Gen.hxx" +//#include #include -#include "SMESH_Mesh.hxx" -#include "SMESH_Comment.hxx" -#include "SMESH_MesherHelper.hxx" -#include "SMESH_MeshEditor.hxx" -#include "SMESH_OctreeNode.hxx" -#include "SMESH_Group.hxx" +#include +#include +#include +#include +#include +#include #include #include +#include -#include "SMDS_MeshElement.hxx" -#include "SMDS_MeshNode.hxx" -#include "SMDS_FaceOfNodes.hxx" -#include "SMDS_VolumeOfNodes.hxx" +#include +#include +#include +#include -#include "SMESHDS_Group.hxx" +#include #include #include @@ -76,7 +77,7 @@ #include #include -#include "utilities.h" +#include #ifdef WIN32 #include @@ -111,6 +112,8 @@ extern "C" typedef const list TTriaList; +static const char theDomainGroupNamePrefix[] = "Domain_"; + static void removeFile( const TCollection_AsciiString& fileName ) { try { @@ -131,7 +134,7 @@ GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen) : SMESH_3D_Algo(hypId, studyId, gen) { MESSAGE("GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D"); - _name = "GHS3D_3D"; + _name = Name(); _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type _onlyUnaryInput = false; // Compute() will be called on a compound of solids _iShape=0; @@ -151,9 +154,7 @@ GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen) if (myStudy) MESSAGE("myStudy->StudyId() = " << myStudy->StudyId()); -#ifdef WITH_SMESH_CANCEL_COMPUTE _compute_canceled = false; -#endif } //============================================================================= @@ -1054,15 +1055,94 @@ static void updateMeshGroups(SMESH_Mesh* theMesh, std::set groupsTo } } +//======================================================================= +//function : removeEmptyGroupsOfDomains +//purpose : remove empty groups named "Domain_nb" created due to +// "To make groups of domains" option. +//======================================================================= + +static void removeEmptyGroupsOfDomains(SMESH_Mesh* mesh, + bool notEmptyAsWell = false) +{ + const char* refName = theDomainGroupNamePrefix; + const size_t refLen = strlen( theDomainGroupNamePrefix ); + + std::list groupIDs = mesh->GetGroupIds(); + std::list::const_iterator id = groupIDs.begin(); + for ( ; id != groupIDs.end(); ++id ) + { + SMESH_Group* group = mesh->GetGroup( *id ); + if ( !group || ( !group->GetGroupDS()->IsEmpty() && !notEmptyAsWell )) + continue; + const char* name = group->GetName(); + char* end; + // check the name + if ( strncmp( name, refName, refLen ) == 0 && // starts from refName; + isdigit( *( name + refLen )) && // refName is followed by a digit; + strtol( name + refLen, &end, 10) >= 0 && // there are only digits ... + *end == '\0') // ... till a string end. + { + mesh->RemoveGroup( *id ); + } + } +} + +//================================================================================ +/*! + * \brief Create the groups corresponding to domains + */ +//================================================================================ + +static void makeDomainGroups( std::vector< std::vector< const SMDS_MeshElement* > >& elemsOfDomain, + SMESH_MesherHelper* theHelper) +{ + // int nbDomains = 0; + // for ( size_t i = 0; i < elemsOfDomain.size(); ++i ) + // nbDomains += ( elemsOfDomain[i].size() > 0 ); + + // if ( nbDomains > 1 ) + for ( size_t iDomain = 0; iDomain < elemsOfDomain.size(); ++iDomain ) + { + std::vector< const SMDS_MeshElement* > & elems = elemsOfDomain[ iDomain ]; + if ( elems.empty() ) continue; + + // find existing groups + std::vector< SMESH_Group* > groupOfType( SMDSAbs_NbElementTypes, (SMESH_Group*)NULL ); + const std::string domainName = ( SMESH_Comment( theDomainGroupNamePrefix ) << iDomain ); + SMESH_Mesh::GroupIteratorPtr groupIt = theHelper->GetMesh()->GetGroups(); + while ( groupIt->more() ) + { + SMESH_Group* group = groupIt->next(); + if ( domainName == group->GetName() && + dynamic_cast< SMESHDS_Group* >( group->GetGroupDS()) ) + groupOfType[ group->GetGroupDS()->GetType() ] = group; + } + // create and fill the groups + size_t iElem = 0; + int groupID; + do + { + SMESH_Group* group = groupOfType[ elems[ iElem ]->GetType() ]; + if ( !group ) + group = theHelper->GetMesh()->AddGroup( elems[ iElem ]->GetType(), + domainName.c_str(), groupID ); + SMDS_MeshGroup& groupDS = + static_cast< SMESHDS_Group* >( group->GetGroupDS() )->SMDSGroup(); + + while ( iElem < elems.size() && groupDS.Add( elems[iElem] )) + ++iElem; + + } while ( iElem < elems.size() ); + } +} + //======================================================================= //function : readGMFFile //purpose : read GMF file w/o geometry associated to mesh //======================================================================= static bool readGMFFile(const char* theFile, -#ifdef WITH_SMESH_CANCEL_COMPUTE GHS3DPlugin_GHS3D* theAlgo, -#endif SMESH_MesherHelper* theHelper, TopoDS_Shape theSolid, vector & theNodeByGhs3dId, @@ -1070,8 +1150,8 @@ static bool readGMFFile(const char* theFile, std::vector & aNodeGroupByGhs3dId, std::vector & anEdgeGroupByGhs3dId, std::vector & aFaceGroupByGhs3dId, - std::set & groupsToRemove - ) + std::set & groupsToRemove, + bool toMakeGroupsOfDomains=false) { std::string tmpStr; SMESHDS_Mesh* theMeshDS = theHelper->GetMeshDS(); @@ -1098,13 +1178,14 @@ static bool readGMFFile(const char* theFile, // --------------------------------- int nbElem = 0, nbRef = 0; - int aGMFNodeID = 0/*, shapeID*/; - //int *nodeAssigne; + int aGMFNodeID = 0; const SMDS_MeshNode** GMFNode; #ifdef _DEBUG_ std::map > subdomainId2tetraId; #endif std::map tabRef; + const bool force3d = true; // since there is no geometry + const int noID = 0; tabRef[GmfVertices] = 3; // for new nodes and enforced nodes tabRef[GmfCorners] = 1; @@ -1125,28 +1206,27 @@ static bool readGMFFile(const char* theFile, // Issue 0020682. Avoid creating nodes and tetras at place where // volumic elements already exist SMESH_ElementSearcher* elemSearcher = 0; - vector< const SMDS_MeshElement* > foundVolumes; + std::vector< const SMDS_MeshElement* > foundVolumes; if ( theHelper->GetMesh()->NbVolumes() > 0 ) - elemSearcher = SMESH_MeshEditor( theHelper->GetMesh() ).GetElementSearcher(); + elemSearcher = SMESH_MeshAlgos::GetElementSearcher( *theHelper->GetMeshDS() ); + + // IMP 0022172: [CEA 790] create the groups corresponding to domains + std::vector< std::vector< const SMDS_MeshElement* > > elemsOfDomain; int nbVertices = GmfStatKwd(InpMsh, GmfVertices) - nbInitialNodes; GMFNode = new const SMDS_MeshNode*[ nbVertices + 1 ]; - //nodeAssigne = new int[ nbVertices + 1 ]; std::map ::const_iterator it = tabRef.begin(); for ( ; it != tabRef.end() ; ++it) { -#ifdef WITH_SMESH_CANCEL_COMPUTE if(theAlgo->computeCanceled()) { GmfCloseMesh(InpMsh); delete [] GMFNode; - //delete [] nodeAssigne; return false; } -#endif int dummy; GmfKwdCod token = it->first; - nbRef = it->second; + nbRef = it->second; nbElem = GmfStatKwd(InpMsh, token); if (nbElem > 0) { @@ -1157,6 +1237,7 @@ static bool readGMFFile(const char* theFile, continue; std::vector id (nbElem*tabRef[token]); // node ids + std::vector domainID( nbElem ); // domain if (token == GmfVertices) { (nbElem <= 1) ? tmpStr = " vertex" : tmpStr = " vertices"; @@ -1181,16 +1262,12 @@ static bool readGMFFile(const char* theFile, double x, y, z; const SMDS_MeshNode * aGMFNode; - //shapeID = theMeshDS->ShapeToIndex( theSolid ); for ( int iElem = 0; iElem < nbElem; iElem++ ) { -#ifdef WITH_SMESH_CANCEL_COMPUTE if(theAlgo->computeCanceled()) { GmfCloseMesh(InpMsh); delete [] GMFNode; - //delete [] nodeAssigne; return false; } -#endif if (ver == GmfFloat) { GmfGetLin(InpMsh, token, &VerTab_f[0], &VerTab_f[1], &VerTab_f[2], &dummy); x = VerTab_f[0]; @@ -1209,7 +1286,6 @@ static bool readGMFFile(const char* theFile, aGMFID = iElem -nbInitialNodes +1; GMFNode[ aGMFID ] = aGMFNode; - //nodeAssigne[ aGMFID ] = 0; if (aGMFID-1 < aNodeGroupByGhs3dId.size() && !aNodeGroupByGhs3dId.at(aGMFID-1).empty()) addElemInMeshGroup(theHelper->GetMesh(), aGMFNode, aNodeGroupByGhs3dId.at(aGMFID-1), groupsToRemove); } @@ -1228,22 +1304,22 @@ static bool readGMFFile(const char* theFile, else if (token == GmfEdges && nbElem > 0) { (nbElem <= 1) ? tmpStr = " edge" : tmpStr = " edges"; for ( int iElem = 0; iElem < nbElem; iElem++ ) - GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &dummy); + GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &domainID[iElem]); } else if (token == GmfTriangles && nbElem > 0) { (nbElem <= 1) ? tmpStr = " triangle" : tmpStr = " triangles"; for ( int iElem = 0; iElem < nbElem; iElem++ ) - GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &dummy); + GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &domainID[iElem]); } else if (token == GmfQuadrilaterals && nbElem > 0) { (nbElem <= 1) ? tmpStr = " Quadrilateral" : tmpStr = " Quadrilaterals"; for ( int iElem = 0; iElem < nbElem; iElem++ ) - GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &dummy); + GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &domainID[iElem]); } else if (token == GmfTetrahedra && nbElem > 0) { (nbElem <= 1) ? tmpStr = " Tetrahedron" : tmpStr = " Tetrahedra"; for ( int iElem = 0; iElem < nbElem; iElem++ ) { - GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &dummy); + GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &domainID[iElem]); #ifdef _DEBUG_ subdomainId2tetraId[dummy].insert(iElem+1); // MESSAGE("subdomainId2tetraId["<computeCanceled()) { GmfCloseMesh(InpMsh); delete [] GMFNode; - //delete [] nodeAssigne; return false; } -#endif // Check if elem is already in input mesh. If yes => skip bool fullyCreatedElement = false; // if at least one of the nodes was created for ( int iRef = 0; iRef < nbRef; iRef++ ) @@ -1301,30 +1374,26 @@ static bool readGMFFile(const char* theFile, node [ iRef ] = GMFNode[ aGMFNodeID ]; } } - + aCreatedElem = 0; switch (token) { case GmfEdges: if (fullyCreatedElement) { - aCreatedElem = theHelper->AddEdge( node[0], node[1], /*id =*/0, /*force3d =*/false ); + aCreatedElem = theHelper->AddEdge( node[0], node[1], noID, force3d ); if (anEdgeGroupByGhs3dId.size() && !anEdgeGroupByGhs3dId[iElem].empty()) addElemInMeshGroup(theHelper->GetMesh(), aCreatedElem, anEdgeGroupByGhs3dId[iElem], groupsToRemove); } break; case GmfTriangles: if (fullyCreatedElement) { - aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], /*id =*/0, /*force3d =*/false ); - // for ( int iRef = 0; iRef < nbRef; iRef++ ) - // nodeAssigne[ nodeID[ iRef ]] = 1; + aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], noID, force3d ); if (aFaceGroupByGhs3dId.size() && !aFaceGroupByGhs3dId[iElem].empty()) addElemInMeshGroup(theHelper->GetMesh(), aCreatedElem, aFaceGroupByGhs3dId[iElem], groupsToRemove); } break; case GmfQuadrilaterals: if (fullyCreatedElement) { - theHelper->AddFace( node[0], node[1], node[2], node[3], /*id =*/0, /*force3d =*/false ); - // for ( int iRef = 0; iRef < nbRef; iRef++ ) - // nodeAssigne[ nodeID[ iRef ]] = 1; + aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], node[3], noID, force3d ); } break; case GmfTetrahedra: @@ -1340,8 +1409,7 @@ static bool readGMFFile(const char* theFile, SMDSAbs_Volume, foundVolumes )) break; } - theHelper->AddVolume( node[1], node[0], node[2], node[3], /*id =*/0, /*force3d =*/false ); -// theMeshDS->SetMeshElementOnShape( aTet, shapeID ); + aCreatedElem = theHelper->AddVolume( node[1], node[0], node[2], node[3], noID, force3d ); break; case GmfHexahedra: if ( elemSearcher ) { @@ -1360,27 +1428,31 @@ static bool readGMFFile(const char* theFile, SMDSAbs_Volume, foundVolumes )) break; } - theHelper->AddVolume( node[0], node[3], node[2], node[1], - node[4], node[7], node[6], node[5], /*id =*/0, /*force3d =*/false ); -// theMeshDS->SetMeshElementOnShape( aTet, shapeID ); + aCreatedElem = theHelper->AddVolume( node[0], node[3], node[2], node[1], + node[4], node[7], node[6], node[5], noID, force3d ); break; default: continue; } - } + if ( aCreatedElem && toMakeGroupsOfDomains ) + { + if ( domainID[iElem] >= (int) elemsOfDomain.size() ) + elemsOfDomain.resize( domainID[iElem] + 1 ); + elemsOfDomain[ domainID[iElem] ].push_back( aCreatedElem ); + } + } // loop on elements of one type break; - } - } - } - - // for ( int i = 0; i < nbVertices; ++i ) { - // if ( !nodeAssigne[ i+1 ]) - // theMeshDS->SetNodeInVolume( GMFNode[ i+1 ], shapeID ); - // } + } // case ... + } // switch (token) + } // loop on tabRef GmfCloseMesh(InpMsh); delete [] GMFNode; - //delete [] nodeAssigne; -#ifdef _DEBUG_ + + // 0022172: [CEA 790] create the groups corresponding to domains + if ( toMakeGroupsOfDomains ) + makeDomainGroups( elemsOfDomain, theHelper ); + +#ifdef _DEBUG_ MESSAGE("Nb subdomains " << subdomainId2tetraId.size()); std::map >::const_iterator subdomainIt = subdomainId2tetraId.begin(); TCollection_AsciiString aSubdomainFileName = theFile; @@ -1444,7 +1516,8 @@ static bool writeGMFFile(const char* theMesh GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap::iterator elemIt; TIDSortedElemSet::iterator elemSetIt; bool isOK; - auto_ptr< SMESH_ElementSearcher > pntCls ( SMESH_MeshEditor( theMesh ).GetElementSearcher()); + auto_ptr< SMESH_ElementSearcher > pntCls + ( SMESH_MeshAlgos::GetElementSearcher(*theMesh->GetMeshDS())); int nbEnforcedVertices = theEnforcedVertices.size(); @@ -2811,9 +2884,7 @@ static bool readResultFile(const int fileOpen, #ifdef WNT const char* fileName, #endif -#ifdef WITH_SMESH_CANCEL_COMPUTE GHS3DPlugin_GHS3D* theAlgo, -#endif SMESH_MesherHelper& theHelper, TopoDS_Shape tabShape[], double** tabBox, @@ -2824,7 +2895,8 @@ static bool readResultFile(const int fileOpen, int nbEnforcedVertices, int nbEnforcedNodes, GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedEdges, - GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedTriangles) + GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedTriangles, + bool toMakeGroupsOfDomains) { MESSAGE("GHS3DPlugin_GHS3D::readResultFile()"); Kernel_Utils::Localizer loc; @@ -2900,10 +2972,8 @@ static bool readResultFile(const int fileOpen, MESSAGE("nbEnforcedNodes: "<computeCanceled()) return false; -#endif for (int iCoor=0; iCoor < 3; iCoor++) coord[ iCoor ] = strtod(ptr, &ptr); nodeAssigne[ iNode ] = 1; @@ -2923,10 +2993,8 @@ static bool readResultFile(const int fileOpen, tabID = new int[nbTriangle]; for (int i=0; i < nbTriangle; i++) { -#ifdef WITH_SMESH_CANCEL_COMPUTE if(theAlgo->computeCanceled()) return false; -#endif tabID[i] = 0; // find the solid corresponding to GHS3D sub-domain following // the technique proposed in GHS3D manual in chapter @@ -2980,13 +3048,14 @@ static bool readResultFile(const int fileOpen, if ( nbTriangle <= nbShape ) // no holes toMeshHoles = true; // not avoid creating tetras in holes + // IMP 0022172: [CEA 790] create the groups corresponding to domains + std::vector< std::vector< const SMDS_MeshElement* > > elemsOfDomain( Max( nbTriangle, nbShape )); + // Associating the tetrahedrons to the shapes shapeID = compoundID; for (int iElem = 0; iElem < nbElems; iElem++) { -#ifdef WITH_SMESH_CANCEL_COMPUTE if(theAlgo->computeCanceled()) return false; -#endif for (int iNode = 0; iNode < 4; iNode++) { ID = strtol(tetraPtr, &tetraPtr, 10); itOnNode = theGhs3dIdToNodeMap.find(ID); @@ -2997,6 +3066,7 @@ static bool readResultFile(const int fileOpen, // tetras within holes depending on hypo option, // so we first check if aTet is inside a hole and then create it //aTet = theMeshDS->AddVolume( node[1], node[0], node[2], node[3] ); + ghs3dShapeID = 0; // domain ID if ( nbTriangle > 1 ) { shapeID = HOLE_ID; // negative shapeID means not to create tetras if !toMeshHoles ghs3dShapeID = strtol(shapePtr, &shapePtr, 10) - IdShapeRef; @@ -3041,11 +3111,19 @@ static bool readResultFile(const int fileOpen, aTet = theHelper.AddVolume( node[1], node[0], node[2], node[3], /*id=*/0, /*force3d=*/false); theMeshDS->SetMeshElementOnShape( aTet, shapeID ); + if ( toMakeGroupsOfDomains ) + { + if ( int( elemsOfDomain.size() ) < ghs3dShapeID+1 ) + elemsOfDomain.resize( ghs3dShapeID+1 ); + elemsOfDomain[ ghs3dShapeID ].push_back( aTet ); + } } #ifdef _DEBUG_ shapeIDs.insert( shapeID ); #endif } + if ( toMakeGroupsOfDomains ) + makeDomainGroups( elemsOfDomain, &theHelper ); // Add enforced elements GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap::const_iterator elemIt; @@ -3209,8 +3287,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, // a unique working file name // to avoid access to the same files by eg different users - TCollection_AsciiString aGenericName - = (char*) GHS3DPlugin_Hypothesis::GetFileName(_hyp).c_str(); + _genericName = GHS3DPlugin_Hypothesis::GetFileName(_hyp); + TCollection_AsciiString aGenericName((char*) _genericName.c_str() ); TCollection_AsciiString aResultFileName; TCollection_AsciiString aLogFileName = aGenericName + ".log"; // log @@ -3354,7 +3432,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, // run ghs3d mesher // ----------------- - TCollection_AsciiString cmd = TCollection_AsciiString((char*)GHS3DPlugin_Hypothesis::CommandToRun( _hyp ).c_str() ); + TCollection_AsciiString cmd( (char*)GHS3DPlugin_Hypothesis::CommandToRun( _hyp ).c_str() ); cmd += TCollection_AsciiString(" -f ") + aGenericName; // file to read cmd += TCollection_AsciiString(" 1>" ) + aLogFileName; // dump into file // The output .mesh file does not contain yet the subdomain-info (Ghs3D 4.2) @@ -3367,9 +3445,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, std::cout << "Ghs3d execution..." << std::endl; std::cout << cmd << std::endl; -#ifdef WITH_SMESH_CANCEL_COMPUTE _compute_canceled = false; -#endif system( cmd.ToCString() ); // run @@ -3393,6 +3469,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, else { bool toMeshHoles = _hyp ? _hyp->GetToMeshHoles(true) : GHS3DPlugin_Hypothesis::DefaultMeshHoles(); + const bool toMakeGroupsOfDomains = GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp ); helper.IsQuadraticSubMesh( theShape ); helper.SetElementsOnShape( false ); @@ -3401,14 +3478,13 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, #ifdef WNT aResultFileName.ToCString(), #endif -#ifdef WITH_SMESH_CANCEL_COMPUTE this, -#endif /*theMesh, */helper, tabShape, tabBox, _nbShape, aGhs3dIdToNodeMap, aNodeId2NodeIndexMap, toMeshHoles, nbEnforcedVertices, nbEnforcedNodes, - enforcedEdges, enforcedTriangles ); + enforcedEdges, enforcedTriangles, + toMakeGroupsOfDomains ); // Ok = readGMFFile( // #ifndef GMF_HAS_SUBDOMAIN_INFO @@ -3418,6 +3494,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, // _nbShape, tabShape, tabBox, // aGhs3dIdToNodeMap, toMeshHoles, // nbEnforcedVertices, nbEnforcedNodes); + + removeEmptyGroupsOfDomains( helper.GetMesh(), /*notEmptyAsWell =*/ !toMakeGroupsOfDomains ); } @@ -3431,6 +3509,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, { if ( !_keepFiles ) removeFile( aLogFileName ); + + // if ( _hyp && _hyp->GetToMakeGroupsOfDomains() ) + // error( COMPERR_WARNING, "'toMakeGroupsOfDomains' is ignored since the mesh is on shape" ); } else if ( OSD_File( aLogFileName ).Size() > 0 ) { @@ -3447,11 +3528,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, } if ( !_keepFiles ) { -#ifdef WITH_SMESH_CANCEL_COMPUTE if (! Ok) if(_compute_canceled) removeFile( aLogFileName ); -#endif removeFile( aFacesFileName ); removeFile( aPointsFileName ); removeFile( aResultFileName ); @@ -3487,8 +3566,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, // a unique working file name // to avoid access to the same files by eg different users - TCollection_AsciiString aGenericName - = (char*) GHS3DPlugin_Hypothesis::GetFileName(_hyp).c_str(); + _genericName = GHS3DPlugin_Hypothesis::GetFileName(_hyp); + TCollection_AsciiString aGenericName((char*) _genericName.c_str() ); TCollection_AsciiString aGenericNameRequired = aGenericName + "_required"; TCollection_AsciiString aLogFileName = aGenericName + ".log"; // log @@ -3633,9 +3712,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, std::cout << "Ghs3d execution..." << std::endl; std::cout << cmd << std::endl; -#ifdef WITH_SMESH_CANCEL_COMPUTE _compute_canceled = false; -#endif system( cmd.ToCString() ); // run @@ -3646,16 +3723,16 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, // read a result // -------------- GHS3DPlugin_Hypothesis::TSetStrings groupsToRemove = GHS3DPlugin_Hypothesis::GetGroupsToRemove(_hyp); + const bool toMakeGroupsOfDomains = GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp ); Ok = readGMFFile(aResultFileName.ToCString(), -#ifdef WITH_SMESH_CANCEL_COMPUTE this, -#endif theHelper, theShape, aNodeByGhs3dId, aNodeToGhs3dIdMap, aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId, - groupsToRemove); + groupsToRemove, toMakeGroupsOfDomains); updateMeshGroups(theHelper->GetMesh(), groupsToRemove); + removeEmptyGroupsOfDomains( theHelper->GetMesh(), /*notEmptyAsWell =*/ !toMakeGroupsOfDomains ); if ( Ok ) { GHS3DPlugin_Hypothesis* that = (GHS3DPlugin_Hypothesis*)this->_hyp; @@ -3670,6 +3747,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, { if ( !_keepFiles ) removeFile( aLogFileName ); + + //if ( !toMakeGroupsOfDomains && _hyp && _hyp->GetToMakeGroupsOfDomains() ) + //error( COMPERR_WARNING, "'toMakeGroupsOfDomains' is ignored since 'toMeshHoles' is OFF." ); } else if ( OSD_File( aLogFileName ).Size() > 0 ) { @@ -3686,11 +3766,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, if ( !_keepFiles ) { -#ifdef WITH_SMESH_CANCEL_COMPUTE if (! Ok) if(_compute_canceled) removeFile( aLogFileName ); -#endif removeFile( aGMFFileName ); removeFile( aResultFileName ); removeFile( aRequiredVerticesFileName ); @@ -3699,21 +3777,17 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, return Ok; } -#ifdef WITH_SMESH_CANCEL_COMPUTE void GHS3DPlugin_GHS3D::CancelCompute() { _compute_canceled = true; #ifdef WNT #else - TCollection_AsciiString aGenericName - = (char*) GHS3DPlugin_Hypothesis::GetFileName(_hyp).c_str(); - TCollection_AsciiString cmd = - TCollection_AsciiString("ps ux | grep ") + aGenericName; - cmd += TCollection_AsciiString(" | grep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1"); - system( cmd.ToCString() ); + std::string cmd = "ps xo pid,args | grep " + _genericName; + //cmd += " | grep -e \"^ *[0-9]\\+ \\+" + GHS3DPlugin_Hypothesis::GetExeName() + "\""; + cmd += " | awk '{print $1}' | xargs kill -9 > /dev/null 2>&1"; + system( cmd.c_str() ); #endif } -#endif //================================================================================ /*! @@ -3900,10 +3974,8 @@ static char* getIds( char* ptr, int nbIds, vector& ids ) bool GHS3DPlugin_GHS3D::storeErrorDescription(const TCollection_AsciiString& logFile, const _Ghs2smdsConvertor & toSmdsConvertor ) { -#ifdef WITH_SMESH_CANCEL_COMPUTE if(_compute_canceled) return error(SMESH_Comment("interruption initiated by user")); -#endif // open file #ifdef WNT int file = ::_open (logFile.ToCString(), _O_RDONLY|_O_BINARY); @@ -4308,9 +4380,7 @@ bool GHS3DPlugin_GHS3D::importGMFMesh(const char* theGMFFileName, SMESH_Mesh& th std::set dummyGroupsToRemove; bool ok = readGMFFile(theGMFFileName, -#ifdef WITH_SMESH_CANCEL_COMPUTE this, -#endif helper, theMesh.GetShapeToMesh(), dummyNodeVector, dummyNodeMap, dummyElemGroup, dummyElemGroup, dummyElemGroup, dummyGroupsToRemove); theMesh.GetMeshDS()->Modified(); return ok; @@ -4368,6 +4438,33 @@ namespace /*visitAncestors=*/true); } }; + + //================================================================================ + /*! + * \brief Sub-mesh event listener removing empty groups created due to "To make + * groups of domains". + */ + struct _GroupsOfDomainsRemover : public SMESH_subMeshEventListener + { + _GroupsOfDomainsRemover(): + SMESH_subMeshEventListener( /*isDeletable = */true, + "GHS3DPlugin_GHS3D::_GroupsOfDomainsRemover" ) {} + /*! + * \brief Treat events of the subMesh + */ + void ProcessEvent(const int event, + const int eventType, + SMESH_subMesh* subMesh, + SMESH_subMeshEventListenerData* data, + const SMESH_Hypothesis* hyp) + { + if (SMESH_subMesh::ALGO_EVENT == eventType && + !subMesh->GetAlgo() ) + { + removeEmptyGroupsOfDomains( subMesh->GetFather(), /*notEmptyAsWell=*/true ); + } + } + }; } //================================================================================ @@ -4396,3 +4493,19 @@ void GHS3DPlugin_GHS3D::SubmeshRestored(SMESH_subMesh* subMesh) } } } + +//================================================================================ +/*! + * \brief Sets an event listener removing empty groups created due to "To make + * groups of domains". + * \param subMesh - submesh where algo is set + * + * This method is called when a submesh gets HYP_OK algo_state. + * After being set, event listener is notified on each event of a submesh. + */ +//================================================================================ + +void GHS3DPlugin_GHS3D::SetEventListener(SMESH_subMesh* subMesh) +{ + subMesh->SetEventListener( new _GroupsOfDomainsRemover(), 0, subMesh ); +} diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx index 285acd8..232c16e 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx @@ -64,10 +64,8 @@ public: virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); -#ifdef WITH_SMESH_CANCEL_COMPUTE - virtual void CancelCompute(); - bool computeCanceled() { return _compute_canceled;}; -#endif + virtual void CancelCompute(); + bool computeCanceled() { return _compute_canceled;}; virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, MapShapeNbElems& aResMap); @@ -77,26 +75,30 @@ public: virtual void SubmeshRestored(SMESH_subMesh* subMesh); - bool importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh); + virtual void SetEventListener(SMESH_subMesh* subMesh); + + bool importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh); + static const char* Name() { return "GHS3D_3D"; } + +protected: + const GHS3DPlugin_Hypothesis* _hyp; + const StdMeshers_ViscousLayers* _viscousLayersHyp; + std::string _genericName; + private: - bool storeErrorDescription(const TCollection_AsciiString& logFile, - const _Ghs2smdsConvertor & toSmdsConvertor ); + bool storeErrorDescription(const TCollection_AsciiString& logFile, + const _Ghs2smdsConvertor & toSmdsConvertor ); TopoDS_Shape entryToShape(std::string entry); int _iShape; int _nbShape; bool _keepFiles; - const GHS3DPlugin_Hypothesis* _hyp; - const StdMeshers_ViscousLayers* _viscousLayersHyp; SALOMEDS::Study_var myStudy; SMESH_Gen_i* smeshGen_i; -#ifdef WITH_SMESH_CANCEL_COMPUTE volatile bool _compute_canceled; -#endif - }; /*! diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index a5001ae..3ec070f 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -42,6 +42,7 @@ GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen) : SMESH_Hypothesis(hypId, studyId, gen), myToMeshHoles(DefaultMeshHoles()), + myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()), myMaximumMemory(-1), myInitialMemory(-1), myOptimizationLevel(DefaultOptimizationLevel()), @@ -97,6 +98,39 @@ bool GHS3DPlugin_Hypothesis::GetToMeshHoles(bool checkFreeOption) const return myToMeshHoles; } +//======================================================================= +//function : SetToMakeGroupsOfDomains +//======================================================================= + +void GHS3DPlugin_Hypothesis::SetToMakeGroupsOfDomains(bool toMakeGroups) +{ + if ( myToMakeGroupsOfDomains != toMakeGroups ) { + myToMakeGroupsOfDomains = toMakeGroups; + NotifySubMeshesHypothesisModification(); + } +} + +//======================================================================= +//function : GetToMakeGroupsOfDomains +//======================================================================= + +bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains() const +{ + return myToMakeGroupsOfDomains; +} + +//======================================================================= +//function : GetToMakeGroupsOfDomains +//======================================================================= + +bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothesis* hyp) +{ + bool res; + if ( hyp ) res = /*hyp->GetToMeshHoles(true) &&*/ hyp->GetToMakeGroupsOfDomains(); + else res = /*DefaultMeshHoles() &&*/ DefaultToMakeGroupsOfDomains(); + return res; +} + //======================================================================= //function : SetMaximumMemory //======================================================================= @@ -756,6 +790,15 @@ bool GHS3DPlugin_Hypothesis::DefaultMeshHoles() return false; // PAL19680 } +//======================================================================= +//function : DefaultToMakeGroupsOfDomains +//======================================================================= + +bool GHS3DPlugin_Hypothesis::DefaultToMakeGroupsOfDomains() +{ + return true; // issue 0022172 +} + //======================================================================= //function : DefaultMaximumMemory //======================================================================= @@ -922,6 +965,7 @@ std::ostream & GHS3DPlugin_Hypothesis::SaveTo(std::ostream & save) save << (int)myToUseFemCorrection << " "; save << (int)myToRemoveCentralPoint << " "; save << myGradation << " "; + save << myToMakeGroupsOfDomains << " "; if (!myTextOption.empty()) { save << "__OPTIONS_BEGIN__ "; save << myTextOption << " "; @@ -1097,6 +1141,12 @@ std::istream & GHS3DPlugin_Hypothesis::LoadFrom(std::istream & load) bool hasEnforcedMeshes = false; isOK = (load >> separator); + if ( isOK && ( separator == "0" || separator == "1" )) + { + myToMakeGroupsOfDomains = ( separator == "1" ); + isOK = (load >> separator); + } + if (isOK) { if (separator == "__OPTIONS_BEGIN__") hasOptions = true; @@ -1326,14 +1376,15 @@ bool GHS3DPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS //================================================================================ /*! - * \brief Return false + * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not */ //================================================================================ -bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& /*dflts*/, +bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* /*theMesh*/) { - return false; + myToMakeGroupsOfDomains = ( !dflts._shape || dflts._shape->IsNull() ); + return true; } //================================================================================ @@ -1345,8 +1396,7 @@ bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& /*dflts*/ std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* hyp, const bool hasShapeToMesh) { - TCollection_AsciiString cmd; - cmd = "mg-tetra.exe"; + TCollection_AsciiString cmd = GetExeName().c_str(); // check if any option is overridden by hyp->myTextOption bool m = hyp ? ( hyp->myTextOption.find("-m") == std::string::npos ) : true; bool M = hyp ? ( hyp->myTextOption.find("-M") == std::string::npos ) : true; @@ -1478,6 +1528,16 @@ std::string GHS3DPlugin_Hypothesis::GetFileName(const GHS3DPlugin_Hypothesis* hy return aGenericName.ToCString(); } +//================================================================================ +/* + * Return the name of executable + */ +//================================================================================ + +std::string GHS3DPlugin_Hypothesis::GetExeName() +{ + return "mg-tetra.exe"; +} //================================================================================ /*! diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx index 348b149..15ccbc2 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx @@ -124,6 +124,13 @@ public: */ void SetToMeshHoles(bool toMesh); bool GetToMeshHoles(bool checkFreeOption = false) const; + /*! + * To make groups of volumes of different domains when mesh is generated from skin. + * Default is to make groups. + * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true + */ + void SetToMakeGroupsOfDomains(bool toMakeGroups); + bool GetToMakeGroupsOfDomains() const; /*! * Maximal size of memory to be used by the algorithm (in Megabytes) */ @@ -216,6 +223,10 @@ public: * \brief Return a unique file name */ static std::string GetFileName(const GHS3DPlugin_Hypothesis* hyp); + /*! + * \brief Return the name of executable + */ + static std::string GetExeName(); /*! * To set an enforced vertex @@ -263,9 +274,11 @@ public: static TIDSortedElemGroupMap GetEnforcedTriangles(const GHS3DPlugin_Hypothesis* hyp); static TID2SizeMap GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp); static TSetStrings GetGroupsToRemove(const GHS3DPlugin_Hypothesis* hyp); + static bool GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothesis* hyp); void ClearGroupsToRemove(); static bool DefaultMeshHoles(); + static bool DefaultToMakeGroupsOfDomains(); static int DefaultMaximumMemory(); static int DefaultInitialMemory(); static short DefaultOptimizationLevel(); @@ -306,13 +319,14 @@ public: virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); /*! - * \brief Does nothing + * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not */ virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); private: bool myToMeshHoles; + bool myToMakeGroupsOfDomains; int myMaximumMemory; int myInitialMemory; short myOptimizationLevel; diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index 7915661..eb3eeb3 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx @@ -90,6 +90,27 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToMeshHoles() return this->GetImpl()->GetToMeshHoles(); } +//======================================================================= +//function : SetToMakeGroupsOfDomains +//======================================================================= + +void GHS3DPlugin_Hypothesis_i::SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups) +{ + ASSERT(myBaseImpl); + this->GetImpl()->SetToMakeGroupsOfDomains(toMakeGroups); + SMESH::TPythonDump() << _this() << ".SetToMakeGroupsOfDomains( " << toMakeGroups << " )"; +} + +//======================================================================= +//function : GetToMakeGroupsOfDomains +//======================================================================= + +CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToMakeGroupsOfDomains() +{ + ASSERT(myBaseImpl); + return this->GetImpl()->GetToMakeGroupsOfDomains(); +} + //======================================================================= //function : SetMaximumMemory //======================================================================= @@ -930,8 +951,8 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo MESSAGE("Required type is FACE"); break; default: - MESSAGE("Incompatible required type: " << theType); - return false; + MESSAGE("Incompatible required type: " << theType); + return false; } // MESSAGE("Required type is "<GetTypes(); @@ -959,20 +980,20 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo string enfMeshName = theName; if (enfMeshName.empty()) - enfMeshName = SObj->GetName(); + enfMeshName = SObj->GetName(); if (theMesh_i) { try { - bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName); - if (theGroupName != "") { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " - << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )"; - } - else { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " - << theSource << ".GetMesh(), " << theType << " )"; - } + bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName); + if (theGroupName != "") { + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " + << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )"; + } + else { + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " + << theSource << ".GetMesh(), " << theType << " )"; + } return res; } @@ -992,7 +1013,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo { MESSAGE("The source is a group") try { - bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); + bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); if (theGroupName != "") { SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " << theSource << ", " << theType << ", \"" << theGroupName << "\" )"; @@ -1019,7 +1040,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo { MESSAGE("The source is a group on geom") try { - bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); + bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); if (theGroupName != "") { SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " << theSource << ", " << theType << ", \"" << theGroupName << "\" )"; diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx index 4ac8b6f..81c12dd 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx @@ -55,6 +55,13 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i: */ void SetToMeshHoles(CORBA::Boolean toMesh); CORBA::Boolean GetToMeshHoles(); + /*! + * To make groups of volumes of different domains when mesh is generated from skin. + * Default is to make groups. + * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true + */ + void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups); + CORBA::Boolean GetToMakeGroupsOfDomains(); /*! * Maximal size of memory to be used by the algorithm (in Megabytes) */ diff --git a/src/GHS3DPlugin/Makefile.am b/src/GHS3DPlugin/Makefile.am index 4af27ab..0103d4e 100644 --- a/src/GHS3DPlugin/Makefile.am +++ b/src/GHS3DPlugin/Makefile.am @@ -47,7 +47,6 @@ libGHS3DEngine_la_CPPFLAGS = \ $(KERNEL_CXXFLAGS) \ $(CAS_CPPFLAGS) \ $(GEOM_CXXFLAGS) \ - $(MED_CXXFLAGS) \ $(SMESH_CXXFLAGS) \ $(VTK_INCLUDES) \ $(BOOST_CPPFLAGS) \ @@ -58,7 +57,6 @@ libGHS3DEngine_la_CPPFLAGS = \ libGHS3DEngine_la_LDFLAGS = \ ../../idl/libSalomeIDLGHS3DPLUGIN.la \ $(CAS_KERNEL) -lTKBRep -lTKG2d -lTKG3d -lTKTopAlgo -lTKGeomBase -lTKGeomAlgo -lTKCDF \ - $(MED_LDFLAGS) -lSalomeIDLMED \ $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lSMESHDS -lSMDS -lStdMeshers -lMeshDriverGMF \ $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace -lSALOMEBasics -lSalomeNS -lOpUtil diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index 78cb1fa..25d7101 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -21,13 +21,11 @@ // File : GHS3DPluginGUI_HypothesisCreator.cxx // Author : Michael Zorin // Module : GHS3DPlugin -// $Header: // #include "GHS3DPluginGUI_HypothesisCreator.h" -// #include "GHS3DPluginGUI_EnforcedDelegates.h" #include "GHS3DPluginGUI_Enums.h" -#include "GeometryGUI.h" +#include #include #include @@ -294,7 +292,7 @@ QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent, void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { - QItemDelegate::setEditorData(editor, index); + QItemDelegate::setEditorData(editor, index); } void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, @@ -392,7 +390,9 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame() } myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup ); - aStdLayout->addWidget( myToMeshHolesCheck, row++, 0, 1, 2 ); + aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 ); + myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup ); + aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 ); aStdLayout->addWidget( new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup ), row, 0, 1, 1 ); myOptimizationLevelCombo = new QComboBox( myStdGroup ); @@ -645,6 +645,7 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame() tab->setCurrentIndex( STD_TAB ); // connections + //connect( myToMeshHolesCheck, SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool))); connect( myMaximumMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) ); connect( myInitialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) ); connect( myBoundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) ); @@ -1384,6 +1385,13 @@ void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() myEnforcedTableWidget->selectionModel()->clearSelection(); } +void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn) +{ + // myToMakeGroupsOfDomains->setEnabled( isOn ); + // if ( !isOn ) + // myToMakeGroupsOfDomains->setChecked( false ); +} + void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked() { QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myWorkingDir->text(), QString() ); @@ -1393,6 +1401,7 @@ void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked() void GHS3DPluginGUI_HypothesisCreator::updateWidgets() { + //myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() ); myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() ); myInitialMemoryCheck->setEnabled( !myBoundaryRecoveryCheck->isChecked() ); myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !myBoundaryRecoveryCheck->isChecked() ); @@ -1424,6 +1433,7 @@ void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const myName->setText( data.myName ); myToMeshHolesCheck ->setChecked ( data.myToMeshHoles ); + myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains ); myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel ); myMaximumMemoryCheck ->setChecked ( data.myMaximumMemory > 0 ); myMaximumMemorySpin ->setValue ( qMax( data.myMaximumMemory, @@ -1668,6 +1678,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& h_data.myName = isCreation() && data ? hypName() : ""; h_data.myToMeshHoles = h->GetToMeshHoles(); + h_data.myToMakeGroupsOfDomains = /*h->GetToMeshHoles() &&*/ h->GetToMakeGroupsOfDomains(); h_data.myMaximumMemory = h->GetMaximumMemory(); h_data.myInitialMemory = h->GetInitialMemory(); h_data.myInitialMemory = h->GetInitialMemory(); @@ -1741,6 +1752,8 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD if ( h->GetToMeshHoles() != h_data.myToMeshHoles ) // avoid duplication of DumpPython commands h->SetToMeshHoles ( h_data.myToMeshHoles ); + if ( h->GetToMakeGroupsOfDomains() != h_data.myToMakeGroupsOfDomains ) + h->SetToMakeGroupsOfDomains( h_data.myToMakeGroupsOfDomains ); if ( h->GetMaximumMemory() != h_data.myMaximumMemory ) h->SetMaximumMemory ( h_data.myMaximumMemory ); if ( h->GetInitialMemory() != h_data.myInitialMemory ) @@ -1854,6 +1867,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets"); h_data.myName = myName ? myName->text() : ""; h_data.myToMeshHoles = myToMeshHolesCheck->isChecked(); + h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked(); h_data.myMaximumMemory = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1; h_data.myInitialMemory = myInitialMemoryCheck->isChecked() ? myInitialMemorySpin->value() : -1; h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex(); diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.h b/src/GUI/GHS3DPluginGUI_HypothesisCreator.h index 44641a5..a9830d9 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.h +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.h @@ -140,7 +140,7 @@ typedef std::set< TEnfMesh*, CompareEnfMeshes > TEnfMeshList; typedef struct { - bool myToMeshHoles,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint; + bool myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint; int myMaximumMemory,myInitialMemory,myOptimizationLevel; QString myName,myWorkingDir,myTextOption; double myGradation; @@ -173,6 +173,7 @@ protected: virtual QString type() const; protected slots: + void onToMeshHoles(bool); void onDirBtnClicked(); void updateWidgets(); @@ -209,6 +210,7 @@ private: QWidget* myStdGroup; QLineEdit* myName; QCheckBox* myToMeshHolesCheck; + QCheckBox* myToMakeGroupsOfDomains; QComboBox* myOptimizationLevelCombo; QWidget* myAdvGroup; diff --git a/src/GUI/GHS3DPlugin_msg_en.ts b/src/GUI/GHS3DPlugin_msg_en.ts index 9c8884b..b77bcb3 100644 --- a/src/GUI/GHS3DPlugin_msg_en.ts +++ b/src/GUI/GHS3DPlugin_msg_en.ts @@ -31,6 +31,10 @@ GHS3D_TO_MESH_HOLES To mesh holes + + GHS3D_TO_MAKE_DOMAIN_GROUPS + To make groups of domains + INIT_MEMORY_SIZE Initial memory size diff --git a/src/GUI/GHS3DPlugin_msg_fr.ts b/src/GUI/GHS3DPlugin_msg_fr.ts index 922e2cc..c2291bd 100755 --- a/src/GUI/GHS3DPlugin_msg_fr.ts +++ b/src/GUI/GHS3DPlugin_msg_fr.ts @@ -3,6 +3,10 @@ @default + + GHS3D_TO_MAKE_DOMAIN_GROUPS + To make groups of domains + GHS3D_ADV_ARGS Avancé diff --git a/src/GUI/GHS3DPlugin_msg_ja.ts b/src/GUI/GHS3DPlugin_msg_ja.ts new file mode 100644 index 0000000..659e85f --- /dev/null +++ b/src/GUI/GHS3DPlugin_msg_ja.ts @@ -0,0 +1,211 @@ + + + + + @default + + GHS3D_ADV_ARGS + 高度な + + + GHS3D_HYPOTHESIS + GHS3D + + + GHS3D_OPTIMIZATIOL_LEVEL + 最適化のレベル + + + GHS3D_PERMISSION_DENIED + 作業ディレクトリが書き込み可能ではないです。 + + + GHS3D_STD_ARGS + パラメーター + + + GHS3D_TITLE + 仮説構築 + + + GHS3D_TO_MESH_HOLES + メッシュに穴します。 + + + INIT_MEMORY_SIZE + 初期メモリのサイズ + + + KEEP_WORKING_FILES + 作業ファイルを維持するには + + + LEVEL_NONE + なし + + + LEVEL_LIGHT + 光 + + + LEVEL_MEDIUM + 中 (標準) + + + LEVEL_STANDARDPLUS + 標準的です + + + + LEVEL_STRONG + 強力な + + + MAX_MEMORY_SIZE + 最大メモリ サイズ + + + MEGABYTE + メガバイト + + + NO_INITIAL_CENTRAL_POINT + 初期の中心点を削除するには + + + RECOVERY_VERSION + 境界の回復のバージョンを使用するには + + + FEM_CORRECTION + 有限要素法による補正を使用するには + + + GHS3D_GRADATION + Volumic グラデーション + + + SELECT_DIR + ... + + + TEXT_OPTION + オプション テキストとして + + + TO_ADD_NODES + 新しいノードを作成するには + + + VERBOSE_LEVEL + 詳細レベル + + + WORKING_DIR + 作業ディレクトリ + + + GHS3D_ENFORCED_VERTICES + 適用された頂点 + + + GHS3D_ENFORCED_MESHES + 強制メッシュ + + + GHS3D_ENF_NAME_COLUMN + 名前 + + + GHS3D_ENF_VER_X_COLUMN + X + + + GHS3D_ENF_VER_Y_COLUMN + Y + + + GHS3D_ENF_VER_Z_COLUMN + Z + + + GHS3D_ENF_SIZE_COLUMN + サイズ + + + GHS3D_ENF_ENTRY_COLUMN + 頂点のエントリ + + + GHS3D_ENF_MESH_CONSTRAINT_COLUMN + 制約 + + + GHS3D_ENF_VER_COMPOUND_COLUMN + 化合物 + + + GHS3D_ENF_GROUP_COLUMN + グループ + + + GHS3D_ENF_SELECT_VERTEX + 頂点を選択します + + + GHS3D_ENF_SELECT_MESH + メッシュを選択します。 + + + GHS3D_ENF_VER_X_LABEL + X: + + + GHS3D_ENF_VER_Y_LABEL + Y: + + + GHS3D_ENF_VER_Z_LABEL + Z: + + + GHS3D_ENF_MESH_CONSTRAINT_LABEL + 制約: + + + GHS3D_ENF_MESH_CONSTRAINT_NODE + ノード + + + GHS3D_ENF_MESH_CONSTRAINT_EDGE + エッジ + + + GHS3D_ENF_MESH_CONSTRAINT_FACE + 直面しています。 + + + GHS3D_ENF_SIZE_LABEL + サイズ: + + + GHS3D_ENF_GROUP_LABEL + グループ: + + + GHS3D_ENF_ADD + 追加 + + + GHS3D_ENF_REMOVE + 削除 + + + GHS3D_ENF_VER_INFO + <b>警告</b>: 強制頂点は現在関連付けられているジオメトリ w/o メッシュののみ考慮します。 + + + GHS3D_ENF_MESH_INFO + <b>警告</b>: 現在適用されたメッシュはメッシュ関連付けられたジオメトリなしののみ考慮します。 + + + diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am index 5d912bb..6d70baa 100644 --- a/src/GUI/Makefile.am +++ b/src/GUI/Makefile.am @@ -49,7 +49,6 @@ libGHS3DPluginGUI_la_CPPFLAGS = \ $(KERNEL_CXXFLAGS) \ $(GUI_CXXFLAGS) \ $(GEOM_CXXFLAGS) \ - $(MED_CXXFLAGS) \ $(SMESH_CXXFLAGS) \ $(BOOST_CPPFLAGS) \ $(CORBA_CXXFLAGS) \ @@ -61,7 +60,6 @@ libGHS3DPluginGUI_la_LDFLAGS = \ ../../idl/libSalomeIDLGHS3DPLUGIN.la \ $(QT_LIBS) \ $(KERNEL_LDFLAGS) -lSALOMELocalTrace \ - $(MED_LDFLAGS) -lSalomeIDLMED \ $(GEOM_LDFLAGS) -lGEOM \ $(SMESH_LDFLAGS) -lSMESH -lGeomSelectionTools -lStdMeshersGUI -lSMESHFiltersSelection \ $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp \ @@ -71,4 +69,5 @@ libGHS3DPluginGUI_la_LDFLAGS = \ nodist_salomeres_DATA= \ GHS3DPlugin_images.qm \ GHS3DPlugin_msg_en.qm \ - GHS3DPlugin_msg_fr.qm + GHS3DPlugin_msg_fr.qm \ + GHS3DPlugin_msg_ja.qm