Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion RFEM/initModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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):

Expand Down
59 changes: 59 additions & 0 deletions UnitTests/MeshGenerationStatistics_test.py
Original file line number Diff line number Diff line change
@@ -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)


8 changes: 4 additions & 4 deletions UnitTests/test_SurfaceLoad_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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()
Expand Down