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