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
2 changes: 1 addition & 1 deletion Examples/Cantilever/Demo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
sys.path.append(dirName + r'/../..')

# Import der Bibliotheken
from RFEM.enums import NodalSupportType, StaticAnalysisType, LoadDirectionType
from RFEM.enums import NodalSupportType, LoadDirectionType
from RFEM.initModel import Model, Calculate_all
from RFEM.BasicObjects.material import Material
from RFEM.BasicObjects.section import Section
Expand Down
45 changes: 24 additions & 21 deletions Examples/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def main(hall_width_L, hall_height_h_o, hall_height_h_m, number_frames, frame_sp
# -------------------------------------------------------------
# Members

member = Member()
# Frames
i = 1
while i <= number_frames:
Expand All @@ -147,19 +148,19 @@ def main(hall_width_L, hall_height_h_o, hall_height_h_m, number_frames, frame_sp
j = 4*number_frames + 3*(number_frames-1)
while i <= number_frames-1:
k = j + (i-1)*4
Member.Tension(0,k+1, (i-1)*5+1, (i-1)*5+7 , MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
Member.Tension(0,k+2, (i-1)*5+2, (i-1)*5+6 , MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
Member.Tension(0,k+3, (i-1)*5+5, (i-1)*5+9 , MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
Member.Tension(0,k+4, (i-1)*5+4, (i-1)*5+10, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(k+1, (i-1)*5+1, (i-1)*5+7 , MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(k+2, (i-1)*5+2, (i-1)*5+6 , MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(k+3, (i-1)*5+5, (i-1)*5+9 , MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(k+4, (i-1)*5+4, (i-1)*5+10, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
i += 1

# Diagonals on the roof
j += 4*(number_frames-1)
if number_frames > 1:
Member.Tension(0,j+1, 2, 8, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
Member.Tension(0,j+2, 7, 3, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
Member.Tension(0,j+3, 3, 9, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
Member.Tension(0,j+4, 4, 8, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(j+1, 2, 8, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(j+2, 7, 3, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(j+3, 3, 9, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)
member.Tension(j+4, 4, 8, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 4)

# -------------------------------------------------------------
# Surfaces
Expand Down Expand Up @@ -234,43 +235,45 @@ def main(hall_width_L, hall_height_h_o, hall_height_h_m, number_frames, frame_sp

# -------------------------------------------------------------
# Member Loads
MemberLoad.Force(0, 2, 1, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_UNIFORM, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[5000])
memberLoad = MemberLoad()

memberLoad.Force(2, 1, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_UNIFORM, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[5000])

## Force Type Member Load with LOAD_DISTRIBUTION_UNIFORM with Eccentricity ##
MemberLoad.Force(0, 3, 2, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_UNIFORM, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[5000], force_eccentricity=True, params={'eccentricity_y_at_start' : 0.01, 'eccentricity_z_at_start': 0.02})
memberLoad.Force(3, 2, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_UNIFORM, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[5000], force_eccentricity=True, params={'eccentricity_y_at_start' : 0.01, 'eccentricity_z_at_start': 0.02})

## Force Type Member Load with LOAD_DISTRIBUTION_UNIFORM_TOTAL ##
MemberLoad.Force(0, 4, 3, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_UNIFORM_TOTAL, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[5000])
memberLoad.Force(4, 3, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_UNIFORM_TOTAL, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[5000])

## Force Type Member Load with LOAD_DISTRIBUTION_CONCENTRATED_1 ##
MemberLoad.Force(0, 5, 4, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_1, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, 5000, 1.2])
memberLoad.Force(5, 4, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_1, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, 5000, 1.2])

## Force Type Member Load with LOAD_DISTRIBUTION_CONCENTRATED_N ##
MemberLoad.Force(0, 6, 5, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_N, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 5000, 2, 1, 2])
memberLoad.Force(6, 5, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_N, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 5000, 2, 1, 2])

## Force Type Member Load with LOAD_DISTRIBUTION_CONCENTRATED_2x2 ##
MemberLoad.Force(0, 7, 6, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_2x2, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, False, 5000, 1, 2, 3])
memberLoad.Force(7, 6, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_2x2, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, False, 5000, 1, 2, 3])

## Force Type Member Load with LOAD_DISTRIBUTION_CONCENTRATED_2x ##
MemberLoad.Force(0, 8, 7, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_2, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 5000, 6000, 1, 2])
memberLoad.Force(8, 7, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_2, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 5000, 6000, 1, 2])

## Force Type Member Load with LOAD_DISTRIBUTION_CONCENTRATED_VARYING ##
MemberLoad.Force(0, 9, 8, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_VARYING, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[[1, 1, 4000], [2, 1, 5000]])
memberLoad.Force(9, 8, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_CONCENTRATED_VARYING, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[[1, 1, 4000], [2, 1, 5000]])

## Force Type Member Load with LOAD_DISTRIBUTION_TRAPEZOIDAL ##
MemberLoad.Force(0, 10, 9, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_TRAPEZOIDAL, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 4000, 8000, 1, 2])
memberLoad.Force(10, 9, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_TRAPEZOIDAL, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 4000, 8000, 1, 2])

## Force Type Member Load with LOAD_DISTRIBUTION_TAPERED ##
MemberLoad.Force(0, 11, 10, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_TAPERED, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 4000, 8000, 1, 2])
memberLoad.Force(11, 10, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_TAPERED, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[False, False, 4000, 8000, 1, 2])

## Force Type Member Load with LOAD_DISTRIBUTION_PARABOLIC ##
MemberLoad.Force(0, 12, 11, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_PARABOLIC, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[4000, 8000, 12000])
memberLoad.Force(12, 11, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_PARABOLIC, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[4000, 8000, 12000])

## Force Type Member Load with LOAD_DISTRIBUTION_VARYING ##
MemberLoad.Force(0, 13, 12, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_VARYING, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[[1, 1, 4000], [2, 1, 5000]])
memberLoad.Force(13, 12, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_VARYING, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[[1, 1, 4000], [2, 1, 5000]])

## Force Type Member Load with LOAD_DISTRIBUTION_VARYING_IN_Z ##
MemberLoad.Force(0, 14, 13, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_VARYING_IN_Z, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[[1, 1, 4000], [2, 1, 5000]])
memberLoad.Force(14, 13, "2 3 6 7", MemberLoadDistribution.LOAD_DISTRIBUTION_VARYING_IN_Z, MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_parameter=[[1, 1, 4000], [2, 1, 5000]])

# -------------------------------------------------------------
# Surface Loads
Expand Down
170 changes: 170 additions & 0 deletions RFEM/Calculate/meshSettings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
from RFEM.initModel import Model, CheckAddonStatus, SetAddonStatus, clearAtributes

class MeshSettings():
ComonMeshConfig: dict = {
'general_target_length_of_fe': None,
'general_maximum_distance_between_node_and_line': None,
'general_maximum_number_of_mesh_nodes': None,
'members_number_of_divisions_for_special_types': None,
'members_activate_division_for_large_deformation_and_post_critical_analysis': None,
'members_number_of_divisions_for_result_diagram': None,
'members_number_of_divisions_for_min_max_values': None,
'members_use_division_for_concrete_members': None,
'members_number_of_divisions_for_concrete_members': None,
'members_use_division_for_straight_members': None,
'members_division_for_straight_members_type': None,
'members_length_of_fe': None,
'members_minimum_number_of_divisions': None,
'members_use_division_for_members_with_nodes': None,
'surfaces_maximum_ratio_of_fe': None,
'surfaces_maximum_out_of_plane_inclination': None,
'surfaces_mesh_refinement': None,
'surfaces_relationship': None,
'surfaces_integrate_also_unutilized_objects': None,
'surfaces_shape_of_finite_elements': None,
'surfaces_same_squares': None,
'surfaces_triangles_for_membranes': None,
'surfaces_mapped_mesh_preferred': None,
'solids_use_refinement_if_containing_close_nodes': None,
'solids_maximum_number_of_elements': None}
SurfacesMeshQualityConfig: dict = {
'mesh_quality_color_indicator_ok_color': None,
'mesh_quality_color_indicator_warning_color': None,
'mesh_quality_color_indicator_failure_color': None,
'QualityCriteriaConfig': {
'quality_criterion_check_aspect_ratio': None,
'quality_criterion_check_aspect_ratio_warning': None,
'quality_criterion_check_aspect_ratio_failure': None,
'quality_criterion_parallel_deviations': None,
'quality_criterion_parallel_deviations_warning': None,
'quality_criterion_parallel_deviations_failure': None,
'quality_criterion_corner_angles_of_triangle_elements': None,
'quality_criterion_corner_angles_of_triangle_elements_warning': None,
'quality_criterion_corner_angles_of_triangle_elements_failure': None,
'quality_criterion_corner_angles_of_quadrangle_elements': None,
'quality_criterion_corner_angles_of_quadrangle_elements_warning': None,
'quality_criterion_corner_angles_of_quadrangle_elements_failure': None,
'quality_criterion_warping_of_membrane_elements': None,
'quality_criterion_warping_of_membrane_elements_warning': None,
'quality_criterion_warping_of_membrane_elements_failure': None,
'quality_criterion_warping_of_non_membrane_elements': None,
'quality_criterion_warping_of_non_membrane_elements_warning': None,
'quality_criterion_warping_of_non_membrane_elements_failure': None,
'quality_criterion_jacobian_ratio': None,
'quality_criterion_jacobian_ratio_warning': None,
'quality_criterion_jacobian_ratio_failure': None}}
SolidsMeshQualityConfig: dict = {
'mesh_quality_color_indicator_ok_color': None,
'mesh_quality_color_indicator_warning_color': None,
'mesh_quality_color_indicator_failure_color': None,
'QualityCriteriaConfig': {
'quality_criterion_check_aspect_ratio': None,
'quality_criterion_check_aspect_ratio_warning': None,
'quality_criterion_check_aspect_ratio_failure': None,
'quality_criterion_parallel_deviations': None,
'quality_criterion_parallel_deviations_warning': None,
'quality_criterion_parallel_deviations_failure': None,
'quality_criterion_corner_angles_of_triangle_elements': None,
'quality_criterion_corner_angles_of_triangle_elements_warning': None,
'quality_criterion_corner_angles_of_triangle_elements_failure': None,
'quality_criterion_corner_angles_of_quadrangle_elements': None,
'quality_criterion_corner_angles_of_quadrangle_elements_warning': None,
'quality_criterion_corner_angles_of_quadrangle_elements_failure': None,
'quality_criterion_warping': None,
'quality_criterion_warping_warning': None,
'quality_criterion_warping_failure': None,
'quality_criterion_jacobian_ratio': None,
'quality_criterion_jacobian_ratio_warning': None,
'quality_criterion_jacobian_ratio_failure': None}}
WindSimulationMeshConfig: dict = {
'windsimulation_mesh_config_value_simplify_model': None,
'windsimulation_mesh_config_value_determine_details_by': None,
'windsimulation_mesh_config_value_level_of_details': None,
'windsimulation_mesh_config_value_detail_size': None,
'windsimulation_mesh_config_value_small_openings_closure_type': None,
'windsimulation_mesh_config_value_small_openings_closure_value': None,
'windsimulation_mesh_config_value_optimized_member_topology': None,
'windsimulation_mesh_config_value_optimized_member_topo_value': None,
'windsimulation_mesh_config_value_active_objects_only': None,
'windsimulation_mesh_config_value_terrain': None,
'windsimulation_mesh_config_value_terrain_from_model': None,
'windsimulation_mesh_config_value_terrain_objects_id': None,
'windsimulation_mesh_config_value_terrain_objects_all': None,
'windsimulation_mesh_config_value_surrounding_model': None,
'windsimulation_mesh_config_value_surrounding_model_ifc_objects_id': None,
'windsimulation_mesh_config_value_surrounding_model_ifc_objects_all': None,
'windsimulation_mesh_config_value_surrounding_model_visual_objects_id': None,
'windsimulation_mesh_config_value_surrounding_model_visual_objects_all': None,
'windsimulation_mesh_config_value_keep_results_if_mesh_deleted': None,
'windsimulation_mesh_config_value_consider_surface_thickness': None,
'windsimulation_mesh_config_value_run_rwind_silent': None}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better explain users, which configuration has controlled by which data type(integer, string, boolean or enumeration item).

There are two possible ways:

  • Add default RFEM values instead of 'None'.
  • Add DocStrings to explain configurations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I can not add default values. I have to differ which parameters are set and which are not. This class is just prototype to show user, which parameters can be set. Frankly, I'm not able to describe them more eloquently than the name of the parameter itself :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adding type of parameters in DocStrings can help us to document this. That looks like my duty 👍🏻

def __init__(self,
commonConfig: dict = ComonMeshConfig,
surfaceConfig: dict = SurfacesMeshQualityConfig,
solidConfig: dict = SolidsMeshQualityConfig,
windConfig: dict = WindSimulationMeshConfig):
"""
The object is automaticaly created therefore we can assume that it will not be created but only updated.
Only posititve values are recognized.

Args:
commonConfig: common parameters settings
surfaceConfig: surface specific parameters
solidConfig: solid specific parameters
windConfig: wind specific parameters; use only when Wind Simulation Add-on is active
"""
# Get current mesh settings
config = Model.clientModel.service.get_mesh_settings()

clientObject = {}
for i in config:
if i[0] == 'windSimulationMeshConfig':
if CheckAddonStatus(Model.clientModel, 'wind_simulation_active'):
clientObject[i[0]] = config[i[0]]
else:
clientObject[i[0]] = config[i[0]]

# No parameter can be set to None
for key in commonConfig:
if commonConfig[key]:
clientObject[key] = commonConfig[key]
for key in surfaceConfig:
if key == 'QualityCriteriaConfig':
for key_ in surfaceConfig['QualityCriteriaConfig']:
if surfaceConfig['QualityCriteriaConfig'][key_]:
clientObject['SurfacesMeshQualityConfig']['QualityCriteriaConfig'][key_] = surfaceConfig['QualityCriteriaConfig'][key_]
elif surfaceConfig[key]:
clientObject['SurfacesMeshQualityConfig'][key] = surfaceConfig[key]
for key in solidConfig:
if key == 'QualityCriteriaConfig':
for key_ in solidConfig['QualityCriteriaConfig']:
if solidConfig['QualityCriteriaConfig'][key_]:
clientObject['SolidsMeshQualityConfig']['QualityCriteriaConfig'][key_] = solidConfig['QualityCriteriaConfig'][key_]
elif solidConfig[key]:
clientObject['SolidsMeshQualityConfig'][key] = solidConfig[key]
if CheckAddonStatus(Model.clientModel, 'wind_simulation_active'):
for key in windConfig:
if windConfig[key]:
clientObject['windSimulationMeshConfig'][key] = windConfig[key]

# Add Mesh Settings to client model
Model.clientModel.service.set_mesh_settings(clientObject)

def get_mesh_settings(self):
return Model.clientModel.service.get_mesh_settings()

def set_mesh_settings(self, all_settings):
new_sett = {}

for i in all_settings:
if i[0] == 'windSimulationMeshConfig':
if CheckAddonStatus(Model.clientModel, 'wind_simulation_active'):
new_sett['wind_simulation_active'] = all_settings['wind_simulation_active']
else:
new_sett[i[0]] = all_settings[i[0]]

Model.clientModel.service.set_mesh_settings(new_sett)

def get_model_info(self):
return Model.clientModel.service.get_model_info()
Loading