From f5d7d05b75bfc4929980962223a22b6731cdb9ea Mon Sep 17 00:00:00 2001 From: Christophe Bourcier local Date: Wed, 12 Nov 2014 17:13:34 +0100 Subject: [PATCH] - Disable PreCAD when using basic periodicity API - Use the new algo name MG_CADSurf --- doc/salome/examples/test_periodicity.py | 4 ++++ doc/salome/examples/test_periodicity_reflexion_advanced.py | 4 ++++ doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc | 2 ++ src/BLSURFPlugin/BLSURFPluginBuilder.py | 2 +- tests/test_enforced_internal_vertex.py | 2 +- tests/test_enforced_vertex.py | 2 +- tests/test_periodicity.py | 6 +++++- tests/test_periodicity_2D.py | 6 +++++- tests/test_periodicity_2D_precad.py | 2 +- tests/test_periodicity_precad.py | 2 +- tests/test_periodicity_reflexion.py | 6 +++++- tests/test_periodicity_reflexion_2D.py | 6 +++++- tests/test_periodicity_reflexion_2D_precad.py | 2 +- tests/test_periodicity_reflexion_precad.py | 2 +- tests/test_periodicity_with_points_2D_precad.py | 2 +- tests/test_precad_intersections.py | 2 +- tests/test_precad_keep_gaps.py | 2 +- tests/test_sphere.py | 2 +- 18 files changed, 41 insertions(+), 15 deletions(-) diff --git a/doc/salome/examples/test_periodicity.py b/doc/salome/examples/test_periodicity.py index 8694c38..5893c1a 100644 --- a/doc/salome/examples/test_periodicity.py +++ b/doc/salome/examples/test_periodicity.py @@ -94,6 +94,8 @@ import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +from salome.BLSURFPlugin import BLSURFPluginBuilder + Mesh = smesh.Mesh(part, "Mesh") algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) @@ -101,6 +103,8 @@ algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' ) +# Deactivate PreCAD +algo2d.SetTopology(BLSURFPluginBuilder.FromCAD) def proj_x(shape1): shape2 = geompy.MakeTranslation(shape1, 100, 0., 0) diff --git a/doc/salome/examples/test_periodicity_reflexion_advanced.py b/doc/salome/examples/test_periodicity_reflexion_advanced.py index d9bab10..91b79b5 100644 --- a/doc/salome/examples/test_periodicity_reflexion_advanced.py +++ b/doc/salome/examples/test_periodicity_reflexion_advanced.py @@ -80,6 +80,8 @@ import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +from salome.BLSURFPlugin import BLSURFPluginBuilder + Mesh = smesh.Mesh(part, "Mesh") algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) @@ -87,6 +89,8 @@ algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' ) +# Deactivate PreCAD +algo2d.SetTopology(BLSURFPluginBuilder.FromCAD) def rota_z(shape1): shape2 = geompy.MakeRotation(shape1, axe, -math.pi/2) diff --git a/doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc b/doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc index f614d91..474b5bd 100644 --- a/doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc +++ b/doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc @@ -367,6 +367,8 @@ This is useful for instance for a Representative Volume Element so that the tran In GUI, periodicity association uses PreCAD (optional MG-CADSurf add-on). Be sure to have a PreCAD license to be able to use it. Otherwise, use \ref periodicity_tui_basic_api_usage "the basic API in TUI" or the \ref periodicity_tui_advanced_api_usage "the advanced API in TUI". +Remark: to use the basic API to define periodicity, you have to disable PreCAD. + \image html blsurf_periodicity_translation.png "Two periodic faces (translation)" \image html blsurf_periodicity_reflexion.png "Two periodic faces (reflexion)" diff --git a/src/BLSURFPlugin/BLSURFPluginBuilder.py b/src/BLSURFPlugin/BLSURFPluginBuilder.py index 06adba9..9c4af75 100644 --- a/src/BLSURFPlugin/BLSURFPluginBuilder.py +++ b/src/BLSURFPlugin/BLSURFPluginBuilder.py @@ -162,7 +162,7 @@ class BLSURF_Algorithm(Mesh_Algorithm): #
  • PreProcess or PreProcessPlus - by pre-processing a CAD model (OBSOLETE: FromCAD will be used)
  • #
  • PreCAD - by pre-processing with PreCAD a CAD model
  • def SetTopology(self, way): - if way != PreCAD: + if way != PreCAD and way != FromCAD: print "Warning: topology mode %d is no longer supported. Mode FromCAD is used."%way way = FromCAD self.Parameters().SetTopology(way) diff --git a/tests/test_enforced_internal_vertex.py b/tests/test_enforced_internal_vertex.py index c7f3661..85dc59c 100644 --- a/tests/test_enforced_internal_vertex.py +++ b/tests/test_enforced_internal_vertex.py @@ -35,7 +35,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) diff --git a/tests/test_enforced_vertex.py b/tests/test_enforced_vertex.py index f22b392..5004bf6 100644 --- a/tests/test_enforced_vertex.py +++ b/tests/test_enforced_vertex.py @@ -32,7 +32,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh = smesh.Mesh(box, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) diff --git a/tests/test_periodicity.py b/tests/test_periodicity.py index 5fb0085..2828322 100644 --- a/tests/test_periodicity.py +++ b/tests/test_periodicity.py @@ -94,13 +94,17 @@ import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +from salome.BLSURFPlugin import BLSURFPluginBuilder + Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' ) +# Deactivate PreCAD +algo2d.SetTopology(BLSURFPluginBuilder.FromCAD) def proj_x(shape1): shape2 = geompy.MakeTranslation(shape1, 100, 0., 0) diff --git a/tests/test_periodicity_2D.py b/tests/test_periodicity_2D.py index 13c7fcd..d5a07bc 100644 --- a/tests/test_periodicity_2D.py +++ b/tests/test_periodicity_2D.py @@ -56,9 +56,11 @@ import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +from salome.BLSURFPlugin import BLSURFPluginBuilder + Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetVerbosity(10) #algo2d.SetTopology(smesh.PreCAD) algo2d.SetGeometricMesh( 1 ) @@ -66,6 +68,8 @@ algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) #algo2d.SetGradation(1.05) algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' ) +# Deactivate PreCAD +algo2d.SetTopology(BLSURFPluginBuilder.FromCAD) # Periodicity diff --git a/tests/test_periodicity_2D_precad.py b/tests/test_periodicity_2D_precad.py index 9382171..027c4f3 100644 --- a/tests/test_periodicity_2D_precad.py +++ b/tests/test_periodicity_2D_precad.py @@ -65,7 +65,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) diff --git a/tests/test_periodicity_precad.py b/tests/test_periodicity_precad.py index 8a10dda..bbbfaa2 100644 --- a/tests/test_periodicity_precad.py +++ b/tests/test_periodicity_precad.py @@ -94,7 +94,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) diff --git a/tests/test_periodicity_reflexion.py b/tests/test_periodicity_reflexion.py index 2ff31ad..91b79b5 100644 --- a/tests/test_periodicity_reflexion.py +++ b/tests/test_periodicity_reflexion.py @@ -80,13 +80,17 @@ import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +from salome.BLSURFPlugin import BLSURFPluginBuilder + Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' ) +# Deactivate PreCAD +algo2d.SetTopology(BLSURFPluginBuilder.FromCAD) def rota_z(shape1): shape2 = geompy.MakeRotation(shape1, axe, -math.pi/2) diff --git a/tests/test_periodicity_reflexion_2D.py b/tests/test_periodicity_reflexion_2D.py index 8bc95c8..7f9f639 100644 --- a/tests/test_periodicity_reflexion_2D.py +++ b/tests/test_periodicity_reflexion_2D.py @@ -56,9 +56,11 @@ import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +from salome.BLSURFPlugin import BLSURFPluginBuilder + Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetVerbosity(1) #algo2d.SetTopology(smesh.PreCAD) algo2d.SetGeometricMesh( 1 ) @@ -66,6 +68,8 @@ algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) #algo2d.SetGradation(1.05) algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' ) +# Deactivate PreCAD +algo2d.SetTopology(BLSURFPluginBuilder.FromCAD) # Periodicity diff --git a/tests/test_periodicity_reflexion_2D_precad.py b/tests/test_periodicity_reflexion_2D_precad.py index 5eed201..8c0393f 100644 --- a/tests/test_periodicity_reflexion_2D_precad.py +++ b/tests/test_periodicity_reflexion_2D_precad.py @@ -78,7 +78,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) diff --git a/tests/test_periodicity_reflexion_precad.py b/tests/test_periodicity_reflexion_precad.py index efaee7c..f11a4df 100644 --- a/tests/test_periodicity_reflexion_precad.py +++ b/tests/test_periodicity_reflexion_precad.py @@ -81,7 +81,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) diff --git a/tests/test_periodicity_with_points_2D_precad.py b/tests/test_periodicity_with_points_2D_precad.py index 5322376..f303d63 100644 --- a/tests/test_periodicity_with_points_2D_precad.py +++ b/tests/test_periodicity_with_points_2D_precad.py @@ -77,7 +77,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh = smesh.Mesh(part, "Mesh") -algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF) +algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d.SetGeometricMesh( 1 ) algo2d.SetAngleMesh( 4 ) algo2d.SetPhySize( 8 ) diff --git a/tests/test_precad_intersections.py b/tests/test_precad_intersections.py index 1736d1d..c4e991b 100644 --- a/tests/test_precad_intersections.py +++ b/tests/test_precad_intersections.py @@ -44,7 +44,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh_1 = smesh.Mesh(Partition_1) -BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.BLSURF) +BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf) BLSURF_Parameters = BLSURF_1.Parameters() BLSURF_Parameters.SetPhySize( 5 ) BLSURF_Parameters.SetPreCADMergeEdges( True ) diff --git a/tests/test_precad_keep_gaps.py b/tests/test_precad_keep_gaps.py index 1809f63..b23102c 100644 --- a/tests/test_precad_keep_gaps.py +++ b/tests/test_precad_keep_gaps.py @@ -44,7 +44,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh_1 = smesh.Mesh(Partition_1) -BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.BLSURF) +BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf) BLSURF_Parameters = BLSURF_1.Parameters() BLSURF_Parameters.SetPhySize( 5 ) diff --git a/tests/test_sphere.py b/tests/test_sphere.py index 4070292..2f52eb1 100644 --- a/tests/test_sphere.py +++ b/tests/test_sphere.py @@ -31,7 +31,7 @@ smesh = smeshBuilder.New(salome.myStudy) Mesh_1 = smesh.Mesh(sphere) -BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.BLSURF) +BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf) BLSURF_Parameters = BLSURF_1.Parameters() BLSURF_Parameters.SetPhySize( 5 ) BLSURF_Parameters.SetGeometricMesh( 1 ) -- 2.39.2