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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ DesignSPHysics is currently under development and not ready for consumer use. It
This document was updated at 31 of July, 2018. It is probable that the project has been modified since then and this document does not contain correct information.

# How to contribute
Theres 2 main ways to contribute: Opening issues and contributing to the code. Below you can find information about the 2.
There's 2 main ways to contribute: Opening issues and contributing to the code. Below you can find information about the 2.

## Opening issues
You can open issues in [this github repository](https://github.com/DualSPHysics/DesignSPHysics) to report errors or suggest new features or how to improve them. Keep in mind that there are a lot of things left to do and probably most of the missing features are coming eventually. The most useful feedback right now is error reporting and fixing.

## Contributing to the code
To contribute to the project please check the following section (Project Structure) as it contains a brief description about how the project is structure and where to find the related code for each UI element.

To submit code please make your changes onto the `develop` branch and open a pull request. The current mantainer of the code will check it as soon as possible to merge the change onto the branch.
To submit code please make your changes onto the `develop` branch and open a pull request. The current maintainer of the code will check it as soon as possible to merge the change onto the branch.

# Project structure
## Branches
Expand Down Expand Up @@ -49,7 +49,7 @@ For example, when the "Load Case" button is pressed, the function binded to it g

To implement a new UI component with a feature just create, for example, a button and a function to execute when pressed.

The main data structure is a Python Dictionary with different data attached to its keys. To see a reference to the strucutre, check the `get_default_data()` function in `mod.utils`.
The main data structure is a Python Dictionary with different data attached to its keys. To see a reference to the structure, check the `get_default_data()` function in `mod.utils`.

# Need more help?
If you need help on how to contribute please contact one of the following people
Expand Down
2 changes: 1 addition & 1 deletion DesignSPHysics.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
# Establishing references for the different elements that the script will use later.
fc_main_window = FreeCADGui.getMainWindow() # FreeCAD main window

# TODO: Big Change: This should definetly be a custom class like DesignSPHysicsDock(QtGui.QDockWidget)
# TODO: Big Change: This should definitely be a custom class like DesignSPHysicsDock(QtGui.QDockWidget)
dsph_main_dock = QtGui.QDockWidget() # DSPH main dock
# Scaffolding widget, only useful to apply to the dsph_dock widget
dsph_main_dock_scaff_widget = QtGui.QWidget()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Check the [Official Webpage](http://design.sphysics.org) for downloads and more
![Screenshot](http://design.sphysics.org/img/github-shot-31072018.png)

## Description
DesignSPHysics enables the user to create cases with solids and fluids and exports it to a DualSPHysics compatbile format. In addition, it does the hard work for the user, generating the case automatically, simulating, and post-processing, all inside FreeCAD.
DesignSPHysics enables the user to create cases with solids and fluids and exports it to a DualSPHysics compatible format. In addition, it does the hard work for the user, generating the case automatically, simulating, and post-processing, all inside FreeCAD.

It includes support for pre-processing with GenCase, simulation with DualSPHysics and post-processign with several tools of the DualSPHysics package.

Expand All @@ -31,7 +31,7 @@ By default, for example, in Windows, it is located in `%appdata%/FreeCAD/Mod` or

Next open the folder and copy the file `DesignSPHysics.FCMacro` into the FreeCAD macro directory (`%appdata%/FreeCAD/Macro` on Windows; `~/.FreeCAD/Macro` on GNU/Linux).

### Installing a develompent build
### Installing a development build
Clone this repository and rename the folder to 'DesignSPHysics'. Then copy the folder to the Mod folder of the FreeCAD installation directory.

By default, for example, in Windows, it is located in `%appdata%/FreeCAD/Mod` or in Linux in `~/.FreeCAD/Mod`
Expand Down
2 changes: 1 addition & 1 deletion dualsphysics/bin/DsphConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<dsphconfig date="21-05-2018 19:24:00">
<common>
<createdirs v="1" comment="Creates full path for output files (0=No, 1=Yes)" />
<csvseparator v="0" comment="Separator character in CSV files (0=semicolon, 1=coma)" />
<csvseparator v="0" comment="Separator character in CSV files (0=semicolon, 1=comma)" />
</common>
</dsphconfig>
2 changes: 1 addition & 1 deletion mod/dataobjects/acc_rect_motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AccRectMotion(BaseMotion):

Attributes:
velocity: Velocity vector that defines the movement
acceleration: Acceleration vector that defines the aceleration
acceleration: Acceleration vector that defines the acceleration
'''

def __init__(self, duration=1, velocity=None, acceleration=None, parent_movement=None):
Expand Down
2 changes: 1 addition & 1 deletion mod/dataobjects/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
''' DesignSPHysics case constans dataobject '''
''' DesignSPHysics case constants dataobject '''

class Constants():
''' DualSPHysics case constants definition dataobject. '''
Expand Down
6 changes: 3 additions & 3 deletions mod/dataobjects/domain_fixed_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class DomainFixedParameter():
''' Fixed Domain for a DSPH case.

Attributes:
xmin = Minimun X coordinate for the fixed domain
xmin = Minimum X coordinate for the fixed domain
xmax = Maximum X coordinate for the fixed domain
ymin = Minimun Y coordinate for the fixed domain
ymin = Minimum Y coordinate for the fixed domain
ymax = Maximum Y coordinate for the fixed domain
zmin = Minimun Z coordinate for the fixed domain
zmin = Minimum Z coordinate for the fixed domain
zmax = Maximum Z coordinate for the fixed domain
'''

Expand Down
2 changes: 1 addition & 1 deletion mod/dataobjects/ml_piston_2d_veldata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
''' DesignSPHysics VelData atribute data. '''
''' DesignSPHysics VelData attribute data. '''


class MLPiston2DVeldata():
Expand Down
2 changes: 1 addition & 1 deletion mod/freecad_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def document_count() -> int:


def document_open(document_name: str) -> bool:
''' Returns wether the specified document name is opened within freecad. '''
''' Returns whether the specified document name is opened within freecad. '''
return document_name.lower() in list(FreeCAD.listDocuments().keys())[0].lower()


Expand Down
4 changes: 2 additions & 2 deletions mod/lang/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"Enables motion for the selected MKBound": "Enables motion for the selected MKBound",
"File Name": "File Name",
"Estimated time to complete simulation: ": "Estimated time to complete simulation: ",
"Press 'Move up' to move an object up in the hirearchy.\nPress 'Move down' to move an object down in the hirearchy.": "Press 'Move up' to move an object up in the hirearchy.\nPress 'Move down' to move an object down in the hirearchy.",
"Press 'Move up' to move an object up in the hierarchy.\nPress 'Move down' to move an object down in the hierarchy.": "Press 'Move up' to move an object up in the hierarchy.\nPress 'Move down' to move an object down in the hierarchy.",
"There was an error on the post-processing.": "There was an error on the post-processing.",
"Open {}_Fluid": "Open {}_Fluid",
"Y positions (separated by commas):": "Y positions (separated by commas):",
Expand Down Expand Up @@ -692,7 +692,7 @@
"Spring radius: ": "Spring radius: ",
"Length for revolution: ": "Length for revolution: ",
"Error!": "Error!",
"bodies are necesary!": "bodies are necesary!",
"bodies are necessary!": "bodies are necessary!",
"Link pointline configuration": "Link pointline configuration",
"Sliding Vector: ": "Sliding Vector: ",
"Point for rotation: ": "Point for rotation: ",
Expand Down
4 changes: 2 additions & 2 deletions mod/lang/spanish.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"Scaling factor: ": "Scaling factor: ",
"Threshold to detect free surface. Typically 1.5 for 2D and 2.75 for 3D (default=0).": "Threshold to detect free surface. Typically 1.5 for 2D and 2.75 for 3D (default=0).",
"Interaction kernel": "Interaction kernel",
"Minimium time step": "Minimium time step",
"Minimum time step": "Minimum time step",
"DT Time (s): ": "DT Time (s): ",
"Gencase exported {} particles.\nPress \"Details\" to check the output": "Gencase exported {} particles.\nPress \"Details\" to check the output",
"Selects an mass/density calculation method and its value.": "Selects an mass/density calculation method and its value.",
Expand Down Expand Up @@ -595,7 +595,7 @@
"Import GEO options": "Import GEO options",
"GEO File: ": "GEO File: ",
"Error!": "Error!",
"bodies are necesary!": "bodies are necesary!",
"bodies are necessary!": "bodies are necessary!",
"This will apply the initials properties to all objects with mkfluid = ": "This will apply the initials properties to all objects with mkfluid = ",
"Velocity (m/s): ": "Velocity (m/s): ",
"2": "2",
Expand Down
2 changes: 1 addition & 1 deletion mod/templates/case_summary_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h3>Execution parameters</h3><div/>
<b>Time out data:</b> {timeout}<br/>
<b>Increase of Z+:</b> {incz} %<br/>
<b>Fluid particles allowed to be excluded from domain:</b> {partsoutmax} %<br/>
<b>Miniumum rhop valid:</b> {rhopoutmin}<br/>
<b>Minimum rhop valid:</b> {rhopoutmin}<br/>
<b>Maximum rhop valid:</b> {rhopoutmax}

</body>
Expand Down
2 changes: 1 addition & 1 deletion mod/templates/gencase/simulationdomain.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<simulationdomain comment="Defines domain of simulation (default=Uses minimun and maximum position of the generated particles)" >
<simulationdomain comment="Defines domain of simulation (default=Uses minimum and maximum position of the generated particles)" >
<posmin x="{posmin_x}" y="{posmin_y}" z="{posmin_z}" comment="e.g.: x=0.5, y=default-1, z=default-10%" />
<posmax x="{posmax_x}" y="{posmax_y}" z="{posmax_z}"/>
</simulationdomain>
2 changes: 1 addition & 1 deletion mod/templates/template.bat
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if not "%ERRORLEVEL%" == "0" goto fail
if not "%ERRORLEVEL%" == "0" goto fail

:success
echo "------- Execution complete. If results were not the exepected ones check for errors. Make sure your case has a correct DP specification. -------"
echo "------- Execution complete. If results were not the expected ones check for errors. Make sure your case has a correct DP specification. -------"
goto end

:fail
Expand Down
2 changes: 1 addition & 1 deletion mod/widgets/acc_circular_motion_timeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
'''DesignSPHysics Acclerated Circular Motion Timeline widget'''
'''DesignSPHysics Accelerated Circular Motion Timeline widget'''

from PySide import QtGui, QtCore

Expand Down
4 changes: 2 additions & 2 deletions mod/widgets/constants_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class ConstantsDialog(QtGui.QDialog):
''' A window to define and configure the constans of the case for later execution
''' A window to define and configure the constants of the case for later execution
in the DualSPHysics simulator. '''
def __init__(self):
super(ConstantsDialog, self).__init__()
Expand Down Expand Up @@ -119,7 +119,7 @@ def __init__(self):
self.rhop0_layout.addWidget(self.rhop0_input)
self.rhop0_layout.addWidget(self.rhop0_label2)

# Maximum still water lavel to calc. spdofsound using coefsound: layout and
# Maximum still water level to calc. spdofsound using coefsound: layout and
# components
self.hswlauto_layout = QtGui.QHBoxLayout()
self.hswlauto_chk = QtGui.QCheckBox("Auto HSWL ")
Expand Down
4 changes: 2 additions & 2 deletions mod/widgets/execution_parameters_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def __init__(self):
self.dtini_layout.addWidget(self.dtini_label2)
self.on_dtiniauto_check()

# Minimium time step
# Minimum time step
self.dtminauto_layout = QtGui.QHBoxLayout()
self.dtminauto_chk = QtGui.QCheckBox("Minimum time step: ")
if Case.instance().execution_parameters.dtmin_auto:
Expand All @@ -303,7 +303,7 @@ def __init__(self):
self.dtminauto_chk.toggled.connect(self.on_dtminauto_check)
self.dtminauto_layout.addWidget(self.dtminauto_chk)
self.dtmin_layout = QtGui.QHBoxLayout()
self.dtmin_label = QtGui.QLabel("Minimium time step: ")
self.dtmin_label = QtGui.QLabel("Minimum time step: ")
self.dtmin_input = FocusableLineEdit()
self.dtmin_input.setHelpText(__(HELP_DTMIN))
self.dtmin_input.setMaxLength(10)
Expand Down
2 changes: 1 addition & 1 deletion mod/widgets/export_progress_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class ExportProgressDialog(QtGui.QDialog):
''' Export Progres Dialog. '''
''' Export Progress Dialog. '''

on_cancel = QtCore.Signal()

Expand Down
2 changes: 1 addition & 1 deletion mod/widgets/float_state_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __init__(self):
self.floating_omegaini_layout.addWidget(self.floating_omegaini_auto)

self.floating_translation_layout = QtGui.QHBoxLayout()
self.floating_translation_label = QtGui.QLabel(__("Traslation restriction: "))
self.floating_translation_label = QtGui.QLabel(__("Translation restriction: "))
self.floating_translation_label.setToolTip(__("Use 0 for translation restriction in the movement (default=(1,1,1))"))
self.floating_translation_label_x = QtGui.QLabel("X")
self.floating_translation_input_x = QtGui.QComboBox()
Expand Down
2 changes: 1 addition & 1 deletion mod/widgets/link_hinge_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ def on_save(self):
else:
link_hinge_error_dialog = QtGui.QMessageBox()
link_hinge_error_dialog.setWindowTitle(__("Error!"))
link_hinge_error_dialog.setText(__("bodies are necesary!"))
link_hinge_error_dialog.setText(__("bodies are necessary!"))
link_hinge_error_dialog.setIcon(QtGui.QMessageBox.Critical)
link_hinge_error_dialog.exec_()
2 changes: 1 addition & 1 deletion mod/widgets/link_linear_spring_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,6 @@ def on_save(self):
else:
link_linearspring_error_dialog = QtGui.QMessageBox()
link_linearspring_error_dialog.setWindowTitle(__("Error!"))
link_linearspring_error_dialog.setText(__("bodies are necesary!"))
link_linearspring_error_dialog.setText(__("bodies are necessary!"))
link_linearspring_error_dialog.setIcon(QtGui.QMessageBox.Critical)
link_linearspring_error_dialog.exec_()
2 changes: 1 addition & 1 deletion mod/widgets/link_point_line_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,6 @@ def on_save(self):
else:
link_pointline_error_dialog = QtGui.QMessageBox()
link_pointline_error_dialog.setWindowTitle(__("Error!"))
link_pointline_error_dialog.setText(__("body 1 is necesary!"))
link_pointline_error_dialog.setText(__("body 1 is necessary!"))
link_pointline_error_dialog.setIcon(QtGui.QMessageBox.Critical)
link_pointline_error_dialog.exec_()
2 changes: 1 addition & 1 deletion mod/widgets/link_spheric_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ def on_save(self):
else:
link_spheric_error_dialog = QtGui.QMessageBox()
link_spheric_error_dialog.setWindowTitle(__("Error!"))
link_spheric_error_dialog.setText(__("body 1 is necesary!"))
link_spheric_error_dialog.setText(__("body 1 is necessary!"))
link_spheric_error_dialog.setIcon(QtGui.QMessageBox.Critical)
link_spheric_error_dialog.exec_()
4 changes: 2 additions & 2 deletions mod/widgets/properties_dock_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def on_remove_object_from_sim(self):
self.need_refresh.emit()

def on_damping_config(self):
''' Configures the damping configuration for the selected obejct '''
''' Configures the damping configuration for the selected object '''
DampingConfigDialog(FreeCADGui.Selection.getSelection()[0].Name)

def on_mkgroup_change(self, value):
Expand Down Expand Up @@ -341,7 +341,7 @@ def set_mkgroup_text(self, text: str) -> None:
self.mkgroup_label.setText(text)

def get_cell_widget(self, row: int, column: int) -> QtGui.QWidget:
''' Retrieves the appropiate QWidget for the row and column specified from the table. '''
''' Retrieves the appropriate QWidget for the row and column specified from the table. '''
return self.object_property_table.cellWidget(row, column)

def fit_size(self) -> None:
Expand Down
6 changes: 3 additions & 3 deletions mod/xmlimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def create_fc_objects(f, path):
FreeCAD.ActiveDocument.getObject("Box" + str(elementnum)).Length = str(size[0]) + ' m'
FreeCAD.ActiveDocument.getObject("Box" + str(elementnum)).Width = str(size[1]) + ' m'
FreeCAD.ActiveDocument.getObject("Box" + str(elementnum)).Height = str(size[2]) + ' m'
# Suscribe Box for creation in DSPH Objects
# Subscribe Box for creation in DSPH Objects
# Structure: [name] = [mknumber, type, fill]
to_add_dsph["Box" + str(elementnum)] = [int(mk[1]), mk[0], drawmode]
elif command.tag == "drawcylinder":
Expand Down Expand Up @@ -211,7 +211,7 @@ def create_fc_objects(f, path):
FreeCAD.Rotation(FreeCAD.Vector(rotation[1], rotation[2], rotation[3]), rotation[0]))
FreeCAD.ActiveDocument.getObject("Cylinder" + str(elementnum)).Radius = str(radius) + ' m'
FreeCAD.ActiveDocument.getObject("Cylinder" + str(elementnum)).Height = (top_point[2] - point[2]) * 1000
# Suscribe Cylinder for creation in DSPH Objects
# Subscribe Cylinder for creation in DSPH Objects
# Structure: [name] = [mknumber, type, fill]
to_add_dsph["Cylinder" + str(elementnum)] = [int(mk[1]), mk[0], drawmode]
elif command.tag == "drawsphere":
Expand All @@ -230,7 +230,7 @@ def create_fc_objects(f, path):
(point[2] + movement[2]) * 1000),
FreeCAD.Rotation(FreeCAD.Vector(rotation[1], rotation[2], rotation[3]), rotation[0]))
FreeCAD.ActiveDocument.getObject("Sphere" + str(elementnum)).Radius = str(radius) + ' m'
# Suscribe Sphere for creation in DSPH Objects
# Subscribe Sphere for creation in DSPH Objects
# Structure: [name] = [mknumber, type, fill]
to_add_dsph["Sphere" + str(elementnum)] = [int(mk[1]), mk[0], drawmode]
elif command.tag == "drawfilestl":
Expand Down