├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── DesignSPHysics.FCMacro ├── LICENSE ├── README.md ├── default-config.json ├── default-materials.json ├── images ├── clock.png ├── down_arrow.png ├── file_mov.png ├── flowtool_template.jpg ├── focused_wave.png ├── icon.svg ├── irregular_wave.png ├── left-arrow.png ├── load.png ├── logo.png ├── movement.png ├── new.png ├── regular_wave.png ├── run.png ├── run_gencase.png ├── save.png ├── trash.png └── up_arrow.png ├── mod ├── __init__.py ├── appmode.py ├── constants.py ├── dataobjects │ ├── __init__.py │ ├── acceleration_input │ │ ├── acceleration_input.py │ │ └── acceleration_input_data.py │ ├── bathymetry_form_data.py │ ├── case.py │ ├── case_information.py │ ├── chrono │ │ ├── chrono_collision_dp.py │ │ ├── chrono_config.py │ │ ├── chrono_csv_intervals.py │ │ ├── chrono_link_coulomb_damping.py │ │ ├── chrono_link_hinge.py │ │ ├── chrono_link_linear_spring.py │ │ ├── chrono_link_point_line.py │ │ ├── chrono_link_pulley.py │ │ ├── chrono_link_spheric.py │ │ ├── chrono_object.py │ │ └── chrono_scale_scheme.py │ ├── configuration │ │ ├── application_settings.py │ │ ├── constants.py │ │ ├── domain_fixed_parameter.py │ │ ├── executable_paths.py │ │ ├── execution_parameters.py │ │ ├── periodicity.py │ │ ├── periodicity_info.py │ │ ├── post_processing_settings.py │ │ ├── sd_position_property.py │ │ └── simulation_domain.py │ ├── damping.py │ ├── flow_tool_xml_box.py │ ├── gauges │ │ ├── flow_gauge.py │ │ ├── force_gauge.py │ │ ├── gauge_base.py │ │ ├── gauges_data.py │ │ ├── max_z_gauge.py │ │ ├── mesh_gauge.py │ │ ├── swl_gauge.py │ │ └── velocity_gauge.py │ ├── inletoutlet │ │ ├── __init__.py │ │ ├── inlet_outlet_config.py │ │ ├── inlet_outlet_density_info.py │ │ ├── inlet_outlet_elevation_info.py │ │ ├── inlet_outlet_velocity_info.py │ │ ├── inlet_outlet_zone.py │ │ ├── inlet_outlet_zone_box_generator.py │ │ ├── inlet_outlet_zone_circle_generator.py │ │ ├── inlet_outlet_zone_direction.py │ │ ├── inlet_outlet_zone_info.py │ │ ├── inlet_outlet_zone_line_generator.py │ │ ├── inlet_outlet_zone_mk_generator.py │ │ ├── inlet_outlet_zone_rotation.py │ │ └── velocities │ │ │ ├── jet_circle.py │ │ │ ├── linear_velocity.py │ │ │ ├── parabolic_velocity.py │ │ │ └── velocity_mesh_data.py │ ├── moorings │ │ ├── __init__.py │ │ ├── moordynplus │ │ │ ├── __init__.py │ │ │ ├── moordynplus_body.py │ │ │ ├── moordynplus_configuration.py │ │ │ ├── moordynplus_connect.py │ │ │ ├── moordynplus_connect_connection.py │ │ │ ├── moordynplus_fix_connection.py │ │ │ ├── moordynplus_line.py │ │ │ ├── moordynplus_line_default_configuration.py │ │ │ ├── moordynplus_output_configuration.py │ │ │ ├── moordynplus_solver_options.py │ │ │ └── moordynplus_vessel_connection.py │ │ ├── moorings_configuration.py │ │ └── moorings_save_options.py │ ├── motion │ │ ├── __init__.py │ │ ├── acc_cir_motion.py │ │ ├── acc_rect_motion.py │ │ ├── acc_rot_motion.py │ │ ├── awas.py │ │ ├── awas_correction.py │ │ ├── base_motion.py │ │ ├── cir_sinu_motion.py │ │ ├── file_gen.py │ │ ├── focused_piston_wave_gen.py │ │ ├── irregular_flap_wave_gen.py │ │ ├── irregular_piston_wave_gen.py │ │ ├── movement.py │ │ ├── path_file_gen.py │ │ ├── rect_motion.py │ │ ├── rect_sinu_motion.py │ │ ├── regular_flap_wave_gen.py │ │ ├── regular_piston_wave_gen.py │ │ ├── rot_motion.py │ │ ├── rot_sinu_motion.py │ │ ├── rotate_adv_file_gen.py │ │ ├── rotation_file_gen.py │ │ ├── solitary_piston_wave_gen.py │ │ ├── special_movement.py │ │ ├── wait_motion.py │ │ └── wave_gen.py │ ├── outparts_filter │ │ └── filters.py │ ├── properties │ │ ├── bound_normals_property.py │ │ ├── faces_property.py │ │ ├── flexstruct.py │ │ ├── float_property.py │ │ ├── initials_property.py │ │ ├── material_property.py │ │ ├── mk_based_properties.py │ │ ├── ml_piston │ │ │ ├── ml_piston.py │ │ │ ├── ml_piston_1d.py │ │ │ ├── ml_piston_2d.py │ │ │ └── ml_piston_2d_veldata.py │ │ ├── property.py │ │ └── simulation_object.py │ ├── relaxation_zone │ │ ├── relaxation_zone.py │ │ ├── relaxation_zone_file.py │ │ ├── relaxation_zone_irregular.py │ │ ├── relaxation_zone_regular.py │ │ └── relaxation_zone_uniform.py │ └── variable_res │ │ ├── bufferbox.py │ │ └── variable_res_config.py ├── enums.py ├── functions.py ├── lang │ ├── afrikaans.json │ ├── chinese-simplified.json │ ├── chinese-traditional.json │ ├── croatian.json │ ├── czech.json │ ├── dutch.json │ ├── english.json │ ├── finnish.json │ ├── french.json │ ├── german.json │ ├── hungarian.json │ ├── italian.json │ ├── japanese.json │ ├── korean.json │ ├── norwegian.json │ ├── polish.json │ ├── portuguese-brazilian.json │ ├── portuguese.json │ ├── romanian.json │ ├── russian.json │ ├── slovak.json │ ├── slovenian.json │ ├── spanish.json │ ├── swedish.json │ ├── turkish.json │ └── ukrainian.json ├── main.py ├── templates │ ├── case_summary_template.html │ ├── feature_support_report.html │ ├── flowtool │ │ ├── base.xml │ │ └── each.xml │ ├── gencase │ │ ├── accinput │ │ │ ├── base.xml │ │ │ └── each.xml │ │ ├── base.xml │ │ ├── chrono │ │ │ ├── base.xml │ │ │ ├── collisiondp_active.xml │ │ │ ├── collisiondp_inactive.xml │ │ │ ├── links │ │ │ │ ├── coulombdamping │ │ │ │ │ └── base.xml │ │ │ │ ├── hinge │ │ │ │ │ └── base.xml │ │ │ │ ├── linearspring │ │ │ │ │ └── base.xml │ │ │ │ ├── pointline │ │ │ │ │ └── base.xml │ │ │ │ ├── pulley │ │ │ │ │ └── base.xml │ │ │ │ └── spheric │ │ │ │ │ ├── base.xml │ │ │ │ │ └── idbody2.xml │ │ │ ├── objects │ │ │ │ ├── base.xml │ │ │ │ └── modelnormal_template.xml │ │ │ ├── savedata.xml │ │ │ └── schemescale.xml │ │ ├── damping │ │ │ ├── base.xml │ │ │ ├── box_each.xml │ │ │ ├── cylinder_each.xml │ │ │ └── zone_each.xml │ │ ├── definition.xml │ │ ├── flexstruct │ │ │ ├── base.xml │ │ │ └── each.xml │ │ ├── floatings │ │ │ ├── base.xml │ │ │ └── each │ │ │ │ ├── angularvelini.xml │ │ │ │ ├── base.xml │ │ │ │ ├── center.xml │ │ │ │ ├── inertia.xml │ │ │ │ ├── linearvelini.xml │ │ │ │ ├── massbody_prop.xml │ │ │ │ ├── material.xml │ │ │ │ ├── rhopbody_attr.xml │ │ │ │ ├── rotation.xml │ │ │ │ └── translation.xml │ │ ├── gauges │ │ │ ├── base.xml │ │ │ ├── common.xml │ │ │ ├── flow.xml │ │ │ ├── force.xml │ │ │ ├── maxz.xml │ │ │ ├── mesh.xml │ │ │ ├── swl.xml │ │ │ └── velocity.xml │ │ ├── initials │ │ │ ├── base.xml │ │ │ ├── linear.xml │ │ │ ├── parabolic.xml │ │ │ └── uniform.xml │ │ ├── inout │ │ │ ├── base.xml │ │ │ ├── each_zone.xml │ │ │ ├── imposevelocity │ │ │ │ ├── file_interpolated.xml │ │ │ │ ├── file_linear.xml │ │ │ │ ├── file_meshdata.xml │ │ │ │ ├── file_parabolic.xml │ │ │ │ ├── file_uniform.xml │ │ │ │ ├── fixed_constant.xml │ │ │ │ ├── fixed_jetcircle.xml │ │ │ │ ├── fixed_linear.xml │ │ │ │ ├── fixed_parabolic.xml │ │ │ │ ├── variable_linear.xml │ │ │ │ ├── variable_linear_each.xml │ │ │ │ ├── variable_parabolic.xml │ │ │ │ ├── variable_parabolic_each.xml │ │ │ │ ├── variable_uniform.xml │ │ │ │ └── variable_uniform_each.xml │ │ │ ├── useboxlimit │ │ │ │ ├── withfreecentre.xml │ │ │ │ └── withoutfreecentre.xml │ │ │ ├── zoneinfo │ │ │ │ ├── generator_2d_rotation.xml │ │ │ │ ├── generator_3d_rotation.xml │ │ │ │ ├── generator_box.xml │ │ │ │ ├── generator_circle.xml │ │ │ │ ├── generator_line.xml │ │ │ │ ├── generator_line_rotation.xml │ │ │ │ ├── generator_mk.xml │ │ │ │ ├── rotateadv.xml │ │ │ │ ├── zone2d.xml │ │ │ │ └── zone3d.xml │ │ │ └── zsurf │ │ │ │ ├── base.xml │ │ │ │ ├── zsurf_automatic.xml │ │ │ │ ├── zsurf_file.xml │ │ │ │ ├── zsurf_fixed.xml │ │ │ │ ├── zsurf_meshdata.xml │ │ │ │ ├── zsurf_timelist.xml │ │ │ │ └── zsurf_timelist_timevalue_each.xml │ │ ├── materials │ │ │ ├── base.xml │ │ │ └── property.xml │ │ ├── mdbc │ │ │ ├── boundnormal_cylinder.xml │ │ │ ├── boundnormal_parts.xml │ │ │ ├── boundnormal_plane.xml │ │ │ ├── boundnormal_plane_point.xml │ │ │ ├── boundnormal_plane_point_auto.xml │ │ │ ├── boundnormal_set.xml │ │ │ ├── boundnormal_sphere.xml │ │ │ ├── geometry_for_normals_base.xml │ │ │ ├── mdbc_runlist.xml │ │ │ ├── normals_base.xml │ │ │ └── normals_geometry.xml │ │ ├── mlpistons │ │ │ ├── base.xml │ │ │ ├── each_1d.xml │ │ │ ├── each_2d.xml │ │ │ └── each_veldata.xml │ │ ├── moorings │ │ │ ├── base.xml │ │ │ ├── moordynplus │ │ │ │ ├── body │ │ │ │ │ ├── compact.xml │ │ │ │ │ └── extended.xml │ │ │ │ ├── line │ │ │ │ │ ├── ba.xml │ │ │ │ │ ├── base.xml │ │ │ │ │ ├── diameter.xml │ │ │ │ │ ├── ea.xml │ │ │ │ │ ├── fix_connection.xml │ │ │ │ │ ├── massdeninair.xml │ │ │ │ │ └── vessel_connection.xml │ │ │ │ ├── moordynplus_embedded.xml │ │ │ │ └── moordynplus_file.xml │ │ │ └── moored_floatings.xml │ │ ├── motion │ │ │ ├── base.xml │ │ │ └── each │ │ │ │ ├── base.xml │ │ │ │ ├── movements_list.xml │ │ │ │ ├── next_attr.txt │ │ │ │ ├── normal │ │ │ │ ├── acc_rectilinear.xml │ │ │ │ ├── acc_rotational.xml │ │ │ │ ├── circular.xml │ │ │ │ ├── rectilinear.xml │ │ │ │ ├── rotational.xml │ │ │ │ ├── sinu_circular.xml │ │ │ │ ├── sinu_rectilinear.xml │ │ │ │ ├── sinu_rotational.xml │ │ │ │ └── wait.xml │ │ │ │ ├── null.xml │ │ │ │ └── special │ │ │ │ ├── file_gen.xml │ │ │ │ ├── file_path_gen.xml │ │ │ │ ├── file_rotate_adv_gen.xml │ │ │ │ └── file_rotational_gen.xml │ │ ├── objects │ │ │ ├── base.xml │ │ │ └── each │ │ │ │ ├── complex.xml │ │ │ │ ├── cube.xml │ │ │ │ ├── cylinder.xml │ │ │ │ ├── fillbox.xml │ │ │ │ ├── frdrawmode_disable.xml │ │ │ │ ├── frdrawmode_enable.xml │ │ │ │ ├── matrixreset.xml │ │ │ │ ├── mkbound.xml │ │ │ │ ├── mkfluid.xml │ │ │ │ ├── move.xml │ │ │ │ ├── rotation.xml │ │ │ │ ├── setnormalinvert.xml │ │ │ │ └── sphere.xml │ │ ├── outfilters │ │ │ ├── base.xml │ │ │ ├── filtercylinder.xml │ │ │ ├── filtergroup.xml │ │ │ ├── filtermk.xml │ │ │ ├── filterplane.xml │ │ │ ├── filterpos.xml │ │ │ ├── filtersphere.xml │ │ │ ├── filtertype.xml │ │ │ └── ftfollow.xml │ │ ├── parameters.xml │ │ ├── periodicity │ │ │ ├── x_inc_y.xml │ │ │ ├── x_inc_z.xml │ │ │ ├── y_inc_x.xml │ │ │ ├── y_inc_z.xml │ │ │ ├── z_inc_x.xml │ │ │ └── z_inc_y.xml │ │ ├── properties │ │ │ ├── base.xml │ │ │ └── each_link.xml │ │ ├── rzones │ │ │ ├── base.xml │ │ │ ├── file.xml │ │ │ ├── irregular.xml │ │ │ ├── regular.xml │ │ │ ├── uniform.xml │ │ │ ├── uniform_velocity.xml │ │ │ ├── uniform_velocitytimes.xml │ │ │ └── uniform_velocitytimes_each.xml │ │ ├── simulationdomain.xml │ │ ├── vres │ │ │ ├── base.xml │ │ │ ├── each.xml │ │ │ ├── simulation_domain.xml │ │ │ ├── simulation_domain_pos.xml │ │ │ ├── tracking.xml │ │ │ └── transform.xml │ │ └── wavepaddles │ │ │ ├── awas.xml │ │ │ ├── awas_correction.xml │ │ │ ├── base.xml │ │ │ ├── flap │ │ │ ├── irregular.xml │ │ │ └── regular.xml │ │ │ └── piston │ │ │ ├── focused.xml │ │ │ ├── irregular.xml │ │ │ ├── regular.xml │ │ │ └── solitary.xml │ └── scripts │ │ ├── linux │ │ ├── common.sh │ │ ├── computeforces.sh │ │ ├── floatinginfo.sh │ │ ├── flowtool.sh │ │ ├── gencase.sh │ │ ├── isosurface.sh │ │ ├── measuretool.sh │ │ ├── partvtk.sh │ │ ├── simulate.sh │ │ └── simulate_vres.sh │ │ └── windows │ │ ├── common.bat │ │ ├── computeforces.bat │ │ ├── floatinginfo.bat │ │ ├── flowtool.bat │ │ ├── gencase.bat │ │ ├── isosurface.bat │ │ ├── measuretool.bat │ │ ├── partvtk.bat │ │ ├── simulate.bat │ │ └── simulate_vres.bat ├── tools │ ├── dialog_tools.py │ ├── executable_tools.py │ ├── file_tools.py │ ├── freecad_tools.py │ ├── gui_tools.py │ ├── main_loop_tools.py │ ├── numvalidator_tools.py │ ├── pickle_tool.py │ ├── post_processing_tools.py │ ├── script_tools.py │ ├── stdout_tools.py │ ├── template_tools.py │ └── translation_tools.py ├── widgets │ ├── __init__.py │ ├── custom_widgets │ │ ├── __init__.py │ │ ├── acceleration_input.py │ │ ├── base_units_input.py │ │ ├── density_input.py │ │ ├── error_report_dialog.py │ │ ├── focusable_combo_box.py │ │ ├── information_dialog.py │ │ ├── int_value_input.py │ │ ├── mk_select_input_with_names.py │ │ ├── pressure_input.py │ │ ├── size_input.py │ │ ├── time_input.py │ │ ├── unit_spin_box.py │ │ ├── value_input.py │ │ └── velocity_input.py │ ├── designsphysics_dock.py │ ├── dock │ │ ├── __init__.py │ │ ├── dock_configuration_widget.py │ │ ├── dock_dp_widget.py │ │ ├── dock_logo_widget.py │ │ ├── dock_object_list_table_widget.py │ │ ├── dock_post_processing_widget.py │ │ ├── dock_pre_processing_widget.py │ │ ├── dock_simulation_widget.py │ │ ├── dock_widgets │ │ │ ├── __init__.py │ │ │ ├── add_bathymetry_dialog.py │ │ │ ├── add_geo_dialog.py │ │ │ ├── case_summary.py │ │ │ ├── constants_dialog.py │ │ │ ├── execution_parameters_dialog.py │ │ │ ├── feature_support_dialog.py │ │ │ ├── gencase_completed_dialog.py │ │ │ ├── mode_2d_config_dialog.py │ │ │ ├── object_order_widget.py │ │ │ ├── run_additional_parameters_dialog.py │ │ │ ├── run_dialog.py │ │ │ ├── setup_plugin_dialog.py │ │ │ ├── simulation_domain_widget.py │ │ │ └── surface_stl_dialog.py │ │ ├── postprocessing │ │ │ ├── __init__.py │ │ │ ├── computeforces_dialog.py │ │ │ ├── export_progress_dialog.py │ │ │ ├── floatinginfo_dialog.py │ │ │ ├── flowtool_dialog.py │ │ │ ├── flowtool_xml_box_dialog.py │ │ │ ├── isosurface_dialog.py │ │ │ ├── measuretool_dialog.py │ │ │ ├── measuretool_grid_dialog.py │ │ │ ├── measuretool_points_dialog.py │ │ │ ├── mk_helper_widget.py │ │ │ └── partvtk_dialog.py │ │ └── special_widgets │ │ │ ├── __init__.py │ │ │ ├── acceleration_input_dialog.py │ │ │ ├── chrono │ │ │ ├── __init__.py │ │ │ ├── chrono_config_dialog.py │ │ │ ├── chrono_object_check_options.py │ │ │ ├── link_coulombdamping_edit.py │ │ │ ├── link_hinge_edit.py │ │ │ ├── link_linear_spring_edit.py │ │ │ ├── link_point_line_edit.py │ │ │ ├── link_pulley_edit.py │ │ │ └── link_spheric_edit.py │ │ │ ├── damping │ │ │ ├── __init__.py │ │ │ ├── damping_box_config_dialog.py │ │ │ ├── damping_config_dialog.py │ │ │ ├── damping_cylinder_dialog.py │ │ │ └── damping_zone_config_dialog.py │ │ │ ├── flex_struct_dialog.py │ │ │ ├── gauges │ │ │ ├── __init__.py │ │ │ ├── base_gauge_dialog.py │ │ │ ├── defaults_gauge_dialog.py │ │ │ ├── flow_gauge_dialog.py │ │ │ ├── force_gauge_dialog.py │ │ │ ├── gauges_list_dialog.py │ │ │ ├── max_z_gauge_dialog.py │ │ │ ├── mesh_gauge_dialog.py │ │ │ ├── swl_gauge_dialog.py │ │ │ └── velocity_gauge_dialog.py │ │ │ ├── inout │ │ │ ├── __init__.py │ │ │ ├── inlet_config_dialog.py │ │ │ ├── inlet_zone_edit.py │ │ │ ├── velocity_widgets.py │ │ │ ├── zone_generator_widgets │ │ │ │ ├── __init__.py │ │ │ │ ├── box_zone_generator_widget.py │ │ │ │ ├── circle_zone_generator_widget.py │ │ │ │ ├── line_zone_generator_widget.py │ │ │ │ ├── mk_zone_generator_widget.py │ │ │ │ ├── zone_2d_direction_widget.py │ │ │ │ ├── zone_2d_rotation_widget.py │ │ │ │ ├── zone_3d_direction_widget.py │ │ │ │ └── zone_3d_rotation_widget.py │ │ │ └── zsurf_widgets.py │ │ │ ├── ml_piston_1d_config_dialog.py │ │ │ ├── ml_piston_2d_config_dialog.py │ │ │ ├── moorings │ │ │ ├── __init__.py │ │ │ ├── moordynplus_body_configuration_dialog.py │ │ │ ├── moordynplus_line_configuration_dialog.py │ │ │ ├── moordynplus_parameters_dialog.py │ │ │ └── moorings_configuration_dialog.py │ │ │ ├── outfilters │ │ │ ├── __init__.py │ │ │ ├── base_dialog.py │ │ │ ├── cylinder_filter_dialog.py │ │ │ ├── group_filter_dialog.py │ │ │ ├── mk_filter_dialog.py │ │ │ ├── outparts_dialog.py │ │ │ ├── plane_filter_dialog.py │ │ │ ├── pos_filter_dialog.py │ │ │ ├── sphere_filter_dialog.py │ │ │ └── type_filter_dialog.py │ │ │ ├── relaxation_zone │ │ │ ├── __init__.py │ │ │ ├── relaxation_zone_file_config_dialog.py │ │ │ ├── relaxation_zone_irregular_config_dialog.py │ │ │ ├── relaxation_zone_regular_config_dialog.py │ │ │ ├── relaxation_zone_uniform_config_dialog.py │ │ │ └── velocity_times_dialog.py │ │ │ ├── special_options_selector_dialog.py │ │ │ └── variable_res │ │ │ ├── __init__.py │ │ │ ├── bufferbox_edit_dialog.py │ │ │ └── variable_res_config_dialog.py │ ├── properties_dock_widget.py │ └── properties_widgets │ │ ├── __init__.py │ │ ├── bound_normals_dialog.py │ │ ├── faces_dialog.py │ │ ├── float_state_dialog.py │ │ ├── initials_dialog.py │ │ ├── material_dialog.py │ │ ├── mdbc_dialog.py │ │ ├── motion │ │ ├── __init__.py │ │ ├── acc_circular_motion_timeline.py │ │ ├── acc_rectilinear_motion_timeline.py │ │ ├── acc_rotational_motion_timeline.py │ │ ├── adv_rotation_file_motion_timeline.py │ │ ├── cir_sinu_motion_timeline.py │ │ ├── file_motion_timeline.py │ │ ├── focused_piston_wave_motion_timeline.py │ │ ├── irregular_flap_wave_motion_timeline.py │ │ ├── irregular_piston_wave_motion_timeline.py │ │ ├── motion_timeline.py │ │ ├── movement_actions.py │ │ ├── movement_dialog.py │ │ ├── movement_timeline_placeholder.py │ │ ├── path_file_motion_timeline.py │ │ ├── rect_sinu_motion_timeline.py │ │ ├── rectilinear_motion_timeline.py │ │ ├── regular_flap_wave_motion_timeline.py │ │ ├── regular_piston_wave_motion_timeline.py │ │ ├── rot_sinu_motion_timeline.py │ │ ├── rotation_file_motion_timeline.py │ │ ├── rotational_motion_timeline.py │ │ ├── solitary_piston_wave_motion_timeline.py │ │ ├── wait_motion_timeline.py │ │ └── wave_movement_actions.py │ │ └── sim_object_dialog.py └── xml │ ├── __init__.py │ ├── importer.py │ ├── renderers │ ├── __init__.py │ ├── accinput_renderer.py │ ├── chrono_renderer.py │ ├── damping_renderer.py │ ├── definition_renderer.py │ ├── flexstruct_renderer.py │ ├── floatings_renderer.py │ ├── gauges_renderer.py │ ├── initials_renderer.py │ ├── inout_renderer.py │ ├── mdbc_renderer.py │ ├── mlpistons_renderer.py │ ├── moorings_renderer.py │ ├── motion_renderer.py │ ├── objects_renderer.py │ ├── outfilters_renderer.py │ ├── parameters_renderer.py │ ├── periodicity_renderer.py │ ├── properties_renderer.py │ ├── rzones_renderer.py │ ├── simulationdomain_renderer.py │ ├── vres_renderer.py │ └── wavepaddles_renderer.py │ ├── xml_exporter.py │ └── xmltodict.py ├── package.xml └── setup.sh /DesignSPHysics.FCMacro: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | 4 | """ This file acts as a bootstrapper to load DesignSPHysics from the 5 | "Mod" folder of the FreeCAD install directory. 6 | """ 7 | 8 | import sys 9 | import os 10 | 11 | """ Disables some types of FreeCAD warnings """ 12 | from PySide2.QtCore import qInstallMessageHandler, QtMsgType 13 | def customMessageHandler(type, context, message): 14 | if "QWindowsWindow::setMouseGrabEnabled" not in message: 15 | print(message) 16 | qInstallMessageHandler(customMessageHandler) 17 | os.environ["QT_LOGGING_RULES"] = "*.debug=false;*.warning=false" 18 | # -------------------- 19 | 20 | import logging 21 | class IgnoreMouseGrabWarning(logging.Filter): 22 | def filter(self, record): 23 | return "QWindowsWindow::setMouseGrabEnabled" not in record.getMessage() 24 | logger = logging.getLogger() 25 | logger.addFilter(IgnoreMouseGrabWarning) 26 | # -------------------- 27 | 28 | sys.path.append(os.path.dirname(os.path.abspath(__file__))) 29 | # -------------------- 30 | 31 | from mod.main import boot # pylint: disable=wrong-import-position 32 | ''' 33 | def report_error(exctype, value, tb): 34 | """ Displays a dialog with options about the sudden crash. """ 35 | sys.__excepthook__(exctype, value, tb) 36 | ErrorReportDialog(escape(str(exctype)), escape(str(value)), escape(''.join(format_tb(tb))))''' 37 | 38 | 39 | #sys.excepthook = report_error 40 | boot() 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2025, 2 | Iván Martínez Estévez, Andrés Vieira 3 | 4 | EPHYSLAB Environmental Physics Laboratory, Universidade de Vigo 5 | EPHYTECH Environmental Physics Technologies 6 | 7 | This file is part of DesignSPHysics. 8 | 9 | DesignSPHysics is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | DesignSPHysics is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with DesignSPHysics. If not, see . -------------------------------------------------------------------------------- /default-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "windows": { 3 | "gencase": "./dualsphysics/bin/GenCase_win64.exe", 4 | "dsphysics": "./dualsphysics/bin/DualSPHysics5.4_win64.exe", 5 | "partvtk": "./dualsphysics/bin/PartVTK_win64.exe", 6 | "computeforces": "./dualsphysics/bin/ComputeForces_win64.exe", 7 | "floatinginfo": "./dualsphysics/bin/FloatingInfo_win64.exe", 8 | "measuretool": "./dualsphysics/bin/MeasureTool_win64.exe", 9 | "isosurface": "./dualsphysics/bin/IsoSurface_win64.exe", 10 | "boundaryvtk": "./dualsphysics/bin/BoundaryVTK_win64.exe", 11 | "flowtool": "./dualsphysics/bin/FlowTool_win64.exe", 12 | "bathymetrytool": "./dualsphysics/bin/BathymetryTool_win64.exe", 13 | "surfacesstl" : "./dualsphysics/bin/SurfacesSTL_win64.exe" 14 | }, 15 | "linux": { 16 | "gencase": "./dualsphysics/bin/GenCase_linux64", 17 | "dsphysics": "./dualsphysics/bin/DualSPHysics5.4_linux64", 18 | "partvtk": "./dualsphysics/bin/PartVTK_linux64", 19 | "computeforces": "./dualsphysics/bin/ComputeForces_linux64", 20 | "floatinginfo": "./dualsphysics/bin/FloatingInfo_linux64", 21 | "measuretool": "./dualsphysics/bin/MeasureTool_linux64", 22 | "isosurface": "./dualsphysics/bin/IsoSurface_linux64", 23 | "boundaryvtk": "./dualsphysics/bin/BoundaryVTK_linux64", 24 | "flowtool": "./dualsphysics/bin/FlowTool_linux64", 25 | "bathymetrytool": "./dualsphysics/bin/BathymetryTool_linux64", 26 | "surfacesstl" : "./dualsphysics/bin/SurfacesSTL_linux64" 27 | } 28 | } -------------------------------------------------------------------------------- /images/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/clock.png -------------------------------------------------------------------------------- /images/down_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/down_arrow.png -------------------------------------------------------------------------------- /images/file_mov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/file_mov.png -------------------------------------------------------------------------------- /images/flowtool_template.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/flowtool_template.jpg -------------------------------------------------------------------------------- /images/focused_wave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/focused_wave.png -------------------------------------------------------------------------------- /images/irregular_wave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/irregular_wave.png -------------------------------------------------------------------------------- /images/left-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/left-arrow.png -------------------------------------------------------------------------------- /images/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/load.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/logo.png -------------------------------------------------------------------------------- /images/movement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/movement.png -------------------------------------------------------------------------------- /images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/new.png -------------------------------------------------------------------------------- /images/regular_wave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/regular_wave.png -------------------------------------------------------------------------------- /images/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/run.png -------------------------------------------------------------------------------- /images/run_gencase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/run_gencase.png -------------------------------------------------------------------------------- /images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/save.png -------------------------------------------------------------------------------- /images/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/trash.png -------------------------------------------------------------------------------- /images/up_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/images/up_arrow.png -------------------------------------------------------------------------------- /mod/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/__init__.py -------------------------------------------------------------------------------- /mod/appmode.py: -------------------------------------------------------------------------------- 1 | from mod.constants import CASE_3D_MODE 2 | 3 | class AppMode: 4 | _3d_mode = CASE_3D_MODE 5 | _2d_pos_y = 0.0 6 | @classmethod 7 | def set_3d_mode(self, mode: bool): 8 | self._3d_mode = bool(mode) 9 | 10 | @classmethod 11 | def is_3d(self) -> bool: 12 | return self._3d_mode 13 | 14 | @classmethod 15 | def set_2d_pos_y(self,posy:float): 16 | self._2d_pos_y=posy 17 | 18 | @classmethod 19 | def get_2d_pos_y(self) -> float: 20 | return self._2d_pos_y -------------------------------------------------------------------------------- /mod/dataobjects/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/dataobjects/__init__.py -------------------------------------------------------------------------------- /mod/dataobjects/acceleration_input/acceleration_input.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics AccelrationInput data. """ 4 | 5 | 6 | class AccelerationInput(): 7 | """ Acceleration Input control structure. Includes enabling/disabling and a list 8 | of AccelerationInputData objects""" 9 | 10 | def __init__(self, enabled=False, acclist=None): 11 | self.enabled = enabled 12 | self.acclist = acclist or [] 13 | 14 | def set_list(self, acclist): 15 | """ Sets the acceleration input list. """ 16 | self.acclist = acclist 17 | 18 | def set_enabled(self, state): 19 | """ Enables/Disables acceleration input. """ 20 | self.enabled = state 21 | -------------------------------------------------------------------------------- /mod/dataobjects/acceleration_input/acceleration_input_data.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Accelration Input Data (Datafile based) dataobject """ 4 | from typing import List 5 | 6 | 7 | class AccelerationInputData(): 8 | """ Acceleration Input Data """ 9 | 10 | def __init__(self, label="Acceleration Input", time_start:float=0.0,time_end:float=0.0,is_fluid:bool=True, mkfluid:int=0,mkbound:int=0, acccentre:list=[0, 0, 0], globalgravity:bool=True, datafile:str=""): 11 | self.label = label 12 | self.time_start=time_start 13 | self.time_end=time_end 14 | self.is_fluid=is_fluid 15 | self.mkfluid = mkfluid 16 | self.mkbound = mkbound 17 | self.acccentre = acccentre 18 | self.globalgravity = globalgravity 19 | self.datafile = datafile 20 | 21 | def to_dict(self): 22 | return vars(self) 23 | -------------------------------------------------------------------------------- /mod/dataobjects/bathymetry_form_data.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """" DesignSPHysics Bathymetry Form data 0""" 4 | 5 | 6 | class BathymetryFormData: 7 | """" Bathymetry Form Data. 0""" 8 | 9 | def __init__(self): 10 | self.move = [0,0,0] 11 | self.rotate = [0, 0, 0] 12 | self.scale = [1, 1, 1] 13 | self.selection_enabled = False 14 | self.selection_point = [0, 0] 15 | self.selection_size = [0, 0] 16 | self.gdp = 1 17 | self.initdomain_enabled = False 18 | self.initdomain_point = [0, 0] 19 | self.initdomain_size = [0, 0] 20 | self.xmin_enabled = False 21 | self.expands_xmin = [0, 0, 0, 0] 22 | self.xmax_enabled = False 23 | self.expands_xmax = [0, 0, 0, 0] 24 | self.ymin_enabled = False 25 | self.expands_ymin = [0, 0, 0, 0] 26 | self.ymax_enabled = False 27 | self.expands_ymax = [0, 0, 0, 0] 28 | self.periodicx_enabled = False 29 | self.periodicx_rampwidth = 0 30 | self.periodicx_flatwidth = 0 31 | self.periodicy_enabled = False 32 | self.periodicy_rampwidth = 0 33 | self.periodicy_flatwidth = 0 34 | self.finalmove_enabled = False 35 | self.finalmove = [0, 0, 0] 36 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_collision_dp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics chrono collision dp configuration. """ 4 | 5 | 6 | from mod.enums import ContactMethod 7 | 8 | 9 | class ChronoCollisionDP: 10 | """ Chrono collision DP configuration. """ 11 | 12 | def __init__(self): 13 | self.enabled: bool = False 14 | self.distancedp: float = 0.5 15 | self.ompthreads: int = 1 16 | self.contactmethod: float = ContactMethod.NSC 17 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_csv_intervals.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Chrono CSV Intervals configuration. """ 4 | 5 | 6 | class ChronoCSVIntervals: 7 | """ Chrono CSV Intervals configuration. """ 8 | 9 | def __init__(self): 10 | self.enabled: bool = False 11 | self.value: float = 0.0 12 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_link_coulomb_damping.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Chrono Link Coulomb Damping. """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | 8 | class ChronoLinkCoulombDamping: 9 | """ Chrono Link Coulomb Damping. """ 10 | 11 | def __init__(self): 12 | self.id: UUID = uuid4() 13 | self.idbody1: str = "" 14 | self.idbody2: str = "" 15 | self.point_fb1: list = [0.0, 0.0, 0.0] 16 | self.point_fb2: list = [0.0, 0.0, 0.0] 17 | self.rest_length: float = 0.0 18 | self.damping: float = 0.0 19 | self.nside: int = 0 20 | self.radius: float = 3.0 21 | self.length: float = 1.0 22 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_link_hinge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Chrono Link Hinge. """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | 8 | class ChronoLinkHinge: 9 | """ Chrono Link Hinge. """ 10 | 11 | def __init__(self): 12 | self.id: UUID = uuid4() 13 | self.idbody1: str = "" 14 | self.idbody2: str = "" 15 | self.rotpoint: list = [0.0, 0.0, 0.0] 16 | self.rotvector: list = [0.0, 0.0, 0.0] 17 | self.stiffness: float = 0.0 18 | self.damping: float = 0.0 19 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_link_linear_spring.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Chrono link linearspring. """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | 8 | class ChronoLinkLinearSpring: 9 | """ Chrono Link LinearSpring. """ 10 | 11 | def __init__(self): 12 | self.id: UUID = uuid4() 13 | self.idbody1: str = "" 14 | self.idbody2: str = "" 15 | self.point_fb1: list = [0.0, 0.0, 0.0] 16 | self.point_fb2: list = [0.0, 0.0, 0.0] 17 | self.stiffness: float = 0.0 18 | self.damping: float = 0.0 19 | self.rest_length: float = 0.0 20 | self.number_of_sections: int = 16 21 | self.spring_radius: float = 3 22 | self.revolution_length: float = 1 23 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_link_point_line.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Chrono link pointline. """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | 8 | class ChronoLinkPointLine: 9 | """ Chrono Link PointLine. """ 10 | 11 | def __init__(self): 12 | self.id: UUID = uuid4() 13 | self.idbody1: str = "" 14 | self.slidingvector: list = [0.0, 0.0, 0.0] 15 | self.rotpoint: list = [0.0, 0.0, 0.0] 16 | self.rotvector: list = [0.0, 0.0, 0.0] 17 | self.rotvector2: list = [0.0, 0.0, 0.0] 18 | self.stiffness: float = 0.0 19 | self.damping: float = 0.0 20 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_link_pulley.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Chrono Link Pulley. """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | 8 | class ChronoLinkPulley: 9 | """ Chrono Link Pulley. """ 10 | 11 | def __init__(self): 12 | self.id: UUID = uuid4() 13 | self.idbody1: str = "" 14 | self.idbody2: str = "" 15 | self.rotpoint: list = [0.0, 0.0, 0.0] 16 | self.rotvector: list = [0.0, 0.0, 0.0] 17 | self.radius: float = 0.0 18 | self.radius2: float = 0.0 19 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_link_spheric.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics chrono link spheric """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | 8 | class ChronoLinkSpheric: 9 | """ Chrono link spheric. """ 10 | 11 | def __init__(self): 12 | self.id: UUID = uuid4() 13 | self.idbody1: str = "" 14 | self.idbody2: str = "" 15 | self.rotpoint: list = [0.0, 0.0, 0.0] # Vector(float) 16 | self.stiffness: float = 0.0 17 | self.damping: float = 0.0 18 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_object.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Chrono Object. """ 4 | 5 | from mod.enums import ChronoModelNormalType, ChronoFloatingType 6 | 7 | 8 | class ChronoObject: 9 | """ Chrono Object. """ 10 | 11 | def __init__(self): 12 | self.id: str = "" # FreeCAD Object Name 13 | self.name: str = "" 14 | self.mkbound: int = 0 15 | self.modelnormal_enabled: bool = False 16 | self.modelnormal_type: ChronoModelNormalType.ORIGINAL 17 | self.floating_type: ChronoFloatingType = ChronoFloatingType.BODYFIXED 18 | -------------------------------------------------------------------------------- /mod/dataobjects/chrono/chrono_scale_scheme.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics chrono scale scheme configuration. """ 4 | 5 | 6 | class ChronoScaleScheme: 7 | """ DesignSPHysics crono scale scheme configuration. """ 8 | 9 | def __init__(self): 10 | self.enabled: bool = False 11 | self.value: float = 0.0 12 | -------------------------------------------------------------------------------- /mod/dataobjects/configuration/constants.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics case constants dataobject """ 4 | 5 | class Constants(): 6 | """ DualSPHysics case constants definition dataobject. """ 7 | 8 | def __init__(self): 9 | self.lattice_bound: int = 1 10 | self.lattice_fluid: int = 1 11 | self.pointref: list = [0, 0, 0] 12 | self.setpointref_hdp : bool = False 13 | self.gravity: list = [0, 0, -9.81] 14 | self.rhop0: float = 1000 15 | self.rhopgradient: int = 2 16 | self.hswl: float = 0 17 | self.hswl_auto: bool = True 18 | self.gamma: float = 7 19 | self.speedsystem: float = 0 20 | self.speedsystem_auto: bool = True 21 | self.coefsound: float = 20 22 | self.speedsound: float = 0 23 | self.speedsound_auto: bool = True 24 | self.coefh: float = 1.2 25 | self.hdp: float = 1.5 26 | self.use_hdp : bool = False 27 | self.h_constant_name : str = "coefh" 28 | self.h_constant : float = self.coefh 29 | self.cflnumber: float = 0.2 30 | self.h: float = 0 31 | self.h_auto: bool = True 32 | self.b: float = 0 33 | self.b_auto: bool = True 34 | self.massbound: float = 0 35 | self.massbound_auto: bool = True 36 | self.massfluid: float = 0 37 | self.massfluid_auto: bool = True 38 | -------------------------------------------------------------------------------- /mod/dataobjects/configuration/domain_fixed_parameter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Domain Fixed Parameter data. """ 4 | 5 | 6 | class DomainFixedParameter(): 7 | """ Fixed Domain for a DSPH case. 8 | 9 | Attributes: 10 | xmin = Minimum X coordinate for the fixed domain 11 | xmax = Maximum X coordinate for the fixed domain 12 | ymin = Minimum Y coordinate for the fixed domain 13 | ymax = Maximum Y coordinate for the fixed domain 14 | zmin = Minimum Z coordinate for the fixed domain 15 | zmax = Maximum Z coordinate for the fixed domain 16 | """ 17 | 18 | def __init__(self, enabled, xmin, xmax, ymin, ymax, zmin, zmax): 19 | self.enabled = enabled 20 | self.xmin = xmin 21 | self.xmax = xmax 22 | self.ymin = ymin 23 | self.ymax = ymax 24 | self.zmin = zmin 25 | self.zmax = zmax 26 | 27 | def __str__(self): 28 | to_ret = """ 29 | Enabled: {}\n 30 | Xmin & Xmax: {} ; {}\n 31 | Ymin & Ymax: {} ; {}\n 32 | Zmin & Zmax: {} ; {}\n 33 | """ 34 | return to_ret.format(self.enabled, self.xmin, self.xmax, self.ymin, self.ymax, self.zmin, self.zmax) 35 | -------------------------------------------------------------------------------- /mod/dataobjects/configuration/periodicity.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Periodicity data. """ 4 | 5 | 6 | from mod.dataobjects.configuration.periodicity_info import PeriodicityInfo 7 | 8 | 9 | class Periodicity(): 10 | """ Periodicity information for the current case """ 11 | 12 | def __init__(self): 13 | self.x_periodicity: PeriodicityInfo = PeriodicityInfo() 14 | self.y_periodicity: PeriodicityInfo = PeriodicityInfo() 15 | self.z_periodicity: PeriodicityInfo = PeriodicityInfo() 16 | -------------------------------------------------------------------------------- /mod/dataobjects/configuration/periodicity_info.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Periodicity Information data. """ 4 | 5 | class PeriodicityInfo(): 6 | """ Defines periodicty for an axis """ 7 | 8 | def __init__(self, enabled=False, x_increment=0.0, y_increment=0.0, z_increment=0.0): 9 | self.enabled: bool = enabled 10 | self.x_increment: float = x_increment 11 | self.y_increment: float = y_increment 12 | self.z_increment: float = z_increment 13 | -------------------------------------------------------------------------------- /mod/dataobjects/configuration/post_processing_settings.py: -------------------------------------------------------------------------------- 1 | from mod.dataobjects.flow_tool_xml_box import FlowToolXmlBox 2 | from mod.enums import FlowUnits 3 | 4 | 5 | class PostProcessingSettings(): 6 | 7 | def __init__(self): 8 | self.measuretool_points: list = [] 9 | self.measuretool_grid: list = [] 10 | self.flowtool_units: FlowUnits = FlowUnits.LITERSSECOND 11 | self.flowtool_xml_boxes: list[FlowToolXmlBox] = list() # [FlowToolBox] -------------------------------------------------------------------------------- /mod/dataobjects/configuration/sd_position_property.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Simulation Domain position property dat """ 4 | 5 | from mod.enums import SDPositionPropertyType 6 | 7 | 8 | class SDPositionProperty(): 9 | """ Position property for Simulation Domain """ 10 | 11 | def __init__(self, sdptype=SDPositionPropertyType.DEFAULT, value=0.0): 12 | self.type: SDPositionPropertyType = sdptype 13 | self.value: float = value 14 | -------------------------------------------------------------------------------- /mod/dataobjects/configuration/simulation_domain.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Simulation domain data. """ 4 | 5 | from mod.dataobjects.configuration.sd_position_property import SDPositionProperty 6 | 7 | 8 | class SimulationDomain(): 9 | """ Case domain data information """ 10 | 11 | def __init__(self): 12 | self.enabled: bool = False 13 | self.useparent: bool = False 14 | self.posmin_x: SDPositionProperty = SDPositionProperty() 15 | self.posmin_y: SDPositionProperty = SDPositionProperty() 16 | self.posmin_z: SDPositionProperty = SDPositionProperty() 17 | self.posmax_x: SDPositionProperty = SDPositionProperty() 18 | self.posmax_y: SDPositionProperty = SDPositionProperty() 19 | self.posmax_z: SDPositionProperty = SDPositionProperty() 20 | -------------------------------------------------------------------------------- /mod/dataobjects/damping.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Damping data. """ 4 | from mod.dataobjects.properties.faces_property import FacesProperty 5 | from mod.enums import DampingType 6 | 7 | 8 | class Damping: 9 | """ DualSPHysics damping settings """ 10 | 11 | def __init__(self, damping_type:DampingType=DampingType.ZONE,enabled:bool=True, overlimit:float=1, redumax:float=10,factorxyz:list=[1,1,1], 12 | usedomain:bool=False,domain_zmin:float=0,domain_zmax:float=0,points:list=[]): 13 | self.damping_type:DampingType=damping_type 14 | self.enabled = enabled 15 | self.overlimit = overlimit 16 | self.redumax = redumax 17 | self.factorxyz = factorxyz 18 | self.usedomain=usedomain #DOMAIN VALE PARA TODAS? 19 | self.domain_zmin=domain_zmin 20 | self.domain_zmax=domain_zmax 21 | self.points=points 22 | self.damping_directions=FacesProperty() 23 | 24 | def __str__(self): 25 | to_ret = "" 26 | to_ret += "Damping configuration structure ({})\n".format("enabled" if self.enabled else "disabled") 27 | to_ret += "Overlimit: {}\n".format(self.overlimit) 28 | to_ret += "Redumax: {}".format(self.redumax) 29 | return to_ret 30 | -------------------------------------------------------------------------------- /mod/dataobjects/flow_tool_xml_box.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Flow Tool Box. """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | from mod.functions import migrate_state 8 | 9 | 10 | class FlowToolXmlBox(): 11 | """ A structure representing a box used by FlowTool to measure data. """ 12 | 13 | DEFAULT_NAME: str = "FLOWBOX" 14 | 15 | def __init__(self): 16 | self.id: UUID = uuid4() 17 | self.name: str = self.DEFAULT_NAME 18 | self.point: list[float] = [0.0, 0.0, 0.0] 19 | self.size: list() = [0.0, 0.0, 0.0] 20 | self.angle: list() = [0.0, 0.0, 0.0] 21 | self.divide_axis:bool=False 22 | self.axis:str="x" 23 | self.fc_object_name:str="" 24 | 25 | def __setstate__(self, state: dict): 26 | # Attribute renaming map (old -> new) 27 | rename_map = dict() 28 | 29 | # Handle missing attributes (backward compatibility) 30 | default_attrs = { 31 | 'point1': [0.0, 0.0, 0.0], 32 | 'point2': [0.0, 0.0, 0.0], 33 | 'point3': [0.0, 0.0, 0.0], 34 | 'point4': [0.0, 0.0, 0.0], 35 | 'point5': [0.0, 0.0, 0.0], 36 | 'point6': [0.0, 0.0, 0.0], 37 | 'point7': [0.0, 0.0, 0.0], 38 | 'point8': [0.0, 0.0, 0.0], 39 | } 40 | 41 | # Restore the state 42 | self.__dict__.update(migrate_state(rename_map,default_attrs,state)) 43 | 44 | -------------------------------------------------------------------------------- /mod/dataobjects/gauges/force_gauge.py: -------------------------------------------------------------------------------- 1 | from mod.dataobjects.gauges.gauge_base import Gauge 2 | 3 | 4 | class ForceGauge(Gauge): 5 | def __init__(self, save_vtk_part: bool = False, compute_dt: float = 0, compute_time_start: float = 0, 6 | compute_time_end: float = 0, output: bool = False, output_dt: float = 0, output_time_start: float = 0, 7 | output_time_end: float = 0, name: str = "", target: int = 0): 8 | super().__init__(save_vtk_part, compute_dt, compute_time_start, compute_time_end, output, output_dt, 9 | output_time_start, output_time_end, name) 10 | self.target = target 11 | self.type = "force" 12 | -------------------------------------------------------------------------------- /mod/dataobjects/gauges/gauge_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | 4 | class Gauge: 5 | 6 | def __init__(self, save_vtk_part: bool = False, compute_dt: float = 0, compute_time_start: float = 0, 7 | compute_time_end: float = 0, output: bool = False, output_dt: float = 0, output_time_start: float = 0, 8 | output_time_end: float = 0, name: str = ""): 9 | self.save_vtk_part = save_vtk_part 10 | self.compute_dt: float = compute_dt 11 | self.compute_time_start: float = compute_time_start 12 | self.compute_time_end: float = compute_time_end 13 | self.output: bool = output 14 | self.output_dt: float = output_dt 15 | self.output_time_start: float = output_time_start 16 | self.output_time_end: float = output_time_end 17 | self.name = name 18 | self.type = "base" 19 | self.fc_object_name="" 20 | 21 | 22 | def load_defaults(self, defaults: Gauge): 23 | self.save_vtk_part = defaults.save_vtk_part 24 | self.compute_dt: float = defaults.compute_dt 25 | self.compute_time_start: float = defaults.compute_time_start 26 | self.compute_time_end: float = defaults.compute_time_end 27 | self.output: bool = defaults.output 28 | self.output_dt: float = defaults.output_dt 29 | self.output_time_start: float = defaults.output_time_start 30 | self.output_time_end: float = defaults.output_time_end 31 | -------------------------------------------------------------------------------- /mod/dataobjects/gauges/gauges_data.py: -------------------------------------------------------------------------------- 1 | from mod.dataobjects.gauges.gauge_base import Gauge 2 | 3 | 4 | class GaugesData: 5 | 6 | def __init__(self): 7 | self.gauges_dict:dict= {"Defaults": Gauge(name="Defaults")} 8 | 9 | def add_gauge(self,gauge :Gauge): 10 | name=gauge.name 11 | self.gauges_dict[name] = gauge 12 | 13 | def remove_gauge(self,name:str): 14 | self.gauges_dict.pop(name) 15 | -------------------------------------------------------------------------------- /mod/dataobjects/gauges/max_z_gauge.py: -------------------------------------------------------------------------------- 1 | from mod.dataobjects.gauges.gauge_base import Gauge 2 | 3 | 4 | class MaxZGauge(Gauge): 5 | def __init__(self, save_vtk_part: bool = False, compute_dt: float = 0, compute_time_start: float = 0, 6 | compute_time_end: float = 0, output: bool = False, output_dt: float = 0, output_time_start: float = 0, 7 | output_time_end: float = 0, name: str = "", point0_x: float = 0, point0_y: float = 0, 8 | point0_z: float = 0,height:float=0,dist_limit:float=0): 9 | super().__init__(save_vtk_part, compute_dt, compute_time_start, compute_time_end, output, output_dt, 10 | output_time_start, output_time_end, name) 11 | self.point0=[point0_x,point0_y,point0_z] 12 | self.height=height 13 | self.dist_limit=dist_limit 14 | self.type="maxz" 15 | -------------------------------------------------------------------------------- /mod/dataobjects/gauges/swl_gauge.py: -------------------------------------------------------------------------------- 1 | from mod.dataobjects.gauges.gauge_base import Gauge 2 | 3 | 4 | class SWLGauge(Gauge): 5 | def __init__(self, save_vtk_part: bool = False, compute_dt: float = 0, compute_time_start: float = 0, 6 | compute_time_end: float = 0, output: bool = False, output_dt: float = 0, output_time_start: float = 0, 7 | output_time_end: float = 0, name: str = "", point0_x: float = 0, point0_y: float = 0, 8 | point0_z: float = 0, point1_x: float = 0, point1_y: float = 0, point1_z: float = 0, 9 | point_dp: float = 0, point_dp_coef_dp: bool = False, mass_limit: float = 0.5, 10 | mass_limit_coef: bool = True): 11 | super().__init__(save_vtk_part, compute_dt, compute_time_start, compute_time_end, output, output_dt, 12 | output_time_start, output_time_end, name) 13 | self.point0 = [point0_x, point0_y, point0_z] 14 | self.point1 = [point1_x, point1_y, point1_z] 15 | self.point_dp = point_dp 16 | self.point_dp_coef_dp = point_dp_coef_dp 17 | self.mass_limit = mass_limit 18 | self.mass_limit_coef = mass_limit_coef 19 | self.type="swl" 20 | -------------------------------------------------------------------------------- /mod/dataobjects/gauges/velocity_gauge.py: -------------------------------------------------------------------------------- 1 | from mod.dataobjects.gauges.gauge_base import Gauge 2 | 3 | 4 | class VelocityGauge(Gauge): 5 | def __init__(self, save_vtk_part: bool = False, compute_dt: float = 0, compute_time_start: float = 0, 6 | compute_time_end: float = 0, output: bool = False, output_dt: float = 0, output_time_start: float = 0, 7 | output_time_end: float = 0, name: str = "", point_x: float = 0, point_y: float = 0, 8 | point_z: float = 0): 9 | super().__init__(save_vtk_part, compute_dt, compute_time_start, compute_time_end, output, output_dt, 10 | output_time_start, output_time_end, name) 11 | self.point0 = [point_x, point_y, point_z] 12 | self.type = "velocity" 13 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/dataobjects/inletoutlet/__init__.py -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Inlet/Outlet configuration. """ 4 | from typing import List 5 | 6 | from mod.enums import InletOutletDetermLimit, InletOutletExtrapolateMode 7 | 8 | from mod.dataobjects.inletoutlet.inlet_outlet_zone import InletOutletZone 9 | 10 | 11 | class InletOutletConfig(): 12 | """ Configuration for Inlet/Oulet Zones. """ 13 | 14 | def __init__(self): 15 | self.memoryresize_size0: int = 2 16 | self.memoryresize_size: int = 4 17 | self.useboxlimit_enabled: bool = True 18 | self.useboxlimit_freecentre_enabled: bool = False 19 | 20 | self.useboxlimit_freecentre_values: List[float] = [0,0,0] 21 | self.determlimit: InletOutletDetermLimit = InletOutletDetermLimit.ZEROTH_ORDER 22 | self.extrapolatemode: InletOutletExtrapolateMode = InletOutletExtrapolateMode.FAST_SINGLE 23 | self.refillingrate: int = 10 24 | self.zones: list[InletOutletZone] = list() # [InletOutletZone] 25 | 26 | def get_io_zone_for_id(self, search_id) -> InletOutletZone: 27 | """ Returns the InletOutletZone for a given id. """ 28 | found_zone: InletOutletZone = None 29 | 30 | for zone in self.zones: 31 | if zone.id == search_id: 32 | found_zone = zone 33 | 34 | return found_zone 35 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_density_info.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Inlet/Outlet density info. """ 4 | 5 | from mod.enums import InletOutletDensityType 6 | 7 | 8 | class InletOutletDensityInfo(): 9 | """ Stores Inlet/Outlet density information and parameters. """ 10 | 11 | def __init__(self): 12 | self.density_type: InletOutletDensityType = InletOutletDensityType.FIXED 13 | self.value: float = 0.0 14 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_zone.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Inlet/Outlet zone. """ 4 | 5 | from uuid import UUID, uuid4 6 | 7 | from mod.enums import InletOutletRefillingMode, InletOutletInputTreatment, InletOutletZoneType, \ 8 | InletOutletZoneGeneratorType 9 | from mod.tools.stdout_tools import debug 10 | 11 | from mod.dataobjects.inletoutlet.inlet_outlet_zone_info import InletOutletZoneInfo 12 | from mod.dataobjects.inletoutlet.inlet_outlet_velocity_info import InletOutletVelocityInfo 13 | from mod.dataobjects.inletoutlet.inlet_outlet_density_info import InletOutletDensityInfo 14 | from mod.dataobjects.inletoutlet.inlet_outlet_elevation_info import InletOutletElevationInfo 15 | 16 | 17 | class InletOutletZone: 18 | """ Inlet/Outlet Zone definition. """ 19 | 20 | def __init__(self,io_zone_type:InletOutletZoneGeneratorType): 21 | self.id: UUID = uuid4() 22 | self.refilling: InletOutletRefillingMode = InletOutletRefillingMode.SIMPLE_FULL 23 | self.inputtreatment: InletOutletInputTreatment = InletOutletInputTreatment.NO_CHANGES 24 | self.layers: int = 1 25 | self.zone_info: InletOutletZoneInfo = InletOutletZoneInfo(io_zone_type) 26 | self.velocity_info: InletOutletVelocityInfo = InletOutletVelocityInfo() 27 | self.density_info: InletOutletDensityInfo = InletOutletDensityInfo() 28 | self.elevation_info: InletOutletElevationInfo = InletOutletElevationInfo() 29 | self.fc_object_name:str="" 30 | 31 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_zone_box_generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ A generator that creates particles along the surface of a box. """ 4 | from mod.constants import DIVIDER 5 | import FreeCAD 6 | 7 | 8 | class InletOutletZoneBoxGenerator(): 9 | """ A generator that creates particles along the surface of a box. """ 10 | 11 | def __init__(self, point=None, size=None) -> None: 12 | if size is None: 13 | size = [0.0, 0.0, 0.0] 14 | if point is None: 15 | point = [0.0, 0.0, 0.0] 16 | self.point = point 17 | self.size: list = size 18 | self.manual_setting:bool = False 19 | 20 | def save_values(self, values): 21 | self.point = values["point"] 22 | self.size = values["size"] 23 | self.manual_setting = values["manual_setting"] 24 | 25 | def from_freecad_box(self,box): 26 | self.point = list(box.Placement.Base / DIVIDER) 27 | self.size = [ box.Length.Value / DIVIDER if box.Length.Value / DIVIDER > 10e-6 else 0, 28 | box.Width.Value / DIVIDER if box.Width.Value / DIVIDER > 10e-6 else 0, 29 | box.Height.Value / DIVIDER if box.Height.Value / DIVIDER > 10e-6 else 0] 30 | 31 | def move(self,displacement:FreeCAD.Vector): 32 | self.point = list((FreeCAD.Vector(self.point)*DIVIDER + displacement)/DIVIDER) -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_zone_circle_generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ A generator that cretes partiles along the surface of a circle. """ 4 | from mod.constants import DIVIDER 5 | import FreeCAD 6 | 7 | class InletOutletZoneCircleGenerator: 8 | """ A generator that cretes partiles along the surface of a circle. """ 9 | 10 | def __init__(self, point: list = None, radius: float = 0.0) -> None: 11 | if point is None: 12 | point=[0.0,0.0,0.0] 13 | self.point: list = point 14 | self.radius: float = radius 15 | self.manual_setting:bool = False 16 | 17 | def save_values(self, values): 18 | self.point = values["point"] 19 | self.radius = values["radius"] 20 | self.manual_setting =values["manual_setting"] 21 | 22 | def size_from_freecad_circle(self,circle): 23 | #self.point=list(circle.Placement.Base/ DIVIDER) 24 | self.radius = circle.Radius.Value / DIVIDER 25 | 26 | def from_freecad_circle(self, circle): 27 | self.point=list(circle.Placement.Base/ DIVIDER) 28 | self.radius = circle.Radius.Value / DIVIDER 29 | 30 | def move(self,displacement:FreeCAD.Vector): 31 | self.point = list((FreeCAD.Vector(self.point)*DIVIDER + displacement)/DIVIDER) -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_zone_direction.py: -------------------------------------------------------------------------------- 1 | class InletOutletZone3DDirection(): 2 | def __init__(self,direction=None) -> None: 3 | if direction is None: 4 | direction = [0.0,0.0, 0.0] 5 | self.direction: list = direction 6 | 7 | def save_values(self, values): 8 | self.direction = values["direction"] 9 | 10 | class InletOutletZone2DDirection(): 11 | def __init__(self,direction=None) -> None: 12 | if direction is None: 13 | direction:list = [0.0, 0.0] 14 | self.direction = direction 15 | 16 | def save_values(self, values): 17 | self.direction = values["direction"] -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_zone_line_generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ A Zone generator that creates particles along a line """ 4 | from mod.constants import DIVIDER 5 | from mod.tools.stdout_tools import debug 6 | import FreeCAD 7 | 8 | class InletOutletZoneLineGenerator(): 9 | """ A Zone generator that creates particles along a line """ 10 | 11 | def __init__(self, point=None, point2=None) -> None: 12 | if point2 is None: 13 | point2 = [0.0, 0.0, 0.0] 14 | if point is None: 15 | point = [0.0, 0.0, 0.0] 16 | self.point: list = point 17 | self.point2: list = point2 18 | self.manual_setting:bool = False 19 | 20 | def save_values(self,values): 21 | self.point = values["point"] 22 | self.point2 = values["point2"] 23 | self.manual_setting = values["manual_setting"] 24 | 25 | def from_freecad_line(self,fc_obj): 26 | self.point = list(fc_obj.Placement.Base/DIVIDER) 27 | self.point2 = list((fc_obj.Placement.Base + FreeCAD.Vector(fc_obj.X2,fc_obj.Y2,fc_obj.Z2))/DIVIDER) 28 | 29 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/inlet_outlet_zone_mk_generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ A Zone Generator based on a current simulation MK. """ 4 | 5 | from mod.enums import InletOutletDirection 6 | 7 | class InletOutletZoneMKGenerator(): 8 | """ A Zone Generator based on a current simulation MK. """ 9 | 10 | def __init__(self) -> None: 11 | self.mkfluid: int = 0 12 | self.direction: InletOutletDirection = InletOutletDirection.LEFT 13 | 14 | def save_values(self,values): 15 | self.mkfluid = values["mkfluid"] 16 | self.direction = values["direction"] -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/velocities/jet_circle.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ Jet Circle type for Inlet/Outlet. """ 3 | 4 | 5 | class JetCircle: 6 | """ Defines an Inlet/Oulet linear velocity. """ 7 | 8 | def __init__(self, v: float = 0.0, distance: float = 0.0, radius: float = 0.0) -> None: 9 | self.v: float = v 10 | self.distance: float = distance 11 | self.radius: float = radius 12 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/velocities/linear_velocity.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ Linear velocity type for Inlet/Outlet. """ 3 | 4 | 5 | class LinearVelocity(): 6 | """ Defines an Inlet/Oulet linear velocity. """ 7 | 8 | def __init__(self, v1: float = 0.0, v2: float = 0.0, z1: float = 0.0, z2: float = 0.0) -> None: 9 | self.v1: float = v1 10 | self.v2: float = v2 11 | self.z1: float = z1 12 | self.z2: float = z2 13 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/velocities/parabolic_velocity.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ Parabolic velocity type for Inlet/Outlet. """ 3 | 4 | 5 | class ParabolicVelocity(): 6 | """ Defines an Inlet/Oulet parabolic velocity. """ 7 | 8 | def __init__(self, v1: float = 0.0, v2: float = 0.0, v3: float = 0.0, z1: float = 0.0, z2: float = 0.0, z3: float = 0.0) -> None: 9 | self.v1: float = v1 10 | self.v2: float = v2 11 | self.v3: float = v3 12 | self.z1: float = z1 13 | self.z2: float = z2 14 | self.z3: float = z3 15 | -------------------------------------------------------------------------------- /mod/dataobjects/inletoutlet/velocities/velocity_mesh_data.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ MeshData velocity type for Inlet/Outlet. """ 3 | from typing import List 4 | 5 | 6 | class VelocityMeshData(): 7 | """ Defines Meshdata velocity for Inlet/outlet """ 8 | 9 | def __init__(self, filepath : str="",magnitude: bool = False, reverse:bool = False, initial_time: float = 0.0, 10 | timeloop_tbegin: float = 0.0,timeloop_tend:float=0.0,setpos:List =[0.0,0.0,0.0], 11 | setvelmul:List =[1.0,1.0,1.0],setveladd:List =[0.0,0.0,0.0]) -> None: 12 | self.filepath=filepath 13 | self.magnitude=magnitude 14 | self.reverse=reverse 15 | self.initial_time=initial_time 16 | self.timeloop_tbegin=timeloop_tbegin 17 | self.timeloop_tend=timeloop_tend 18 | self.setpos=setpos 19 | self.setvelmul=setvelmul 20 | self.setveladd=setveladd 21 | 22 | def save(self,values): 23 | self.filepath = values["filepath"] 24 | self.magnitude = values["magnitude"] 25 | self.reverse = values["reverse"] 26 | self.initial_time = values["initial_time"] 27 | self.timeloop_tbegin = values["timeloop_tbegin"] 28 | self.timeloop_tend = values["timeloop_tend"] 29 | self.setpos = values["setpos"] 30 | self.setvelmul = values["setvelmul"] 31 | self.setveladd = values["setveladd"] -------------------------------------------------------------------------------- /mod/dataobjects/moorings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/dataobjects/moorings/__init__.py -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/dataobjects/moorings/moordynplus/__init__.py -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_body.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus body. """ 4 | 5 | 6 | class MoorDynPlusBody(): 7 | """ MoorDynPlus Body object representation. """ 8 | 9 | def __init__(self, ref, depth=False): 10 | self.ref: int = ref # This is the mkbound 11 | self.depth: float = depth # Only used if is not false. Check for bool! 12 | 13 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_configuration.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus specific configuration. """ 4 | 5 | from mod.dataobjects.moorings.moordynplus.moordynplus_solver_options import MoorDynPlusSolverOptions 6 | from mod.dataobjects.moorings.moordynplus.moordynplus_line_default_configuration import MoorDynPlusLineDefaultConfiguration 7 | from mod.dataobjects.moorings.moordynplus.moordynplus_output_configuration import MoorDynPlusOutputConfiguration 8 | 9 | 10 | class MoorDynPlusConfiguration(): 11 | """ A MoorDynPlus specific configuration object to couple with the already existing solver. """ 12 | 13 | def __init__(self): 14 | self.solver_options: MoorDynPlusSolverOptions = MoorDynPlusSolverOptions() 15 | self.bodies: list = list() # MoorDynPlusBody 16 | self.connects: list = list() # MoorDynPlusConnect 17 | self.line_default_configuration: MoorDynPlusLineDefaultConfiguration = MoorDynPlusLineDefaultConfiguration() 18 | self.lines: list = list() # MoorDynPlusLine 19 | self.output_configuration: MoorDynPlusOutputConfiguration = MoorDynPlusOutputConfiguration() 20 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_connect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus connect object. """ 4 | 5 | 6 | class MoorDynPlusConnect(): 7 | """ MoorDynPlus connect object representation. """ 8 | 9 | def __init__(self, conref=-1, point=None, m=1000.0, v=120.0): 10 | self.conref: int = conref 11 | self.point: list() = point or [0.0, 0.0, 0.0] 12 | self.m: float = m 13 | self.v: float = v 14 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_connect_connection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus Connect Connection. """ 4 | 5 | 6 | class MoorDynPlusConnectConnection(): 7 | """ MoorDynPlus Connect Connection representation. """ 8 | 9 | def __init__(self, conref=-1): 10 | self.conref = conref 11 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_fix_connection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus Fix Connection. """ 4 | 5 | 6 | class MoorDynPlusFixConnection(): 7 | """ MoorDynPlus Fix Connection representation. """ 8 | 9 | def __init__(self, point=None): 10 | self.point: list = point or [0.0, 0.0, 0.0] 11 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_line.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus Line. """ 4 | 5 | from mod.dataobjects.moorings.moordynplus.moordynplus_vessel_connection import MoorDynPlusVesselConnection 6 | from mod.dataobjects.moorings.moordynplus.moordynplus_fix_connection import MoorDynPlusFixConnection 7 | from mod.dataobjects.moorings.moordynplus.moordynplus_connect_connection import MoorDynPlusConnectConnection 8 | 9 | 10 | class MoorDynPlusLine(): 11 | """ MoorDynPlus line representation. """ 12 | 13 | def __init__(self, line_id=-1): 14 | self.line_id: int = line_id 15 | 16 | # Not more than 2 connections allowed. 17 | self.vessel_connection: MoorDynPlusVesselConnection = None 18 | self.vessel2_connection: MoorDynPlusVesselConnection = None 19 | self.fix_connection: MoorDynPlusFixConnection = None 20 | self.connect_connection: MoorDynPlusConnectConnection = None 21 | self.connect2_connection: MoorDynPlusConnectConnection = None 22 | self.length: float = 1.0 23 | self.segments: int = 20 24 | 25 | # Default overrides 26 | self.ea: float = None 27 | self.diameter: float = None 28 | self.massDenInAir: float = None 29 | self.ba: float = None 30 | self.can: float = None 31 | self.cat: float = None 32 | self.cdn: float = None 33 | self.cdt: float = None 34 | self.outputFlags: str = None 35 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_line_default_configuration.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus default line properties. """ 4 | 5 | 6 | class MoorDynPlusLineDefaultConfiguration(): 7 | """ MoorDynPlus LineDefault configuration object. """ 8 | 9 | def __init__(self): 10 | self.ea: float = 2.9e3 11 | self.diameter: float = 3.656e-3 12 | self.massDenInAir: float = 0.0607 13 | self.ba: float = -0.8 14 | self.can: float = 1.0 15 | self.cat: float = 0.0 16 | self.cdn: float = 1.6 17 | self.cdt: float = 0.05 18 | self.breaktension: float = 0.0 19 | self.outputFlags: str = "p" 20 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_output_configuration.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus output configuration. """ 4 | 5 | 6 | class MoorDynPlusOutputConfiguration(): 7 | """ MoorDynPlus output configuration dataobject. """ 8 | 9 | def __init__(self): 10 | self.startTime: float = 0 11 | self.endTime: float = 10 12 | self.dtOut: float = 0.01 13 | self.tension: bool = True 14 | self.force: bool = True 15 | self.velocity: bool = True 16 | self.position: bool = True 17 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_solver_options.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus solver options. """ 4 | 5 | 6 | class MoorDynPlusSolverOptions(): 7 | """ MoorDynPlus general solver options dataobject. """ 8 | 9 | def __init__(self): 10 | self.gravity: float = 9.81 11 | self.water_depth: float = 0.5 12 | self.freesurface: float = 0.0 13 | self.kBot: float = 3.0e6 14 | self.cBot: float = 3.0e6 15 | self.dtM: float = 0.0001 16 | self.dtMauto: bool = True 17 | self.waveKin: int = 0 18 | self.writeUnits: str = "yes" 19 | self.frictionCoefficient: float = 0.0 20 | self.fricDamp: float = 200.0 21 | self.statDynFricScale: float = 1.0 22 | self.dtIC: float = 1.0 23 | self.cdScaleIC: float = 5.0 24 | self.threshIC: float = 0.01 25 | self.tmaxIC: float = 0.5 26 | self.timeMax: float = 0 27 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moordynplus/moordynplus_vessel_connection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus Vessel Connection. """ 4 | 5 | 6 | class MoorDynPlusVesselConnection(): 7 | """ MoorDynPlus Vessel Connection representation. """ 8 | 9 | def __init__(self, bodyref=-1, point=None): 10 | self.bodyref: int = bodyref 11 | self.point: list = point or [0.0, 0.0, 0.0] 12 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moorings_configuration.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MoorDynPlus coupling configuration. """ 4 | 5 | from mod.enums import MooringsConfigurationMethod 6 | 7 | from mod.dataobjects.moorings.moorings_save_options import MooringsSaveOptions 8 | from mod.dataobjects.moorings.moordynplus.moordynplus_configuration import MoorDynPlusConfiguration 9 | from mod.functions import migrate_state 10 | 11 | class MooringsConfiguration(): 12 | """ A moorings configuration structure to use with MoorDynPlus under DualSPHysics. """ 13 | 14 | def __init__(self): 15 | self.enabled = False 16 | self.saveoptions: MooringsSaveOptions = MooringsSaveOptions() 17 | self.moored_floatings: list = list() # MKBound (int) 18 | self.configuration_method: MooringsConfigurationMethod = MooringsConfigurationMethod.EMBEDDED 19 | self.moordynplus_xml: str = "" 20 | self.moordynplus_configuration: MoorDynPlusConfiguration = MoorDynPlusConfiguration() 21 | 22 | def __setstate__(self, state: dict): 23 | # Attribute renaming map (old -> new) 24 | rename_map = { 25 | 'moordyn_xml': 'moordynplus_xml', # Add other renames if needed 26 | 'moordyn_configuration': 'moordynplus_configuration', 27 | } 28 | 29 | # Handle missing attributes (backward compatibility) 30 | default_attrs = dict() 31 | 32 | # Restore the state 33 | self.__dict__.update(migrate_state(rename_map,default_attrs,state)) 34 | -------------------------------------------------------------------------------- /mod/dataobjects/moorings/moorings_save_options.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics save options for moorings configuration. """ 4 | 5 | 6 | class MooringsSaveOptions(): 7 | """ DesignSPHysics save options for moorings configuration. """ 8 | 9 | def __init__(self): 10 | self.savevtk_moorings: bool = True 11 | self.savecsv_points: bool = True 12 | self.savevtk_points: bool = False 13 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/dataobjects/motion/__init__.py -------------------------------------------------------------------------------- /mod/dataobjects/motion/acc_cir_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Accelerated Circular Motion Data """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class AccCirMotion(BaseMotion): 11 | """ DualSPHysics circular motion. 12 | 13 | Attributes: 14 | ang_vel: Angular velocity of the movement 15 | ang_acc: Angular acceleration of the movement 16 | reference: Point of the object that rotates with the axis 17 | axis1: Starting point of the vector that defines the rotation axis 18 | axis2: Finishing point of the vector that defines the rotation axis 19 | """ 20 | 21 | def __init__(self, duration=1, ang_vel=0, ang_acc=0, reference=None, axis1=None, axis2=None): 22 | BaseMotion.__init__(self, duration) 23 | self.type = MotionType.CIRCULAR 24 | self.reference = reference or [0, 0, 0] 25 | self.axis1 = axis1 or [0, 0, 0] 26 | self.axis2 = axis2 or [0, 0, 0] 27 | self.ang_vel = ang_vel 28 | self.ang_acc = ang_acc 29 | 30 | def __str__(self): 31 | return "AccCirMotion [Duration: {} ; AngVelocity: {} ; AngAccel: {} ; Reference: {} ; Axis: [{}, {}]]".format( 32 | self.duration, 33 | self.ang_vel, 34 | self.ang_acc, 35 | self.reference, 36 | self.axis1, 37 | self.axis2 38 | ) 39 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/acc_rect_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Accelerated Rectilinear motion data """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class AccRectMotion(BaseMotion): 11 | """ DualSPHysics accelerated rectilinear motion. 12 | 13 | Attributes: 14 | velocity: Velocity vector that defines the movement 15 | acceleration: Acceleration vector that defines the acceleration 16 | """ 17 | 18 | def __init__(self, duration=1, velocity=None, acceleration=None): 19 | BaseMotion.__init__(self, duration) 20 | self.type = MotionType.ACCELERATED_RECTILINEAR 21 | self.velocity = velocity or [0, 0, 0] 22 | self.acceleration = acceleration or [0, 0, 0] 23 | 24 | def __str__(self): 25 | return "AccRectMotion [Duration: {} ; Velocity: {} ; Acceleration: {}]" \ 26 | .format(self.duration, self.velocity, self.acceleration) 27 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/acc_rot_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Accelerated Rotational Motion data """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class AccRotMotion(BaseMotion): 11 | """ DualSPHysics rotational motion. 12 | 13 | Attributes: 14 | ang_vel: Angular velocity of the movement 15 | ang_acc: Angular acceleration of the movement 16 | axis1: Starting point of the vector that defines the rotation axis 17 | axis2: Finishing point of the vector that defines the rotation axis 18 | """ 19 | 20 | def __init__(self, duration=1, ang_vel=0, ang_acc=0, axis1=None, axis2=None): 21 | BaseMotion.__init__(self, duration) 22 | self.type = MotionType.ACCELERATED_ROTATIONAL 23 | self.axis1 = axis1 or [0, 0, 0] 24 | self.axis2 = axis2 or [0, 0, 0] 25 | self.ang_vel = ang_vel 26 | self.ang_acc = ang_acc 27 | 28 | def __str__(self): 29 | return "AccRotMotion [Duration: {} ; AngVelocity: {} ; AngAccel: {} ; Axis: [{}, {}]]" \ 30 | .format(self.duration, self.ang_vel, self.ang_acc, self.axis1, self.axis2) 31 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/awas_correction.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics AWAS Correction data """ 4 | 5 | class AWASCorrection(): 6 | """ AWAS drift correction property """ 7 | 8 | def __init__(self, enabled=False, coefstroke=1.8, coefperiod=1, powerfunc=3): 9 | self.enabled = enabled 10 | self.coefstroke = coefstroke 11 | self.coefperiod = coefperiod 12 | self.powerfunc = powerfunc 13 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/base_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Base Motion object for movements to inherit """ 4 | 5 | from mod.enums import MotionType 6 | 7 | class BaseMotion(): 8 | """ Base motion class to inherit by others. 9 | 10 | Attributes: 11 | duration: Movement duration in seconds 12 | """ 13 | 14 | def __init__(self, duration=1): 15 | self.duration = duration 16 | self.type = MotionType.BASE 17 | 18 | def __str__(self): 19 | return "BaseMotion [Duration: {}]".format(self.duration) 20 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/cir_sinu_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Circular Sinusoidal motion data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class CirSinuMotion(BaseMotion): 11 | """ DualSPHysics sinusoidal circular motion. 12 | 13 | Attributes: 14 | reference: Point of the object that rotates with the axis 15 | axis1: Starting point of the vector that defines the rotation axis 16 | axis2: Finishing point of the vector that defines the rotation axis 17 | freq: Frequency 18 | ampl: Amplitude 19 | phase: Phase 20 | """ 21 | 22 | def __init__(self, reference=None, duration=1, axis1=None, axis2=None, freq=0, ampl=0, phase=0): 23 | BaseMotion.__init__(self, duration) 24 | self.type = MotionType.SINUSOIDAL_CIRCULAR 25 | self.reference = reference or [0, 0, 0] 26 | self.axis1 = axis1 or [0, 0, 0] 27 | self.axis2 = axis2 or [0, 0, 0] 28 | self.freq = freq 29 | self.ampl = ampl 30 | self.phase = phase 31 | 32 | def __str__(self): 33 | return "CirSinuMotion [Duration: {} ; Frequency: {} ; Amplitude: {} ; " "Phase: {} ; Reference: {} ; Axis: [{}, {}]]".format( 34 | self.duration, 35 | self.freq, 36 | self.ampl, 37 | self.phase, 38 | self.reference, 39 | self.axis1, 40 | self.axis2 41 | ) 42 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/file_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics File Generator data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.wave_gen import WaveGen 8 | 9 | 10 | class FileGen(WaveGen): 11 | """ File Generator. Loads movements from file 12 | 13 | Attributes: 14 | duration: Duration in seconds 15 | filename: File path to use 16 | fields: Number of columns of the file 17 | fieldtime: Column with time 18 | fieldx: Column with X-position 19 | fieldy: Column with Y-position 20 | fieldz: Column with Z-position 21 | """ 22 | 23 | def __init__(self, duration=0, filename="", fields=0, fieldtime=0, fieldx=0, fieldy=0, fieldz=0): 24 | WaveGen.__init__(self) 25 | self.duration = duration 26 | self.type = MotionType.FILE_GENERATOR 27 | self.filename = filename 28 | self.fields = fields 29 | self.fieldtime = fieldtime 30 | self.fieldx = fieldx 31 | self.fieldy = fieldy 32 | self.fieldz = fieldz 33 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/rect_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Rectilinear motion data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class RectMotion(BaseMotion): 11 | """ DualSPHysics rectilinear motion. 12 | 13 | Attributes: 14 | velocity: Velocity vector that defines the movement 15 | """ 16 | 17 | def __init__(self, duration=1, velocity=None): 18 | BaseMotion.__init__(self, duration) 19 | self.type = MotionType.RECTILINEAR 20 | self.velocity = velocity or [0, 0, 0] 21 | 22 | def __str__(self): 23 | return "RectMotion [Duration: {} ; Velocity: {}]".format(self.duration, self.velocity) 24 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/rect_sinu_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Sinusoidal Rectilinar Motion data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class RectSinuMotion(BaseMotion): 11 | """ DualSPHysics sinusoidal rectilinear motion. 12 | 13 | Attributes: 14 | freq: Frequency (vector) 15 | ampl: Amplitude (vector) 16 | phase: Phase (vector) 17 | """ 18 | 19 | def __init__(self, duration=1, freq=None, ampl=None, phase=None): 20 | BaseMotion.__init__(self, duration) 21 | self.type = MotionType.SINUSOIDAL_RECTILINEAR 22 | self.freq = freq or [0, 0, 0] 23 | self.ampl = ampl or [0, 0, 0] 24 | self.phase = phase or [0, 0, 0] 25 | 26 | def __str__(self): 27 | return "RectSinuMotion [Duration: {} ; Frequency: {} ; Amplitude: {} ; Phase: {}".format( 28 | self.duration, 29 | self.freq, 30 | self.ampl, 31 | self.phase 32 | ) 33 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/regular_flap_wave_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Regular Flap wave generator data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.wave_gen import WaveGen 8 | 9 | 10 | class RegularFlapWaveGen(WaveGen): 11 | """ Flap Regular Wave Generator. 12 | 13 | Attributes: 14 | phase: Initial wave phase in function of PI 15 | ramp: Periods of ramp 16 | variable_draft: Position of the wavemaker hinge 17 | flapaxis0: Point 0 of axis rotation 18 | flapaxis1: Point 1 of axis rotation 19 | """ 20 | 21 | def __init__(self, wave_order=2, start=0, duration=0, depth=0, wave_height=0.5, 22 | wave_period=1, gainstroke=1.0, phase=0, ramp=0, disksave_periods=24, disksave_periodsteps=20, disksave_xpos=2, 23 | disksave_zpos=-0.15, variable_draft=0.0, flapaxis0=None, flapaxis1=None): 24 | WaveGen.__init__(self, wave_order, start, duration, depth, wave_height, wave_period, gainstroke) 25 | self.type = MotionType.REGULAR_FLAP_WAVE_GENERATOR 26 | self.phase = phase 27 | self.ramp = ramp 28 | self.variable_draft = variable_draft 29 | self.flapaxis0 = flapaxis0 or [0, -1, 0] 30 | self.flapaxis1 = flapaxis1 or [0, 1, 0] 31 | self.disksave_periods = disksave_periods 32 | self.disksave_periodsteps = disksave_periodsteps 33 | self.disksave_xpos = disksave_xpos 34 | self.disksave_zpos = disksave_zpos 35 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/regular_piston_wave_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Regular Piston Wave Generator data """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.wave_gen import WaveGen 8 | from mod.dataobjects.motion.awas import AWAS 9 | 10 | 11 | class RegularPistonWaveGen(WaveGen): 12 | """ Piston Regular Wave Generator. 13 | 14 | Attributes: 15 | phase: Initial wave phase in function of PI 16 | ramp: Periods of ramp 17 | disksave_periods: 18 | disksave_periodsteps: 19 | disksave_xpos: 20 | disksave_zpos: 21 | piston_dir: Movement direction (def [1,0,0]) 22 | awas: AWAS object 23 | """ 24 | 25 | def __init__(self, wave_order=2, start=0, duration=0, depth=0, wave_height=0.5, wave_period=1, gainstroke=1.0, phase=0, ramp=0, 26 | disksave_periods=24, disksave_periodsteps=20, disksave_xpos=2, disksave_zpos=-0.15, piston_dir=None, awas=None): 27 | WaveGen.__init__(self, wave_order, start, duration, depth, wave_height, wave_period, gainstroke) 28 | self.type = MotionType.REGULAR_PISTON_WAVE_GENERATOR 29 | self.phase = phase 30 | self.ramp = ramp 31 | self.disksave_periods = disksave_periods 32 | self.disksave_periodsteps = disksave_periodsteps 33 | self.disksave_xpos = disksave_xpos 34 | self.disksave_zpos = disksave_zpos 35 | self.piston_dir = piston_dir or [1, 0, 0] 36 | self.awas = AWAS() if awas is None else awas 37 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/rot_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Rotational Motion data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class RotMotion(BaseMotion): 11 | """ DualSPHysics rotational motion. 12 | 13 | Attributes: 14 | ang_vel: Angular velocity of the movement 15 | axis1: Starting point of the vector that defines the rotation axis 16 | axis2: Finishing point of the vector that defines the rotation axis 17 | """ 18 | 19 | def __init__(self, duration=1, ang_vel=0, axis1=None, axis2=None): 20 | BaseMotion.__init__(self, duration) 21 | self.type = MotionType.ROTATIONAL 22 | self.axis1 = axis1 or [0, 0, 0] 23 | self.axis2 = axis2 or [0, 0, 0] 24 | self.ang_vel = ang_vel 25 | 26 | def __str__(self): 27 | return "RotMotion [Duration: {} ; AngVelocity: {} ; Axis: [{}, {}]]" \ 28 | .format(self.duration, self.ang_vel, self.axis1, self.axis2) 29 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/rot_sinu_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Rotational Sinusoidal Motion data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class RotSinuMotion(BaseMotion): 11 | """ DualSPHysics sinusoidal rotational motion. 12 | 13 | Attributes: 14 | axis1: Starting point of the vector that defines the rotation axis 15 | axis2: Finishing point of the vector that defines the rotation axis 16 | freq: Frequency 17 | ampl: Amplitude 18 | phase: Phase 19 | """ 20 | 21 | def __init__(self, duration=1, axis1=None, axis2=None, freq=0, ampl=0, phase=0): 22 | BaseMotion.__init__(self, duration) 23 | self.type = MotionType.SINUSOIDAL_ROTATIONAL 24 | self.axis1 = axis1 or [0, 0, 0] 25 | self.axis2 = axis2 or [0, 0, 0] 26 | self.freq = freq 27 | self.ampl = ampl 28 | self.phase = phase 29 | 30 | def __str__(self): 31 | return "RotSinuMotion [Duration: {} ; Frequency: {} ; Amplitude: {} ; Phase: {} ; Axis: [{}, {}]]".format( 32 | self.duration, 33 | self.freq, 34 | self.ampl, 35 | self.phase, 36 | self.axis1, 37 | self.axis2 38 | ) 39 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/rotate_adv_file_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics File Generator data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.wave_gen import WaveGen 8 | 9 | 10 | class RotateAdvFileGen(WaveGen): 11 | """ File Generator. Loads movements from file 12 | 13 | Attributes: 14 | duration: Duration in seconds 15 | filename: File path to use 16 | fields: Number of columns of the file 17 | fieldtime: Column with time 18 | fieldx: Column with X-position 19 | fieldy: Column with Y-position 20 | fieldz: Column with Z-position 21 | """ 22 | 23 | def __init__(self, duration=0, filename="", fields=4, fieldtime=0, fieldang1=1, fieldang2=2, fieldang3=3, 24 | center=None, intrinsic = False,axes = "XYZ",anglesunits="degrees"): 25 | WaveGen.__init__(self) 26 | self.anglesunits = anglesunits 27 | if center is None: 28 | center = [0.0, 0.0, 0.0] 29 | self.duration = duration 30 | self.type = MotionType.FILE_ROTATE_ADV_GENERATOR 31 | self.filename = filename 32 | self.fields = fields 33 | self.fieldtime = fieldtime 34 | self.fieldang1 = fieldang1 35 | self.fieldang2 = fieldang2 36 | self.fieldang3 = fieldang3 37 | self.center = center 38 | self.intrinsic = intrinsic 39 | self.axes=axes 40 | 41 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/rotation_file_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Rotation-File based motion data """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.wave_gen import WaveGen 8 | 9 | 10 | class RotationFileGen(WaveGen): 11 | """ Rotation File Generator. Loads rotation movements from file 12 | 13 | Attributes: 14 | duration: Duration in seconds 15 | anglesunits: Units of the file (degrees, radians) 16 | filename: File path to use 17 | axisp1: Point 1 of the axis 18 | axisp2: Point 2 of the axis 19 | """ 20 | 21 | def __init__(self, duration=0, filename="", anglesunits="degrees", axisp1=None, axisp2=None): 22 | WaveGen.__init__(self) 23 | self.duration = duration 24 | self.type = MotionType.FILE_ROTATIONAL_GENERATOR 25 | self.anglesunits = anglesunits 26 | self.filename = filename 27 | self.axisp1 = axisp1 or [0, 0, 0] 28 | self.axisp2 = axisp2 or [0, 0, 0] 29 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/special_movement.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Special Movement data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.wave_gen import WaveGen 8 | 9 | 10 | class SpecialMovement(): 11 | """ DualSPHysics compatible special movement. 12 | It includes regular/irregular wave generators and file movements 13 | 14 | Attributes: 15 | name: Name for this motion given by the user 16 | generator: Generator assigned 17 | """ 18 | 19 | def __init__(self, name="New Movement", generator=None): 20 | self.name = name 21 | self.type = MotionType.WAVE 22 | self.generator = generator 23 | 24 | def set_wavegen(self, generator): 25 | """ Sets the wave generator for the special movement """ 26 | if isinstance(generator, WaveGen): 27 | self.generator = generator 28 | else: 29 | raise TypeError("You are trying to set a non-generator object.") 30 | 31 | def __str__(self): 32 | to_ret = "SpecialMovement <{}> with an {}".format( 33 | self.name, self.generator.__class__.__name__) + "\n" 34 | return to_ret 35 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/wait_motion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Wait Motion data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | from mod.dataobjects.motion.base_motion import BaseMotion 8 | 9 | 10 | class WaitMotion(BaseMotion): 11 | """ DualSPHysics rectilinear motion. 12 | 13 | Attributes inherited from superclass. 14 | """ 15 | 16 | def __init__(self, duration=1): 17 | BaseMotion.__init__(self, duration) 18 | self.type = MotionType.WAIT 19 | 20 | def __str__(self): 21 | return "WaitMotion [Duration: {}]".format(self.duration) 22 | -------------------------------------------------------------------------------- /mod/dataobjects/motion/wave_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Wave Generator data. """ 4 | 5 | from mod.enums import MotionType 6 | 7 | 8 | class WaveGen(): 9 | """ Base Wave Generator. It holds properties common to Regular and Irregular waves. 10 | 11 | Attributes: 12 | (): The movement in which this property is contained 13 | mk_bound: Particle MK (for bounds) to which this property will be applied 14 | wave_order: Order wave generation (def 1, [1,2]) 15 | start: Start time (def 0) 16 | duration: Movement duration, 0 means until simulation end 17 | depth: Fluid depth (def 0) 18 | wave_height: Wave height (def 0.5) 19 | wave_period: Wave period (def 1) 20 | gainstroke: Gain factor to amplify/reduce the paddle stroke (default=1.0) 21 | """ 22 | 23 | def __init__(self, wave_order=1, start=0, duration=0, depth=0, wave_height=0.5, wave_period=1, gainstroke=1.0): 24 | self.type = MotionType.BASE_WAVE_GENERATOR 25 | self.wave_order = wave_order 26 | self.start = start 27 | self.duration = duration 28 | self.depth = depth 29 | self.wave_height = wave_height 30 | self.wave_period = wave_period 31 | self.gainstroke = gainstroke 32 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/faces_property.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Faces Property data """ 4 | 5 | 6 | class FacesProperty(): 7 | """ Stores the faces selected to generate on GenCase for a given object """ 8 | 9 | def __init__(self, all_faces=False, front_face=False, 10 | back_face=False, top_face=False, bottom_face=False, 11 | left_face=False, right_face=False, face_print="", layers=""): 12 | self.all_faces = all_faces 13 | self.front_face = front_face 14 | self.back_face = back_face 15 | self.top_face = top_face 16 | self.bottom_face = bottom_face 17 | self.left_face = left_face 18 | self.right_face = right_face 19 | self.face_print = face_print 20 | self.layers = layers 21 | 22 | def build_face_print(self) -> None: 23 | """ Builds a string to print faces. """ 24 | if self.all_faces: 25 | self.face_print = "all" 26 | return 27 | 28 | applied_faces: list = list() 29 | applied_faces.append("front" if self.front_face else None) 30 | applied_faces.append("back" if self.back_face else None) 31 | applied_faces.append("top" if self.top_face else None) 32 | applied_faces.append("bottom" if self.bottom_face else None) 33 | applied_faces.append("left" if self.left_face else None) 34 | applied_faces.append("right" if self.right_face else None) 35 | 36 | self.face_print = " | ".join(filter(lambda x: x is not None, applied_faces)) 37 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/flexstruct.py: -------------------------------------------------------------------------------- 1 | from mod.enums import ConstModel 2 | 3 | 4 | class FlexStruct: 5 | 6 | def __init__(self,mkbound:int,mkclamp:int,density:float=1000,young_mod:float=3.5e6,poisson_ratio:float=0.49, 7 | const_model:ConstModel=ConstModel.PLANESTRAIN,hg_factor:float=0.1): 8 | self.enabled:bool=False 9 | self.mkbound=mkbound 10 | self.mkclamp=mkclamp 11 | self.density=density 12 | self.young_mod=young_mod 13 | self.poisson_ratio=poisson_ratio 14 | self.const_model=const_model 15 | self.hg_factor=hg_factor 16 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/initials_property.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Initials Property data """ 4 | 5 | from mod.enums import InitialsType 6 | 7 | 8 | class InitialsProperty(): 9 | """ Initial movement property of an DSPH object. 10 | 11 | Attributes: 12 | mk: Mk to witch this InitialsProperty is binded. 13 | force: Force in [x, y, z] format. 14 | """ 15 | 16 | def __init__(self, mk=-1, force=None, initials_type=InitialsType.LINEAR, v1=0.0, v2=0.0, v3=0.0, z1=0.0, z2=0.0, z3=0.0): 17 | self.mk = mk 18 | self.force = force or [] 19 | self.initials_type: InitialsType = initials_type 20 | self.v1: float = v1 21 | self.v2: float = v2 22 | self.v3: float = v3 23 | self.z1: float = z1 24 | self.z2: float = z2 25 | self.z3: float = z3 26 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/material_property.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MK Based Properties. """ 4 | 5 | from mod.dataobjects.properties.property import Property 6 | 7 | 8 | class MaterialProperty(Property): 9 | """ Base class for composing custom properties for DualSPHysics. """ 10 | 11 | def __init__(self, name=None): 12 | super().__init__(name) 13 | self.young_modulus: float = 1.0 14 | self.poisson_ratio: float = 1.0 15 | self.restitution_coefficient: float = 1.0 16 | self.kfric: float = 1.0 17 | 18 | def __str__(self): 19 | to_ret = "Name: {name}\n" 20 | to_ret += "Young Modulus: {young_modulus}\n" 21 | to_ret += "Poisson Ratio: {poisson_ratio}\n" 22 | to_ret += "Restitution Coefficient: {restitution_coefficient}\n" 23 | to_ret += "KFric: {kfric}" 24 | 25 | return to_ret.format(**self.__dict__) 26 | 27 | def html_str(self): 28 | """ Returns the object details as an HTML string. """ 29 | to_ret = "Name: {name}
" 30 | to_ret += "Young Modulus: {young_modulus}
" 31 | to_ret += "Poisson Ratio: {poisson_ratio}
" 32 | to_ret += "Restitution Coefficient: {restitution_coefficient}
" 33 | to_ret += "KFric: {kfric}" 34 | 35 | return to_ret.format(**self.__dict__) 36 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/ml_piston/ml_piston.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Multi-Layer Piston data. """ 4 | 5 | from mod.enums import MLPistonType 6 | 7 | class MLPiston(): 8 | """ Multi-Layer Piston common attributes """ 9 | 10 | def __init__(self, incz=0): 11 | self.type = MLPistonType.BASE 12 | self.incz = incz 13 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/ml_piston/ml_piston_1d.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Multi-Layer Piston 1D Data. """ 4 | 5 | from mod.dataobjects.properties.ml_piston.ml_piston import MLPiston 6 | 7 | from mod.enums import MLPistonType 8 | 9 | class MLPiston1D(MLPiston): 10 | """ Multi-Layer Pistons using external velocity (for example, from SWASH) """ 11 | 12 | def __init__(self, filevelx=None, incz=0, timedataini=0, smooth=0): 13 | MLPiston.__init__(self, incz=incz) 14 | self.type = MLPistonType.MLPISTON1D 15 | self.filevelx = filevelx 16 | self.timedataini = timedataini 17 | self.smooth = smooth 18 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/ml_piston/ml_piston_2d.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Multi-Layer Piston 2D Data. """ 4 | 5 | from mod.dataobjects.properties.ml_piston.ml_piston import MLPiston 6 | 7 | from mod.enums import MLPistonType 8 | 9 | 10 | class MLPiston2D(MLPiston): 11 | """ Multi-Layer Pistons using external velocity (for example, from SWASH) """ 12 | 13 | def __init__(self, incz=0, smoothz=0, smoothy=0, veldata=None): 14 | MLPiston.__init__(self, incz=incz) 15 | self.type = MLPistonType.MLPISTON2D 16 | self.smoothz = smoothz 17 | self.smoothy = smoothy 18 | self.veldata = veldata or [] # [MLPiston2DVeldata] 19 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/ml_piston/ml_piston_2d_veldata.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics VelData attribute data. """ 4 | 5 | 6 | class MLPiston2DVeldata(): 7 | """ VelData attribute for MLPiston2D """ 8 | 9 | def __init__(self, filevelx="", posy=0, timedataini=0): 10 | self.filevelx = filevelx 11 | self.posy = posy 12 | self.timedataini = timedataini 13 | -------------------------------------------------------------------------------- /mod/dataobjects/properties/property.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics MK Based Properties. """ 4 | 5 | 6 | class Property(): 7 | """ Base class for composing custom properties for DualSPHysics. """ 8 | 9 | def __init__(self, name=None): 10 | self.name: str = name or "New Property" 11 | -------------------------------------------------------------------------------- /mod/dataobjects/relaxation_zone/relaxation_zone.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Relaxation zone data. """ 4 | 5 | 6 | class RelaxationZone(): 7 | """ Base class for Relaxation Zone objects """ 8 | 9 | def __init__(self, start=0, duration=0, depth=1,coefdt=1000, function_psi=0.9, function_beta=1,swl=1,center=None, width=0.5) : 10 | self.start = start 11 | self.duration = duration 12 | self.depth = depth 13 | self.coefdt = coefdt 14 | self.function_psi = function_psi 15 | self.function_beta = function_beta 16 | self.swl = swl 17 | self.center = [0, 0, 0] if center is None else center 18 | self.width = width -------------------------------------------------------------------------------- /mod/dataobjects/relaxation_zone/relaxation_zone_file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Relaxation Zone File data. """ 4 | 5 | from mod.dataobjects.relaxation_zone.relaxation_zone import RelaxationZone 6 | 7 | 8 | class RelaxationZoneFile(RelaxationZone): 9 | """ Relaxation zone with external file wave definition """ 10 | 11 | def __init__(self, start=0, duration=0, depth=1, swl=1, filesvel="", filesvelx_initial=0, 12 | filesvelx_count=5, usevelz=False, movedata=None, dpz=2, smooth=0, center=None, width=0.5, 13 | coefdir=None, coefdt=1000, function_psi=0.9, function_beta=1, driftcorrection=0, 14 | driftinitialramp=0): 15 | super().__init__(start=start,duration=duration,depth=depth,coefdt=coefdt,function_psi=function_psi, 16 | function_beta=function_beta,swl=swl,center=center,width=width) 17 | self.driftinitialramp = driftinitialramp 18 | self.smooth = smooth 19 | self.dpz = dpz 20 | self.movedata = [0, 0, 0] if movedata is None else movedata 21 | self.usevelz = usevelz 22 | self.filesvelx_count = filesvelx_count 23 | self.filesvelx_initial = filesvelx_initial 24 | self.filesvel = filesvel 25 | self.coefdir = [1, 0, 0] if coefdir is None else coefdir 26 | self.driftcorrection = driftcorrection 27 | -------------------------------------------------------------------------------- /mod/dataobjects/relaxation_zone/relaxation_zone_regular.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Regular Relaxation Zone data. """ 4 | 5 | from mod.dataobjects.relaxation_zone.relaxation_zone import RelaxationZone 6 | 7 | class RelaxationZoneRegular(RelaxationZone): 8 | """ Relaxation zone for regular wave generation """ 9 | 10 | def __init__(self, start=0, duration=0, waveorder=1, waveheight=1, waveperiod=2, depth=1, swl=1, center=None, 11 | width=0.5, phase=0, ramp=0, 12 | savemotion_periods=24, savemotion_periodsteps=20, savemotion_xpos=0, savemotion_zpos=0, 13 | coefdir=None, coefdt=1000, function_psi=0.9, function_beta=1, driftcorrection=0): 14 | super().__init__(start=start, duration=duration, depth=depth, coefdt=coefdt, function_psi=function_psi, 15 | function_beta=function_beta,swl=swl,center=center,width=width) 16 | self.waveorder = waveorder 17 | self.waveheight = waveheight 18 | self.waveperiod = waveperiod 19 | self.phase = phase 20 | self.ramp = ramp 21 | self.savemotion_periods = savemotion_periods 22 | self.savemotion_periodsteps = savemotion_periodsteps 23 | self.savemotion_xpos = savemotion_xpos 24 | self.savemotion_zpos = savemotion_zpos 25 | self.coefdir = [1, 0, 0] if coefdir is None else coefdir 26 | self.driftcorrection = driftcorrection 27 | -------------------------------------------------------------------------------- /mod/dataobjects/relaxation_zone/relaxation_zone_uniform.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Uniform Relaxation Zone data """ 4 | 5 | 6 | from mod.dataobjects.relaxation_zone.relaxation_zone import RelaxationZone 7 | 8 | 9 | class RelaxationZoneUniform(RelaxationZone): 10 | """ Relaxation zone for uniform velocity wave generation """ 11 | 12 | def __init__(self, start=0, duration=0, domainbox_point=None, domainbox_size=None, domainbox_direction=None, 13 | domainbox_rotateaxis_angle=0, domainbox_rotateaxis_point1=None, domainbox_rotateaxis_point2=None, 14 | use_velocity=True, velocity=0, velocity_times=None, coefdt=1000, function_psi=0.9, function_beta=1): 15 | super().__init__(start=start, duration=duration, depth=0, coefdt=coefdt, function_psi=function_psi, 16 | function_beta=function_beta,swl=1,center=None,width=0.5) 17 | self.domainbox_point = domainbox_point or [0, 0, 0] 18 | self.domainbox_size = domainbox_size or [0, 0, 0] 19 | self.domainbox_direction = domainbox_direction or [0, 0, 0] 20 | self.domainbox_rotateaxis_angle = domainbox_rotateaxis_angle 21 | self.domainbox_rotateaxis_point1 = domainbox_rotateaxis_point1 or [0, 0, 0] 22 | self.domainbox_rotateaxis_point2 = domainbox_rotateaxis_point2 or [0, 0, 0] 23 | self.use_velocity = use_velocity 24 | self.velocity = velocity 25 | self.velocity_times = velocity_times or [] 26 | -------------------------------------------------------------------------------- /mod/dataobjects/variable_res/bufferbox.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from mod.dataobjects.configuration.simulation_domain import SimulationDomain 4 | 5 | 6 | class BufferBox: 7 | 8 | def __init__(self, id: int): 9 | self.id = id 10 | self.active : bool = True 11 | self.manual_placement : bool = False 12 | self.point : list = [0.0,0.0,0.0] 13 | self.size : list = [0.0,0.0,0.0] 14 | self.dp_ratio : float = 1.0 15 | self.buffer_size_h : int = 2 16 | self.overlapping_h : float = 0.0 17 | self.tracking_active : bool = False 18 | self.tracking_mkbound : int = 0 19 | self.parent : Union[BufferBox,None] = None 20 | self.transform_enabled : bool = False 21 | self.transform_move : list = [0.0,0.0,0.0] 22 | self.transform_rotate : list = [0.0, 0.0, 0.0] 23 | self.transform_rotate_radians : bool = False 24 | self.transform_center_enabled : bool = False 25 | self.transform_center : list = [0.0, 0.0, 0.0] 26 | self.domain : SimulationDomain = SimulationDomain() 27 | self.depth : float = 0.0 28 | self.fc_object_name : str = "" 29 | self.vreswavegen : bool = False 30 | #self.simulation_domain : SimulationDomain = SimulationDomain() 31 | 32 | 33 | def __str__(self): 34 | return f"(Id : {self.id} parent: {self.parent} depth : {self.depth})" 35 | 36 | def __repr__(self): 37 | return f"(Id : {self.id} parent: {self.parent} depth : {self.depth})" 38 | -------------------------------------------------------------------------------- /mod/lang/afrikaans.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/chinese-simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/chinese-traditional.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/croatian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/czech.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/dutch.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/finnish.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/french.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/german.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/hungarian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/italian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/japanese.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/korean.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/norwegian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/polish.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/portuguese-brazilian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/portuguese.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/romanian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/russian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/slovak.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/slovenian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/swedish.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/turkish.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/lang/ukrainian.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /mod/templates/feature_support_report.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Feature Support Report 8 | 9 | 10 | 11 |

