FEM: Add ElectricInfinity- and CapacitanceMatrix- boundary condition for Elmer

This commit is contained in:
HoWil
2020-02-18 21:40:15 +01:00
committed by Bernd Hahnebach
parent 4c368c7c21
commit ce30e9217f
5 changed files with 94 additions and 11 deletions

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<height>154</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,15 +17,74 @@
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="1" column="0">
<item row="0" column="0">
<widget class="QLabel" name="potentialLbl">
<property name="text">
<string>Potential:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="potentialConstantBox">
<property name="text">
<string>Potential Constant</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="electricInfinityBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Farfield / Electric infinity</string>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="capacitanceBodyBox">
<property name="text">
<string>unspecified</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="capacitanceBody_spinBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="maximumSize">
<size>
<width>55</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize">
<size>
<width>1</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="Gui::InputField" name="potentialTxt">
<property name="enabled">
@@ -51,10 +110,10 @@
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="potentialConstantBox">
<item row="4" column="0">
<widget class="QLabel" name="capacityBody_label">
<property name="text">
<string>Potential Constant</string>
<string extracomment="Enabled by 'Calculate Capacity Matrix' in Electrostatic equation">Capacity Body: </string>
</property>
</widget>
</item>

View File

@@ -120,6 +120,14 @@ class _TaskPanel(object):
self._paramWidget.potentialConstantBox.setChecked(
self._obj.PotentialConstant)
self._paramWidget.electricInfinityBox.setChecked(
self._obj.ElectricInfinity)
self._paramWidget.capacitanceBodyBox.setChecked(
not self._obj.CapacitanceBodyEnabled)
self._paramWidget.capacitanceBody_spinBox.setValue(
self._obj.CapacitanceBody)
def _applyWidgetChanges(self):
unit = "V"
self._obj.PotentialEnabled = \

View File

@@ -44,4 +44,15 @@ class Proxy(FemConstraint.Proxy):
"Parameter", "Potential Enabled"),
obj.addProperty(
"App::PropertyBool", "PotentialConstant",
"Parameter", "Potential Constant")
"Parameter", "Potential Constant"),
obj.addProperty( # Howil added
"App::PropertyBool", "ElectricInfinity",
"Parameter", "Electric Infinity")
obj.addProperty(
"App::PropertyInteger", "CapacitanceBody",
"Parameter", "Capacitance Body")
obj.addProperty(
"App::PropertyBool", "CapacitanceBodyEnabled",
"Parameter", "Capacitance Body Enabled")

View File

@@ -54,10 +54,10 @@ class Proxy(linear.Proxy, equationbase.ElectrostaticProxy):
obj.addProperty(
"App::PropertyBool", "CalculateSurfaceCharge",
"Electrostatic", "Select type of solver for linear system")
obj.addProperty(
"App::PropertyBool", "CalculateCapacitanceMatrix",
"Electrostatic", "Select type of solver for linear system")
"""
#obj.addProperty(
#"App::PropertyBool", "CalculateCapacitanceMatrix",
#"Electrostatic", "Select type of solver for linear system")
#obj.addProperty(
#"App::PropertyInteger", "CapacitanceBodies",
#"Electrostatic", "Select type of solver for linear system")

View File

@@ -362,6 +362,11 @@ class Writer(object):
self._boundary(name, "Potential", potential)
if obj.PotentialConstant:
self._boundary(name, "Potential Constant", True)
if obj.ElectricInfinity:
self._boundary(name, "Electric Infinity BC", True)
if obj.CapacitanceBodyEnabled:
if hasattr(obj, 'CapacitanceBody'):
self._boundary(name, "Capacitance Body", obj.CapacitanceBody)
self._handled(obj)
def _handleFluxsolver(self):