|
6 | 6 | ) |
7 | 7 | sys.path.append(PROJECT_ROOT) |
8 | 8 |
|
9 | | -from RFEM.initModel import Model |
| 9 | +from RFEM.initModel import Model, Calculate_all |
| 10 | +from RFEM.enums import * |
| 11 | +from RFEM.dataTypes import inf |
10 | 12 | from RFEM.BasicObjects.material import Material |
11 | 13 | from RFEM.BasicObjects.thickness import Thickness |
| 14 | +from RFEM.BasicObjects.section import Section |
12 | 15 | from RFEM.BasicObjects.node import Node |
13 | 16 | from RFEM.BasicObjects.line import Line |
14 | 17 | from RFEM.BasicObjects.surface import Surface |
15 | | -from RFEM.BasicObjects.section import Section |
16 | 18 | from RFEM.BasicObjects.member import Member |
| 19 | +from RFEM.TypesForNodes.nodalSupport import NodalSupport |
| 20 | +from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings |
| 21 | +from RFEM.LoadCasesAndCombinations.loadCase import LoadCase |
| 22 | +from RFEM.LoadCasesAndCombinations.designSituation import DesignSituation |
| 23 | +from RFEM.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations |
| 24 | +from RFEM.LoadCasesAndCombinations.loadCombination import LoadCombination |
| 25 | +from RFEM.Loads.nodalLoad import NodalLoad |
17 | 26 | from RFEM.Results.meshTables import MeshTables |
18 | 27 |
|
19 | 28 | if Model.clientModel is None: |
@@ -53,17 +62,47 @@ def test_mesh_tables(): |
53 | 62 | allFeNodes = MeshTables.GetAllFENodes() |
54 | 63 | assert allFeNodes[4]['y'] == 20 |
55 | 64 |
|
56 | | - customNode = MeshTables.getFENodeOriginalMesh(8) |
| 65 | + customNode = MeshTables.GetFENodeOriginalMesh(8) |
57 | 66 | assert customNode['y'] == 1.5 |
58 | 67 |
|
59 | | - all1DElements = MeshTables.getAllFE1DElements() |
| 68 | + all1DElements = MeshTables.GetAllFE1DElements() |
60 | 69 | assert all1DElements[12]['FE_node1_no'] == 454 |
61 | 70 |
|
62 | | - all2DElemets = MeshTables.getAllFE2DElements() |
| 71 | + all2DElemets = MeshTables.GetAllFE2DElements() |
63 | 72 | assert all2DElemets[5]['surface_no'] == 1 |
64 | 73 |
|
65 | | - custom1DElement = MeshTables.getFE1DElement(5) |
| 74 | + custom1DElement = MeshTables.GetFE1DElement(5) |
66 | 75 | assert custom1DElement['FE_node2_no'] == 447 |
67 | 76 |
|
68 | | - custom2DElement = MeshTables.getFE2DElement(18) |
| 77 | + custom2DElement = MeshTables.GetFE2DElement(18) |
69 | 78 | assert custom2DElement['FE_node3_no'] == 37 |
| 79 | + |
| 80 | +def test_deformed_mesh(): |
| 81 | + |
| 82 | + Model.clientModel.service.delete_all() |
| 83 | + Model.clientModel.service.begin_modification() |
| 84 | + |
| 85 | + Material(1) |
| 86 | + Section(1) |
| 87 | + |
| 88 | + Node(1, 0.0, 0.0, 0.0) |
| 89 | + Node(2, 5, 0.0, 0.0) |
| 90 | + |
| 91 | + Member(1, 1, 2, 0.0, 1, 1) |
| 92 | + |
| 93 | + NodalSupport(1, '1', NodalSupportType.HINGED) |
| 94 | + NodalSupport(2, '2', [0, inf, inf, inf, 0, inf]) |
| 95 | + LoadCasesAndCombinations() |
| 96 | + LoadCase.StaticAnalysis(1, 'Self-Weight',analysis_settings_no=1,action_category= ActionCategoryType.ACTION_CATEGORY_PERMANENT_G,self_weight=[True, 0.0, 0.0, 1.0]) |
| 97 | + DesignSituation(1, DesignSituationType.DESIGN_SITUATION_TYPE_EQU_PERMANENT_AND_TRANSIENT, True) |
| 98 | + StaticAnalysisSettings.GeometricallyLinear(1, "Linear") |
| 99 | + LoadCombination(1, combination_items=[[1,1,0,False]]) |
| 100 | + LoadCombination(2, combination_items=[[1.5,1,0,False]]) |
| 101 | + NodalLoad(1, 1, '2', NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 1000) |
| 102 | + Model.clientModel.service.finish_modification() |
| 103 | + |
| 104 | + Calculate_all() |
| 105 | + |
| 106 | + assert Model.clientModel.service.has_any_results() |
| 107 | + assert MeshTables.GetAllFENodesDeformed(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 2) |
| 108 | + assert MeshTables.GetFENodeDeformed() |
0 commit comments