Feature Support Report

12 |

This report shows the features supported by each one of the currently configured DualSPHysics suite tools.

13 |

GenCase ({gencase_fullname})

14 |

Features:

15 | 18 |

DualSPHysics ({dsph_fullname})

19 |

Features:

20 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /mod/templates/flowtool/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {each} 7 | -------------------------------------------------------------------------------- /mod/templates/flowtool/each.xml: -------------------------------------------------------------------------------- 1 | <{boxtype} {first_box_name} {second_box_name}>{divide_string} 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/accinput/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/accinput/each.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {savedata} 3 | {schemescale} 4 | {collisiondp} 5 | {objects_each} 6 | {linearspring_each} 7 | {hinge_each} 8 | {spheric_each} 9 | {pointline_each} 10 | {coulombdamping_each} 11 | {pulley_each} 12 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/collisiondp_active.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/collisiondp_inactive.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/links/coulombdamping/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/links/hinge/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/links/linearspring/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/links/pointline/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/links/pulley/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/links/spheric/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/links/spheric/idbody2.xml: -------------------------------------------------------------------------------- 1 | idbody2="{idbody2}" -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/objects/base.xml: -------------------------------------------------------------------------------- 1 | <{floating_type} id="{name}" mkbound="{mkbound}" {modelnormal_template}/> -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/objects/modelnormal_template.xml: -------------------------------------------------------------------------------- 1 | modelfile="AutoActual" modelnormal="{modelnormal_type}" -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/savedata.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/chrono/schemescale.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/damping/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/damping/box_each.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mod/templates/gencase/damping/cylinder_each.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mod/templates/gencase/damping/zone_each.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/definition.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/flexstruct/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/flexstruct/each.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {floatings_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/angularvelini.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {massbody} 3 | {float_property_attributes} 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/center.xml: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/inertia.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/linearvelini.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/massbody_prop.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/material.xml: -------------------------------------------------------------------------------- 1 | property="{material}" -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/rhopbody_attr.xml: -------------------------------------------------------------------------------- 1 | rhopbody="{floating_density_value}" -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/rotation.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/floatings/each/translation.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/gauges/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {gauges_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/gauges/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/gauges/flow.xml: -------------------------------------------------------------------------------- 1 | 2 | {common} 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mod/templates/gencase/gauges/force.xml: -------------------------------------------------------------------------------- 1 | 2 | {common} 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/gauges/maxz.xml: -------------------------------------------------------------------------------- 1 | 2 | {common} 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/gauges/swl.xml: -------------------------------------------------------------------------------- 1 | 2 | {common} 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/gauges/velocity.xml: -------------------------------------------------------------------------------- 1 | 2 | {common} 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/initials/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {initials_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/initials/linear.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/initials/parabolic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/initials/uniform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {useboxlimit_template} 3 | 4 | {useboxlimit_template} 5 | 6 | 7 | 8 | {each_zone} 9 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/each_zone.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {zoneinfo} 6 | 7 | {imposevelocity_param} 8 | 9 | 10 | {imposezsurf} 11 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/file_interpolated.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/file_linear.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/file_meshdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/file_parabolic.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/file_uniform.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/fixed_constant.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/fixed_jetcircle.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/fixed_linear.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/fixed_parabolic.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/variable_linear.xml: -------------------------------------------------------------------------------- 1 | 2 | {variable_linear_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/variable_linear_each.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/variable_parabolic.xml: -------------------------------------------------------------------------------- 1 | 2 | {variable_parabolic_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/variable_parabolic_each.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/variable_uniform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {variable_uniform_each} 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/imposevelocity/variable_uniform_each.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/useboxlimit/withfreecentre.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/useboxlimit/withoutfreecentre.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/generator_2d_rotation.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/generator_3d_rotation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/generator_box.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {generator_rotateaxis} 6 | {generator_rotateadv} 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/generator_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {generator_rotateaxis} 6 | {generator_rotateadv} 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/generator_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {generator_line_direction} 5 | {generator_line_rotation} 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/generator_line_rotation.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/generator_mk.xml: -------------------------------------------------------------------------------- 1 | 2 | {generator_custom_direction} 3 | {generator_mk_rotation} 4 | {generator_rotateadv} 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/rotateadv.xml: -------------------------------------------------------------------------------- 1 | 3 |
4 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/zone2d.xml: -------------------------------------------------------------------------------- 1 | 2 | {generator_template} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zoneinfo/zone3d.xml: -------------------------------------------------------------------------------- 1 | 2 | {generator_template} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zsurf/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {zsurf_mode_template} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zsurf/zsurf_automatic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zsurf/zsurf_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zsurf/zsurf_fixed.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zsurf/zsurf_meshdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zsurf/zsurf_timelist.xml: -------------------------------------------------------------------------------- 1 | 2 | {timevalue_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/inout/zsurf/zsurf_timelist_timevalue_each.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/materials/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {each_property} 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/materials/property.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/boundnormal_cylinder.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/boundnormal_parts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/boundnormal_plane.xml: -------------------------------------------------------------------------------- 1 | 2 | {bound_normal_point_template} 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/boundnormal_plane_point.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/boundnormal_plane_point_auto.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/boundnormal_set.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/boundnormal_sphere.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/geometry_for_normals_base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | actual | bound 5 | {objects_each} 6 | 7 | 8 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/mdbc_runlist.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/normals_base.xml: -------------------------------------------------------------------------------- 1 | 2 | {normals_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/mdbc/normals_geometry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/mlpistons/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {each} 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/mlpistons/each_1d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/mlpistons/each_2d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {each_veldata} 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/mlpistons/each_veldata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {each_mooredfloatings_template} 7 | 8 | {moordynplus_template} 9 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/body/compact.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/body/extended.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/line/ba.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/line/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {vessel1_template} 3 | {vessel2_template} 4 | {fix_template} 5 | 6 | 7 | {ea_template} 8 | {diameter_template} 9 | {massDenInAir_template} 10 | {ba_template} 11 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/line/diameter.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/line/ea.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/line/fix_connection.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/line/massdeninair.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/line/vessel_connection.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moordynplus/moordynplus_file.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/moorings/moored_floatings.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {each_objreal} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {movements_list} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/movements_list.xml: -------------------------------------------------------------------------------- 1 | 2 | {motions_list} -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/next_attr.txt: -------------------------------------------------------------------------------- 1 | next="{next_index}" -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/acc_rectilinear.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/acc_rotational.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/circular.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/rectilinear.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/rotational.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/sinu_circular.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/sinu_rectilinear.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/sinu_rotational.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/normal/wait.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/null.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/special/file_gen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/special/file_path_gen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/special/file_rotate_adv_gen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/motion/each/special/file_rotational_gen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/base.xml: -------------------------------------------------------------------------------- 1 | actual | dp | bound 2 | {objects_each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/complex.xml: -------------------------------------------------------------------------------- 1 | {mktype_template} 2 | {setnormalinvert_template} 3 | 4 | {depth} 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/cube.xml: -------------------------------------------------------------------------------- 1 | {move_template} 2 | {rotation_template} 3 | {mktype_template} 4 | {setnormalinvert_template} 5 | 6 | {frdrawmode_template_enable} 7 | 8 | {boxfill} 9 | {layers} 10 | 11 | 12 | 13 | {frdrawmode_template_disable} 14 | {matrixreset_template} -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/cylinder.xml: -------------------------------------------------------------------------------- 1 | {move_template} 2 | {rotation_template} 3 | {mktype_template} 4 | {setnormalinvert_template} 5 | 6 | {frdrawmode_template_enable} 7 | 8 | {layers} 9 | 10 | 11 | 12 | {frdrawmode_template_disable} 13 | {matrixreset_template} -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/fillbox.xml: -------------------------------------------------------------------------------- 1 | {move_template} 2 | {rotation_template} 3 | {mktype_template} 4 | 5 | void 6 | 7 | 8 | 9 | {matrixreset_template} -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/frdrawmode_disable.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/frdrawmode_enable.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/matrixreset.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/mkbound.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/mkfluid.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/move.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/rotation.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/setnormalinvert.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/objects/each/sphere.xml: -------------------------------------------------------------------------------- 1 | {move_template} 2 | {rotation_template} 3 | {mktype_template} 4 | {setnormalinvert_template} 5 | 6 | {frdrawmode_template_enable} 7 | 8 | {layers} 9 | 10 | 11 | {frdrawmode_template_disable} 12 | {matrixreset_template} -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {each} 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/filtercylinder.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {ftfollow} 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/filtergroup.xml: -------------------------------------------------------------------------------- 1 | 2 | {each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/filtermk.xml: -------------------------------------------------------------------------------- 1 | 2 | <{mk_type_str} v="{mk_str}" comment="Selection by mk value (a value or a range of values " /> 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/filterplane.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {distance_str}{ftfollow} 5 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/filterpos.xml: -------------------------------------------------------------------------------- 1 | 2 | {pos_min_str} 3 | {pos_max_str}{ftfollow} 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/filtersphere.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {ftfollow} 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/filtertype.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/outfilters/ftfollow.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/periodicity/x_inc_y.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/periodicity/x_inc_z.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/periodicity/y_inc_x.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/periodicity/y_inc_z.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/periodicity/z_inc_x.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/periodicity/z_inc_y.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/properties/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {each_link} 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/gencase/properties/each_link.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/rzones/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {rzone} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/rzones/uniform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <_rotateaxis angle="{domainbox_rotateaxis_angle}" anglesunits="degrees"> 9 | 10 | 11 | 12 | 13 | {rzuniform_velocity} 14 | 15 | 16 | -------------------------------------------------------------------------------- /mod/templates/gencase/rzones/uniform_velocity.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/rzones/uniform_velocitytimes.xml: -------------------------------------------------------------------------------- 1 | 2 | {each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/rzones/uniform_velocitytimes_each.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/simulationdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/vres/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {vres_each} 4 | -------------------------------------------------------------------------------- /mod/templates/gencase/vres/each.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {tracking} 8 | {transform} 9 | {simulation_domain} 10 | {vres_each} 11 | -------------------------------------------------------------------------------- /mod/templates/gencase/vres/simulation_domain.xml: -------------------------------------------------------------------------------- 1 | 2 | {pos} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/vres/simulation_domain_pos.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mod/templates/gencase/vres/tracking.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mod/templates/gencase/vres/transform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /mod/templates/gencase/wavepaddles/awas_correction.xml: -------------------------------------------------------------------------------- 1 | <{correction_enabled}correction coefstroke="{coefstroke}" coefperiod="{coefperiod}" powerfunc="{powerfunc}" comment="Drift correction configuration (default=no applied)" /> -------------------------------------------------------------------------------- /mod/templates/gencase/wavepaddles/base.xml: -------------------------------------------------------------------------------- 1 | 2 | {each} 3 | -------------------------------------------------------------------------------- /mod/templates/gencase/wavepaddles/piston/regular.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {awas_template} 15 | -------------------------------------------------------------------------------- /mod/templates/scripts/linux/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | {custom_text} 3 | bindir={dir} -------------------------------------------------------------------------------- /mod/templates/scripts/linux/computeforces.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | cmpfces=$bindir"/ComputeForces_linux64" 3 | args="{args}" 4 | $cmpfces $args -------------------------------------------------------------------------------- /mod/templates/scripts/linux/floatinginfo.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | fltnfo=$bindir"/FloatingInfo_linux64" 3 | args="{args}" 4 | $fltnfo $args -------------------------------------------------------------------------------- /mod/templates/scripts/linux/flowtool.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | flwtool=$bindir"/FlowTool_linux64" 3 | args="{args}" 4 | $flwtool $args -------------------------------------------------------------------------------- /mod/templates/scripts/linux/gencase.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | gencase=$bindir"/GenCase_linux64" 3 | args="{args}" 4 | $gencase $args 5 | -------------------------------------------------------------------------------- /mod/templates/scripts/linux/isosurface.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | isosfce=$bindir"/IsoSurface_linux64" 3 | args="{args}" 4 | $isosfce $args -------------------------------------------------------------------------------- /mod/templates/scripts/linux/measuretool.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | msrtool=$bindir"/MeasureTool_linux64" 3 | args="{args}" 4 | $msrtool $args -------------------------------------------------------------------------------- /mod/templates/scripts/linux/partvtk.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | pvtk=$bindir"/PartVTK_linux64" 3 | args="{args}" 4 | $pvtk $args -------------------------------------------------------------------------------- /mod/templates/scripts/linux/simulate.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | dualsph=$bindir"/DualSPHysics5.4_linux64" 3 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$bindir 4 | args="{args}" 5 | $dualsph $args 6 | -------------------------------------------------------------------------------- /mod/templates/scripts/linux/simulate_vres.sh: -------------------------------------------------------------------------------- 1 | {common} 2 | dualsph=$bindir"/DualSPHysics5.4_linux64" 3 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$bindir 4 | args="{args}" 5 | $dualsph $args 6 | -------------------------------------------------------------------------------- /mod/templates/scripts/windows/common.bat: -------------------------------------------------------------------------------- 1 | {custom_text} 2 | set bindir={dir} 3 | -------------------------------------------------------------------------------- /mod/templates/scripts/windows/computeforces.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set cfces=%bindir%\ComputeForces_win64.exe 3 | set args={args} 4 | %cfces% %args% -------------------------------------------------------------------------------- /mod/templates/scripts/windows/floatinginfo.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set floatnfo=%bindir%\FloatingInfo_win64.exe 3 | set args={args} 4 | %floatnfo% %args% -------------------------------------------------------------------------------- /mod/templates/scripts/windows/flowtool.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set fltool=%bindir%\FlowTool_win64.exe 3 | set args={args} 4 | %fltool% %args% -------------------------------------------------------------------------------- /mod/templates/scripts/windows/gencase.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set gencase=%bindir%\Gencase_win64.exe 3 | set args={args} 4 | %gencase% %args% 5 | 6 | -------------------------------------------------------------------------------- /mod/templates/scripts/windows/isosurface.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set isosfce=%bindir%\IsoSurface_win64.exe 3 | set args={args} 4 | %isosfce% %args% -------------------------------------------------------------------------------- /mod/templates/scripts/windows/measuretool.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set msrtool=%bindir%\MeasureTool_win64.exe 3 | set args={args} 4 | %msrtool% %args% -------------------------------------------------------------------------------- /mod/templates/scripts/windows/partvtk.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set pvtk=%bindir%\PartVTK_win64.exe 3 | set args={args} 4 | %pvtk% %args% -------------------------------------------------------------------------------- /mod/templates/scripts/windows/simulate.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set dualsph=%bindir%\DualSPHysics5.4_win64.exe 3 | rem export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$bindir 4 | set args={args} 5 | %dualsph% %args% 6 | -------------------------------------------------------------------------------- /mod/templates/scripts/windows/simulate_vres.bat: -------------------------------------------------------------------------------- 1 | {common} 2 | set dualsph=%bindir%\VResolution\DualSPHysicsVRes_win64.exe 3 | rem export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$bindir 4 | set args={args} 5 | %dualsph% %args% 6 | -------------------------------------------------------------------------------- /mod/tools/gui_tools.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """DesignSPHysics GUI Utils. 4 | 5 | This module stores functionality useful for GUI 6 | operations in DesignSPHysics. 7 | 8 | """ 9 | 10 | import os 11 | 12 | from PySide2 import QtWidgets,QtGui 13 | 14 | 15 | def h_line_generator() -> QtWidgets.QFrame: 16 | """ Generates an horizontal line that can be used as a separator.""" 17 | to_ret = QtWidgets.QFrame() 18 | to_ret.setFrameShape(QtWidgets.QFrame.HLine) 19 | to_ret.setFrameShadow(QtWidgets.QFrame.Sunken) 20 | return to_ret 21 | 22 | 23 | def v_line_generator() -> QtWidgets.QFrame: 24 | """ Generates a vertical line that can be used as a separator""" 25 | to_ret = QtWidgets.QFrame() 26 | to_ret.setFrameShape(QtWidgets.QFrame.VLine) 27 | to_ret.setFrameShadow(QtWidgets.QFrame.Sunken) 28 | return to_ret 29 | 30 | 31 | def get_icon(file_name, return_only_path=False) -> QtGui.QIcon: 32 | """ Returns a QIcon to use with DesignSPHysics. Retrieves a file with filename (like image.png) from the images folder. """ 33 | file_to_load = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + "/../images/{}".format(file_name) 34 | if os.path.isfile(file_to_load): 35 | return file_to_load if return_only_path else QtGui.QIcon(file_to_load) 36 | raise IOError("File {} not found in images folder".format(file_name)) 37 | -------------------------------------------------------------------------------- /mod/tools/template_tools.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | 4 | """ Template loading and formatting related tools. """ 5 | 6 | from os import path 7 | 8 | from mod.functions import get_mod_path 9 | from mod.tools.stdout_tools import debug 10 | 11 | 12 | def get_template_text(template_path) -> str: 13 | """ Returns the text for a given template. """ 14 | template_data = "" 15 | mod_folder = get_mod_path()#path.dirname(path.dirname(path.realpath(__file__))) 16 | 17 | with open("{}{}".format(mod_folder, template_path), "r", encoding="utf-8") as template: 18 | template_data = template.read() 19 | return template_data 20 | 21 | 22 | def obj_to_dict(obj, classkey=None): 23 | """ Converts an object to dictionary recursively. """ 24 | if isinstance(obj, dict): 25 | data = {} 26 | for (k, v) in obj.items(): 27 | data[k] = obj_to_dict(v, classkey) 28 | return data 29 | if hasattr(obj, "_ast"): 30 | return obj_to_dict(obj._ast()) # pylint: disable=protected-access 31 | if hasattr(obj, "__iter__") and not isinstance(obj, str): 32 | return [obj_to_dict(v, classkey) for v in obj] 33 | if hasattr(obj, "__dict__"): 34 | data = {key: obj_to_dict(value, classkey) for key, value in obj.__dict__.items() if not callable(value) and not key.startswith("_")} 35 | if classkey is not None and hasattr(obj, "__class__"): 36 | data[classkey] = obj.__class__.__name__ 37 | return data 38 | return obj 39 | -------------------------------------------------------------------------------- /mod/tools/translation_tools.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | 4 | """ Translation related tools. """ 5 | 6 | from os import path 7 | import json 8 | 9 | import FreeCADGui 10 | 11 | 12 | 13 | 14 | def __(text): 15 | """ Translation helper. Takes a string and tries to return its translation to the current FreeCAD locale. 16 | If the translation is missing or the file does not exists, return default english string. """ 17 | # Get FreeCAD current language 18 | freecad_locale = FreeCADGui.getLocale().lower().replace(", ", "-").replace(" ", "-") 19 | 20 | # Find mod directory 21 | mod_directory = path.dirname(path.dirname(path.abspath(__file__))) 22 | # Open translation file and print the matching string, if it's defined. 23 | filename = "{mod_directory}/lang/{locale}.json".format(mod_directory=mod_directory, locale=freecad_locale) 24 | 25 | if not path.isfile(filename): 26 | filename = "{mod_directory}/lang/{locale}.json".format(mod_directory=mod_directory, locale="english") 27 | 28 | with open(filename, "r", encoding="utf-8") as f: 29 | translation = json.load(f) 30 | 31 | # Tries to return the translation. It it does not exist, creates it 32 | to_ret = translation.get(text, None) 33 | 34 | if not to_ret: 35 | translation[text] = text 36 | with open(filename, "w", encoding="utf-8") as f: 37 | json.dump(translation, f, indent=4) 38 | return text 39 | return to_ret 40 | -------------------------------------------------------------------------------- /mod/widgets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/widgets/__init__.py -------------------------------------------------------------------------------- /mod/widgets/custom_widgets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/widgets/custom_widgets/__init__.py -------------------------------------------------------------------------------- /mod/widgets/custom_widgets/acceleration_input.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | from PySide2 import QtWidgets, QtCore 4 | 5 | import FreeCADGui 6 | import FreeCAD 7 | 8 | from mod.constants import DEFAULT_MAX_WIDGET_WIDTH, DEFAULT_MIN_WIDGET_WIDTH 9 | from mod.tools.dialog_tools import warning_dialog 10 | from mod.tools.stdout_tools import debug 11 | from mod.widgets.custom_widgets.base_units_input import BaseUnitsInput 12 | 13 | 14 | 15 | class AccelerationInput(BaseUnitsInput): 16 | 17 | def __init__(self, min_val=-10e12,max_val=10e12,minwidth=DEFAULT_MIN_WIDGET_WIDTH, maxwidth=DEFAULT_MAX_WIDGET_WIDTH,parent=None,value=0):#maxwidth=45 18 | super().__init__(min_val,max_val,minwidth,maxwidth,parent) 19 | # Initialize unit system 20 | self.auto_update = False 21 | self.quantity_box.setMagnitude(pre_unit="",pos_unit="/s^2") 22 | self.setValue(value) 23 | 24 | def setValue(self, value): 25 | super().setValue(value,self.getUnits(),convert=False) 26 | 27 | def on_change(self): 28 | self._value = super().value_from_text() 29 | self.setValue(self._value) 30 | self.value_changed.emit() -------------------------------------------------------------------------------- /mod/widgets/custom_widgets/density_input.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import FreeCAD 4 | 5 | from mod.constants import DEFAULT_MIN_WIDGET_WIDTH, DEFAULT_MAX_WIDGET_WIDTH 6 | from mod.tools.dialog_tools import warning_dialog 7 | from mod.tools.stdout_tools import debug 8 | from mod.widgets.custom_widgets.base_units_input import BaseUnitsInput 9 | 10 | 11 | 12 | class DensityInput(BaseUnitsInput): 13 | 14 | def __init__(self, min_val=-10e12,max_val=10e12,minwidth=DEFAULT_MIN_WIDGET_WIDTH, maxwidth=DEFAULT_MAX_WIDGET_WIDTH,parent=None,value=0):#maxwidth=45 15 | super().__init__(min_val,max_val,minwidth,maxwidth,parent) 16 | # Initialize unit system 17 | self.auto_update = False 18 | self.quantity_box.setMagnitude(pre_unit="kg/",pos_unit="^3") 19 | self.setValue(value) 20 | 21 | def setValue(self, value): 22 | super().setValue(value,self.getUnits(),convert=False) 23 | 24 | def on_change(self): 25 | self._value = super().value_from_text() 26 | self.setValue(self._value) 27 | self.value_changed.emit() -------------------------------------------------------------------------------- /mod/widgets/custom_widgets/focusable_combo_box.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """ DesignSPHysics Focusable ComboBox implementation. """ 4 | 5 | from mod.constants import DEFAULT_MIN_WIDGET_WIDTH, DEFAULT_MAX_WIDGET_WIDTH 6 | from PySide2 import QtCore, QtWidgets 7 | 8 | 9 | class FocusableComboBox(QtWidgets.QComboBox): 10 | """ A ComboBox that emits the focus signal with a help text as a parameter when focusing it on the GUI. """ 11 | focus = QtCore.Signal(str) 12 | help_text = "" 13 | 14 | def __init__(self, parent=None,min_width=DEFAULT_MIN_WIDGET_WIDTH,max_width=600): 15 | super().__init__(parent=parent) 16 | self.setMinimumWidth(min_width) 17 | self.setMaximumWidth(max_width) 18 | 19 | 20 | def set_help_text(self, help_text): 21 | """ Sets the help text for the combobox. """ 22 | self.help_text = help_text 23 | 24 | def focusInEvent(self, *args, **kwargs): 25 | """ Redefines the focusInEvent from QtWidgets.QComboBox adding a focus signal fire. """ 26 | QtWidgets.QComboBox.focusInEvent(self, *args, **kwargs) 27 | self.focus.emit(self.help_text) 28 | -------------------------------------------------------------------------------- /mod/widgets/custom_widgets/pressure_input.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import FreeCAD 4 | 5 | from mod.constants import DEFAULT_MIN_WIDGET_WIDTH, DEFAULT_MAX_WIDGET_WIDTH 6 | from mod.tools.dialog_tools import warning_dialog 7 | from mod.tools.stdout_tools import debug 8 | from mod.widgets.custom_widgets.base_units_input import BaseUnitsInput 9 | 10 | 11 | 12 | class PressureInput(BaseUnitsInput): 13 | 14 | def __init__(self, min_val=-10e12,max_val=10e12,minwidth=DEFAULT_MIN_WIDGET_WIDTH, maxwidth=DEFAULT_MAX_WIDGET_WIDTH,parent=None,value=0):#maxwidth=45 15 | super().__init__(min_val,max_val,minwidth,maxwidth,parent) 16 | # Initialize unit system 17 | self.auto_update = False 18 | self.quantity_box.setUnit("Pa") 19 | self.setValue(value) 20 | 21 | def setValue(self, value): 22 | super().setValue(value,self.getUnits(),convert=False) 23 | 24 | def on_change(self): 25 | self._value = super().value_from_text() 26 | self.setValue(self._value) 27 | self.value_changed.emit() -------------------------------------------------------------------------------- /mod/widgets/custom_widgets/size_input.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import FreeCAD 4 | 5 | from mod.constants import DEFAULT_MIN_WIDGET_WIDTH, DEFAULT_MAX_WIDGET_WIDTH,AUTO_UNITS_SELECT 6 | from mod.tools.dialog_tools import warning_dialog 7 | from mod.tools.stdout_tools import debug 8 | from mod.widgets.custom_widgets.base_units_input import BaseUnitsInput 9 | 10 | 11 | 12 | class SizeInput(BaseUnitsInput): 13 | 14 | def __init__(self, min_val=-10e12,max_val=10e12,minwidth=DEFAULT_MIN_WIDGET_WIDTH, maxwidth=DEFAULT_MAX_WIDGET_WIDTH,parent=None,value=0):#maxwidth=45 15 | super().__init__(min_val,max_val,minwidth,maxwidth,parent) 16 | # Initialize unit system 17 | # self.quantity_box.setUnit("m") #{}".format(__("Select or create a movement to edit its properties"))) 20 | 21 | self.placeholder_layout.addStretch(1)#0.5 not valid.... 22 | self.placeholder_layout.addWidget(self.placeholder_text) 23 | self.placeholder_layout.addStretch(1) 24 | 25 | self.main_layout.addStretch(1) 26 | self.main_layout.addLayout(self.placeholder_layout) 27 | self.main_layout.addStretch(1) 28 | 29 | self.setLayout(self.main_layout) 30 | -------------------------------------------------------------------------------- /mod/widgets/properties_widgets/motion/wave_movement_actions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.7 2 | # -*- coding: utf-8 -*- 3 | """DesignSPHysics Wave Movement Actions Widget. """ 4 | 5 | from PySide2 import QtCore, QtWidgets 6 | from mod.tools.gui_tools import get_icon 7 | from mod.tools.translation_tools import __ 8 | 9 | 10 | class WaveMovementActions(QtWidgets.QWidget): 11 | """ A set of wave movement actions (use and delete) with its custom signals""" 12 | delete = QtCore.Signal(int) 13 | use = QtCore.Signal(int, bool) 14 | 15 | def __init__(self, index, use_checked, parent=None): 16 | super().__init__(parent=parent) 17 | self.index = index 18 | self.use_checkbox = QtWidgets.QCheckBox(__("Use")) 19 | self.use_checkbox.setChecked(use_checked) 20 | self.use_checkbox.stateChanged.connect(self.on_use) 21 | self.delete_button = QtWidgets.QPushButton(get_icon("trash.png"), None) 22 | self.delete_button.clicked.connect(self.on_delete) 23 | 24 | self.main_layout = QtWidgets.QHBoxLayout() 25 | self.main_layout.setContentsMargins(10, 0, 10, 0) 26 | self.main_layout.addWidget(self.use_checkbox) 27 | self.main_layout.addWidget(self.delete_button) 28 | self.setLayout(self.main_layout) 29 | 30 | def on_delete(self): 31 | """ Reacts to the delete button being pressed. """ 32 | self.delete.emit(self.index) 33 | 34 | def on_use(self): 35 | """ Reacts to the use checkbox being pressed. """ 36 | self.use.emit(self.index, self.use_checkbox.isChecked()) 37 | -------------------------------------------------------------------------------- /mod/xml/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/xml/__init__.py -------------------------------------------------------------------------------- /mod/xml/renderers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualSPHysics/DesignSPHysics/aad84d5aa8adc3575239a14acd911b9c9d78d451/mod/xml/renderers/__init__.py -------------------------------------------------------------------------------- /mod/xml/renderers/accinput_renderer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ Accinput template renderer. 3 | 4 | Renders the tag of the GenCase XML. 5 | """ 6 | 7 | from mod.constants import LINE_END 8 | from mod.tools.template_tools import get_template_text 9 | 10 | 11 | class AccinputRenderer(): 12 | """ Renders the tag of the GenCase XML. """ 13 | 14 | ACCINPUT_BASE = "/templates/gencase/accinput/base.xml" 15 | ACCINPUT_EACH = "/templates/gencase/accinput/each.xml" 16 | 17 | @classmethod 18 | def render(cls, data): 19 | """ Returns the rendered string. """ 20 | if data["acceleration_input"]["enabled"] == "false": 21 | return "" 22 | 23 | accinput_template_list: list = list() 24 | 25 | for accinput in data["acceleration_input"]["acclist"]: 26 | accinput["globalgravity_int"] = 1 if accinput["globalgravity"] else 0 27 | accinput_template_list.append(get_template_text(cls.ACCINPUT_EACH).format(**accinput)) 28 | 29 | formatter: dict = { 30 | "each": LINE_END.join(accinput_template_list) 31 | } 32 | 33 | return get_template_text(cls.ACCINPUT_BASE).format(**formatter) 34 | -------------------------------------------------------------------------------- /mod/xml/renderers/definition_renderer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ Definition template renderer. 3 | 4 | Renders the tag of the GenCase XML. 5 | """ 6 | 7 | import FreeCAD 8 | 9 | from mod.constants import DIVIDER 10 | from mod.tools.template_tools import get_template_text 11 | 12 | 13 | class DefinitionRenderer(): 14 | """ Renders the tag of the GenCase XML. """ 15 | 16 | DEFINITION_XML = "/templates/gencase/definition.xml" 17 | 18 | @classmethod 19 | def render(cls, data): 20 | """ Returns the rendered string. """ 21 | template = get_template_text(cls.DEFINITION_XML) 22 | fc_object = FreeCAD.ActiveDocument.getObject("Case_Limits") 23 | min_point = fc_object.Placement.Base 24 | # Note: 'pointref' is defined in "Define Constants" layout 25 | if data["constants"]["setpointref_hdp"] == "true": 26 | pointref= ["#Dp/2","#Dp/2","#Dp/2"] 27 | else: 28 | pointref=data["constants"]["pointref"] 29 | formatter = { 30 | "pointref" : pointref, 31 | "dp": data["dp"], 32 | "pointmin": [min_point.x / DIVIDER, min_point.y / DIVIDER, min_point.z / DIVIDER], 33 | "pointmax": [ 34 | min_point.x / DIVIDER + fc_object.Length.Value / DIVIDER, 35 | min_point.y / DIVIDER + fc_object.Width.Value / DIVIDER if data["mode3d"] == "true" else min_point.y / DIVIDER, 36 | min_point.z / DIVIDER + fc_object.Height.Value / DIVIDER 37 | ] 38 | } 39 | return template.format(**formatter) 40 | -------------------------------------------------------------------------------- /mod/xml/renderers/flexstruct_renderer.py: -------------------------------------------------------------------------------- 1 | from mod.constants import LINE_END 2 | from mod.functions import is_key 3 | from mod.tools.template_tools import get_template_text 4 | 5 | 6 | class FlexStructRenderer: 7 | BASE_XML = "/templates/gencase/flexstruct/base.xml" 8 | EACH_XML = "/templates/gencase/flexstruct/each.xml" 9 | @classmethod 10 | def render(cls,data): 11 | flex_structs: dict = dict() 12 | for mk, mk_prop in data["mkbasedproperties"].items(): 13 | if is_key(mk_prop,"flex_struct") and mk_prop["flex_struct"] and mk_prop["flex_struct"]["enabled"]=="true": 14 | flex_structs[mk] = mk_prop["flex_struct"] 15 | if not flex_structs.values(): 16 | return "" 17 | 18 | each_flex_struct_template: list = list() 19 | for mk, flex_struct in flex_structs.items(): 20 | flex_struct.update({"mk": mk}) 21 | each_flex_struct_template.append(get_template_text(cls.EACH_XML).format(**flex_struct)) 22 | 23 | 24 | formatter = { 25 | "each": LINE_END.join(each_flex_struct_template) 26 | } 27 | 28 | return get_template_text(cls.BASE_XML).format(**formatter) 29 | -------------------------------------------------------------------------------- /mod/xml/renderers/parameters_renderer.py: -------------------------------------------------------------------------------- 1 | from mod.constants import LINE_END 2 | from mod.tools.stdout_tools import debug 3 | from mod.tools.template_tools import get_template_text 4 | 5 | 6 | class ParametersRenderer: 7 | """ Renders the gauges of the GenCase XML. """ 8 | 9 | BASE_XML = "/templates/gencase/parameters.xml" 10 | 11 | 12 | @classmethod 13 | def render(cls, data): 14 | if data["execution_parameters"]["shifting"]==4: 15 | pass 16 | else: 17 | pass 18 | result = get_template_text(cls.BASE_XML).format(**data) 19 | return result -------------------------------------------------------------------------------- /mod/xml/renderers/properties_renderer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ Properties template renderer. 3 | 4 | Renders the tag of the GenCase XML. 5 | """ 6 | 7 | from mod.constants import LINE_END, MKFLUID_LIMIT 8 | from mod.tools.template_tools import get_template_text 9 | 10 | 11 | class PropertiesRenderer(): 12 | """ Renders the tag of the GenCase XML. """ 13 | 14 | PROPERTIES_BASE = "/templates/gencase/properties/base.xml" 15 | EACH_LINK_XML = "/templates/gencase/properties/each_link.xml" 16 | 17 | @classmethod 18 | def render(cls, data): 19 | """ Returns the rendered string. """ 20 | each_link_templates: list = list() 21 | 22 | for mkreal, mkbasedproperty in data["mkbasedproperties"].items(): 23 | if mkbasedproperty["property"]: 24 | each_formatter: dict = { 25 | "mkbound": mkreal - MKFLUID_LIMIT, 26 | "property_name": mkbasedproperty["property"]["name"], 27 | } 28 | each_link_templates.append(get_template_text(cls.EACH_LINK_XML).format(**each_formatter)) 29 | 30 | if not each_link_templates: 31 | return "" 32 | 33 | if data["execution_parameters"]["rigidalgorithm"] not in (2, 3): 34 | return "" 35 | 36 | formatter: dict = { 37 | "each_link": LINE_END.join(each_link_templates) 38 | } 39 | 40 | return get_template_text(cls.PROPERTIES_BASE).format(**formatter) 41 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | DesignSPHysics 4 | DesignSPHysics is a macro/addon for FreeCAD that provides a Graphical User Interface for fluid and multi-physics solver DualSPHysics 5 | 0.8.1 (29-05-2025) 6 | 29-05-2025 7 | Iván Martínez Estévez 8 | GPL-3.0-or-later 9 | https://github.com/DualSPHysics/DesignSPHysics 10 | images/icon.svg 11 | 12 | 13 | 14 | ./ 15 | 0.21 16 | images/icon.svg 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Ensure the target directory exists 4 | mkdir -p dualsphysics 5 | 6 | # Download the contents of CCC/BBB into AAA/BBB 7 | wget -r -np -nH --cut-dirs=2 -P . \ 8 | --accept "*.linux64,*.exe,*.so,*.dll,*.out,*.txt,*.zip,*.tar,*.gz" \ 9 | --reject "*.html*,*index*" \ 10 | "https://dual.sphysics.org/sphcourse/DualSPHysics-bin/dualsphysics.tar.gz" 11 | 12 | tar -xf dualsphysics.tar.gz 13 | rm -rf dualsphysics.tar.gz 14 | 15 | chmod +x dualsphysics/bin/* 16 | 17 | echo "Download completed" 18 | --------------------------------------------------------------------------------