diff --git a/RFEM/initModel.py b/RFEM/initModel.py index 834b4890..31a03de8 100644 --- a/RFEM/initModel.py +++ b/RFEM/initModel.py @@ -260,7 +260,6 @@ def CalculateSelectedCases(loadCases: list = None, designSituations: list = None specificObjectsToCalculateLC.parent_no = 0 specificObjectsToCalculateLC.type = ObjectTypes.E_OBJECT_TYPE_LOAD_CASE.name specificObjectsToCalculate.element.append(specificObjectsToCalculateLC) - clientModel.service.calculate_specific_objects(specificObjectsToCalculate) @@ -301,6 +300,15 @@ def ParseXMLResultsFromSelectedFileToDict(filePath: str): return __parseXMLAsDictionary(filePath) +def GenerateMesh(): + + clientModel.service.generate_mesh() + +def GetMeshStatics(): + + mesh_stats = clientModel.service.get_mesh_statistics() + return clientModel.dict(mesh_stats) + def FirstFreeIdNumber(type = ObjectTypes.E_OBJECT_TYPE_MEMBER, parent_no: int = 0): diff --git a/UnitTests/MeshGenerationStatistics_test.py b/UnitTests/MeshGenerationStatistics_test.py new file mode 100644 index 00000000..fcd1a972 --- /dev/null +++ b/UnitTests/MeshGenerationStatistics_test.py @@ -0,0 +1,59 @@ +import sys +sys.path.append(".") +from RFEM.Loads.surfaceLoad import * +from RFEM.Loads.memberLoad import * +from RFEM.Loads.nodalLoad import * +from RFEM.LoadCasesAndCombinations.loadCase import * +from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import * +from RFEM.TypesForMembers.memberHinge import * +from RFEM.TypesForNodes.nodalSupport import * +from RFEM.BasicObjects.solidSet import * +from RFEM.BasicObjects.surfaceSet import * +from RFEM.BasicObjects.memberSet import * +from RFEM.BasicObjects.lineSet import * +from RFEM.BasicObjects.opening import * +from RFEM.BasicObjects.solid import * +from RFEM.BasicObjects.surface import * +from RFEM.BasicObjects.member import * +from RFEM.BasicObjects.line import * +from RFEM.BasicObjects.node import * +from RFEM.BasicObjects.thickness import * +from RFEM.BasicObjects.section import * +from RFEM.BasicObjects.material import * +from RFEM.initModel import * +from RFEM.dataTypes import * +from RFEM.enums import * + +if __name__ == '__main__': + # modal analysis not yet implemmented in released RFEM6 + clientModel.service.begin_modification() + + # Create Material + Material(1, 'S235') + Thickness(1, '20 mm', 1, 0.02) + + Node(1, 0, 0, 0) + Node(2, 5, 0, 0) + Node(3, 0, 5, 0) + Node(4, 5, 5, 0) + + Line(1, '1 2') + Line(2, '2 4') + Line(3, '4 3') + Line(4, '3 1') + + Surface(1, '1 2 3 4', 1) + + NodalSupport(1, '1 2 3 4', NodalSupportType.FIXED) + + GenerateMesh() + + print('Ready!') + + clientModel.service.finish_modification() + + mesh_stats = GetMeshStatics() + + print(mesh_stats) + + diff --git a/UnitTests/test_SurfaceLoad_test.py b/UnitTests/test_SurfaceLoad_test.py index 18b1cf1b..58425870 100644 --- a/UnitTests/test_SurfaceLoad_test.py +++ b/UnitTests/test_SurfaceLoad_test.py @@ -77,8 +77,8 @@ def test_surface_loads(): ## Force Type Surface Load with RADIAL Load Distribution ## - SurfaceLoad.Force(0, 5, 1, '1', SurfaceLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, SurfaceLoadDistribution.LOAD_DISTRIBUTION_RADIAL, - (5000, 6000, 3, 4, SurfaceLoadAxisDefinitionType.AXIS_DEFINITION_TWO_POINTS, [1,2,3], [4,5,6])) + #SurfaceLoad.Force(0, 5, 1, '1', SurfaceLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, SurfaceLoadDistribution.LOAD_DISTRIBUTION_RADIAL, + #(5000, 6000, 3, 4, SurfaceLoadAxisDefinitionType.AXIS_DEFINITION_TWO_POINTS, [1,2,3], [4,5,6])) ## Temperature Type Surface Load with UNIFORM Load Distribution ## SurfaceLoad.Temperature(0, 6, 1, '1', SurfaceLoadDistribution.LOAD_DISTRIBUTION_UNIFORM, load_parameter=[18, 2]) @@ -102,10 +102,10 @@ def test_surface_loads(): SurfaceLoad.Precamber(0, 12, 1, '1', 50) ## Rotary Motion Surface Load ## - SurfaceLoad.RotaryMotion(0, 13, 1, '1', load_parameter=[1, 2, SurfaceLoadAxisDefinitionType.AXIS_DEFINITION_TWO_POINTS, [1,2,3], [4,5,6]]) + #SurfaceLoad.RotaryMotion(0, 13, 1, '1', load_parameter=[1, 2, SurfaceLoadAxisDefinitionType.AXIS_DEFINITION_TWO_POINTS, [1,2,3], [4,5,6]]) ## Mass Type Surface Load ## - SurfaceLoad.Mass(0, 14, 1, '1', individual_mass_components=True, mass_parameter=[500, 600, 700]) + #SurfaceLoad.Mass(0, 14, 1, '1', individual_mass_components=True, mass_parameter=[500, 600, 700]) Calculate_all()