1+ import pyMagix3D as Mgx3D
2+ import pytest
3+ import lima
4+
5+ def test_beta_shrinkage_law (capfd ):
6+ ctx = Mgx3D .getStdContext ()
7+ gm = ctx .getGeomManager ()
8+ tm = ctx .getTopoManager ()
9+ mm = ctx .getMeshManager ()
10+ # Création d'une boite avec une topologie
11+ ctx .getTopoManager ().newBoxWithTopo (Mgx3D .Point (0 , 0 , 0 ), Mgx3D .Point (1 , 1 , 1 ), 10 , 10 , 10 )
12+
13+ with pytest .raises (RuntimeError ) as excinfo :
14+ # Changement de discrétisation pour les arêtes Ar0011
15+ emp = Mgx3D .EdgeMeshingPropertyBeta (10 ,1.02 )
16+ ctx .getTopoManager ().setMeshingProperty (emp , ["Ar0011" ])
17+ expected = "la valeur de beta doit être comprise entre 1 et 1.01"
18+ assert expected in str (excinfo .value )
19+
20+ with pytest .raises (RuntimeError ) as excinfo :
21+ # Changement de discrétisation pour les arêtes Ar0011
22+ emp = Mgx3D .EdgeMeshingPropertyBeta (10 ,1.000005 )
23+ ctx .getTopoManager ().setMeshingProperty (emp , ["Ar0011" ])
24+ expected = "la valeur de beta doit être comprise entre 1 et 1.01"
25+ assert expected in str (excinfo .value )
26+
27+ emp = Mgx3D .EdgeMeshingPropertyBeta (10 ,1.01 )
28+ ctx .getTopoManager ().setMeshingProperty (emp , ["Ar0011" ])
29+
30+ # Création du maillage pour tous les blocs
31+ ctx .getMeshManager ().newAllBlocksMesh ()
0 commit comments