[FEM] rewrite initial velocity constraint

- same as #8963 but for initial velocity

- add an example file that demonstrates the influence of the initial velocity
- some fine-tuning for the existing flow example
This commit is contained in:
Uwe
2023-03-20 04:28:45 +01:00
parent b496a41cd1
commit 866ea2551d
9 changed files with 623 additions and 175 deletions

View File

@@ -6,40 +6,27 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>300</width>
<height>174</height>
</rect>
</property>
<property name="windowTitle">
<string>Constraint Properties</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="volocityXLbl">
<property name="text">
<string>Velocity x:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="Gui::InputField" name="velocityXTxt">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="3">
<widget class="QCheckBox" name="formulaXCB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="unit" stdset="0">
<string>m/s</string>
<property name="text">
<string>formula</string>
</property>
</widget>
</item>
<item>
<item row="0" column="3">
<widget class="QCheckBox" name="velocityXBox">
<property name="text">
<string>unspecified</string>
@@ -49,31 +36,52 @@
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="velocityYLbl">
<property name="text">
<string>Velocity y:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="Gui::InputField" name="velocityYTxt">
<property name="enabled">
<bool>false</bool>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="unit" stdset="0">
<string>m/s</string>
<item row="0" column="0">
<widget class="QLabel" name="volocityXLbl">
<property name="text">
<string>Velocity x:</string>
</property>
</widget>
</item>
<item>
<item row="1" column="1">
<widget class="QLineEdit" name="formulaX">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::QuantitySpinBox" name="velocityX">
<property name="enabled">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="3">
<widget class="QCheckBox" name="formulaYCB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>formula</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="velocityYLbl">
<property name="text">
<string>Velocity y:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="velocityYBox">
<property name="text">
<string>unspecified</string>
@@ -83,31 +91,28 @@
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="velocityZLbl">
<property name="text">
<string>Velocity z:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="Gui::InputField" name="velocityZTxt">
<item row="1" column="1">
<widget class="QLineEdit" name="formulaY">
<property name="enabled">
<bool>false</bool>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::QuantitySpinBox" name="velocityY">
<property name="enabled">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string>m/s</string>
<string notr="true"/>
</property>
</widget>
</item>
<item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="3">
<widget class="QCheckBox" name="velocityZBox">
<property name="text">
<string>unspecified</string>
@@ -117,15 +122,49 @@
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="formulaZCB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>formula</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="velocityZLbl">
<property name="text">
<string>Velocity z:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="formulaZ">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::QuantitySpinBox" name="velocityZ">
<property name="enabled">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::InputField</class>
<extends>QLineEdit</extends>
<header>Gui/InputField.h</header>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
</customwidgets>
<resources/>
@@ -133,96 +172,48 @@
<connection>
<sender>velocityXBox</sender>
<signal>toggled(bool)</signal>
<receiver>velocityXTxt</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>230</x>
<y>44</y>
</hint>
<hint type="destinationlabel">
<x>230</x>
<y>18</y>
</hint>
</hints>
</connection>
<connection>
<sender>velocityXBox</sender>
<signal>toggled(bool)</signal>
<receiver>velocityXTxt</receiver>
<receiver>formulaXCB</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>230</x>
<y>44</y>
<x>351</x>
<y>19</y>
</hint>
<hint type="destinationlabel">
<x>230</x>
<y>18</y>
<x>351</x>
<y>45</y>
</hint>
</hints>
</connection>
<connection>
<sender>velocityYBox</sender>
<signal>toggled(bool)</signal>
<receiver>velocityYTxt</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>347</x>
<y>53</y>
</hint>
<hint type="destinationlabel">
<x>184</x>
<y>53</y>
</hint>
</hints>
</connection>
<connection>
<sender>velocityYBox</sender>
<signal>toggled(bool)</signal>
<receiver>velocityYTxt</receiver>
<receiver>formulaYCB</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>347</x>
<y>53</y>
<x>351</x>
<y>73</y>
</hint>
<hint type="destinationlabel">
<x>184</x>
<y>53</y>
<x>351</x>
<y>99</y>
</hint>
</hints>
</connection>
<connection>
<sender>velocityZBox</sender>
<signal>toggled(bool)</signal>
<receiver>velocityZTxt</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>347</x>
<y>87</y>
</hint>
<hint type="destinationlabel">
<x>184</x>
<y>87</y>
</hint>
</hints>
</connection>
<connection>
<sender>velocityZBox</sender>
<signal>toggled(bool)</signal>
<receiver>velocityZTxt</receiver>
<receiver>formulaZCB</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>347</x>
<y>87</y>
<x>351</x>
<y>127</y>
</hint>
<hint type="destinationlabel">
<x>184</x>
<y>87</y>
<x>351</x>
<y>153</y>
</hint>
</hints>
</connection>