From ac878c5eeb1778b0d2358b8923560a4e3b207b4d Mon Sep 17 00:00:00 2001 From: marioalexis Date: Sat, 1 Nov 2025 10:34:06 -0300 Subject: [PATCH 1/4] Fem: Add magnetic flux density boundary condition --- .../Resources/ui/ElectrostaticPotential.ui | 277 ++++++++++++++---- ...on_electrostatics_capacitance_two_balls.py | 2 +- .../constraint_electrostaticpotential.py | 103 ++++++- .../elmer/equations/electrostatic_writer.py | 2 +- .../equations/magnetodynamic2D_writer.py | 18 +- .../elmer/equations/magnetodynamic_writer.py | 87 ++++-- .../task_constraint_electrostaticpotential.py | 165 ++++++++++- 7 files changed, 554 insertions(+), 100 deletions(-) diff --git a/src/Mod/Fem/Gui/Resources/ui/ElectrostaticPotential.ui b/src/Mod/Fem/Gui/Resources/ui/ElectrostaticPotential.ui index 7d4ffb0def..a3f11b8bfd 100644 --- a/src/Mod/Fem/Gui/Resources/ui/ElectrostaticPotential.ui +++ b/src/Mod/Fem/Gui/Resources/ui/ElectrostaticPotential.ui @@ -103,8 +103,8 @@ with a harmonic/oscillating driving force false - - + + true @@ -114,7 +114,7 @@ with a harmonic/oscillating driving force - + true @@ -125,23 +125,13 @@ with a harmonic/oscillating driving force - - - true - + Scalar - - - - - - - true @@ -163,7 +153,7 @@ with a harmonic/oscillating driving force - + true @@ -186,23 +176,13 @@ with a harmonic/oscillating driving force - - - true - + X - - - - - - - true @@ -225,7 +205,7 @@ Note: has no effect if a solid was selected - + true @@ -249,23 +229,13 @@ Note: has no effect if a solid was selected - - - true - + Y - - - - - - - true @@ -288,7 +258,7 @@ Note: has no effect if a solid was selected - + true @@ -312,23 +282,13 @@ Note: has no effect if a solid was selected - - - true - + Z - - - - - - - true @@ -351,7 +311,7 @@ Note: has no effect if a solid was selected - + true @@ -380,15 +340,15 @@ Note: has no effect if a solid was selected - + true - Whether the boundary condition defines a farfield potential + Far field approximation assuming spherical symmetry - Electric infinity + Far field @@ -412,6 +372,8 @@ Note: has no effect if a solid was selected Neumann + + @@ -431,6 +393,213 @@ Note: has no effect if a solid was selected + + + + + To define magnetic flux density + + + Magnetic flux density + + + true + + + + + + + + + + true + + + Imaginary part is only used for equations +with a harmonic/oscillating driving force + + + false + + + + + + true + + + Real + + + + + + + true + + + Imaginary + + + + + + + X + + + + + + + true + + + Real part of magnetic flux density x-component + + + true + + + Wb/m^2 + + + 1.000000000000000 + + + 1.000000000000000 + + + + + + + true + + + Imaginary part of magnetic flux density x-component + + + true + + + Wb/m^2 + + + 1.000000000000000 + + + 1.000000000000000 + + + + + + + Y + + + + + + + true + + + Real part of magnetic flux density y-component + + + true + + + Wb/m^2 + + + 1.000000000000000 + + + 1.000000000000000 + + + + + + + true + + + Imaginary part of magnetic flux density y-component + + + true + + + Wb/m^2 + + + 1.000000000000000 + + + 1.000000000000000 + + + + + + + Z + + + + + + + true + + + Real part of magnetic flux density z-component + + + true + + + Wb/m^2 + + + 1.000000000000000 + + + 1.000000000000000 + + + + + + + true + + + Imaginary part of magnetic flux density z-component + + + true + + + Wb/m^2 + + + 1.000000000000000 + + + 1.000000000000000 + + + + + + + diff --git a/src/Mod/Fem/femexamples/equation_electrostatics_capacitance_two_balls.py b/src/Mod/Fem/femexamples/equation_electrostatics_capacitance_two_balls.py index 600e000c11..78eebc1fa4 100644 --- a/src/Mod/Fem/femexamples/equation_electrostatics_capacitance_two_balls.py +++ b/src/Mod/Fem/femexamples/equation_electrostatics_capacitance_two_balls.py @@ -141,7 +141,7 @@ def setup(doc=None, solvertype="elmer"): name_pot1 = "ElectrostaticPotential1" con_elect_pot1 = ObjectsFem.makeConstraintElectrostaticPotential(doc, name_pot1) con_elect_pot1.References = [(geom_obj, "Face1")] - con_elect_pot1.ElectricInfinity = True + con_elect_pot1.FarField = True con_elect_pot1.PotentialEnabled = False analysis.addObject(con_elect_pot1) diff --git a/src/Mod/Fem/femobjects/constraint_electrostaticpotential.py b/src/Mod/Fem/femobjects/constraint_electrostaticpotential.py index 26ac86f6cf..57a192260f 100644 --- a/src/Mod/Fem/femobjects/constraint_electrostaticpotential.py +++ b/src/Mod/Fem/femobjects/constraint_electrostaticpotential.py @@ -210,9 +210,9 @@ class ConstraintElectrostaticPotential(base_fempythonobject.BaseFemPythonObject) prop.append( _PropHelper( type="App::PropertyBool", - name="ElectricInfinity", + name="FarField", group="Parameter", - doc="Electric Infinity", + doc="Far field approximation assuming spherical symmetry", value=False, ) ) @@ -245,6 +245,89 @@ class ConstraintElectrostaticPotential(base_fempythonobject.BaseFemPythonObject) ) ) + prop.append( + _PropHelper( + type="App::PropertyMagneticFluxDensity", + name="Magnetic_re_1", + group="Magnetic Flux Density", + doc="Real part of magnetic flux density x-component", + value="0 Wb/m^2", + ) + ) + prop.append( + _PropHelper( + type="App::PropertyMagneticFluxDensity", + name="Magnetic_re_2", + group="Magnetic Flux Density", + doc="Real part of magnetic flux density y-component", + value="0 Wb/m^2", + ) + ) + prop.append( + _PropHelper( + type="App::PropertyMagneticFluxDensity", + name="Magnetic_re_3", + group="Magnetic Flux Density", + doc="Real part of magnetic flux density z-component", + value="0 Wb/m^2", + ) + ) + prop.append( + _PropHelper( + type="App::PropertyMagneticFluxDensity", + name="Magnetic_im_1", + group="Magnetic Flux Density", + doc="Imaginary part of magnetic flux density x-component", + value="0 Wb/m^2", + ) + ) + prop.append( + _PropHelper( + type="App::PropertyMagneticFluxDensity", + name="Magnetic_im_2", + group="Magnetic Flux Density", + doc="Imaginary part of magnetic flux density y-component", + value="0 Wb/m^2", + ) + ) + prop.append( + _PropHelper( + type="App::PropertyMagneticFluxDensity", + name="Magnetic_im_3", + group="Magnetic Flux Density", + doc="Imaginary part of magnetic flux density z-component", + value="0 Wb/m^2", + ) + ) + + prop.append( + _PropHelper( + type="App::PropertyBool", + name="EnableMagnetic_1", + group="Magnetic Flux Density", + doc="Enable magnetic flux density x-component boundary condition", + value=False, + ) + ) + prop.append( + _PropHelper( + type="App::PropertyBool", + name="EnableMagnetic_2", + group="Magnetic Flux Density", + doc="Enable magnetic flux density y-component boundary condition", + value=False, + ) + ) + prop.append( + _PropHelper( + type="App::PropertyBool", + name="EnableMagnetic_3", + group="Magnetic Flux Density", + doc="Enable magnetic flux density z-component boundary condition", + value=False, + ) + ) + return prop def onDocumentRestored(self, obj): @@ -281,7 +364,9 @@ class ConstraintElectrostaticPotential(base_fempythonobject.BaseFemPythonObject) obj.EnableAV_3 = not obj.getPropertyByName( "AV_re_3_Disabled" ) or not obj.getPropertyByName("AV_im_3_Disabled") - obj.EnableAV = not obj.getPropertyByName("AV_im_Disabled") + obj.EnableAV = not obj.getPropertyByName("AV_re_Disabled") or not obj.getPropertyByName( + "AV_im_Disabled" + ) # remove old properties obj.setPropertyStatus("AV_re_1_Disabled", "-LockDynamic") @@ -296,9 +381,10 @@ class ConstraintElectrostaticPotential(base_fempythonobject.BaseFemPythonObject) obj.removeProperty("AV_im_2_Disabled") obj.setPropertyStatus("AV_im_3_Disabled", "-LockDynamic") obj.removeProperty("AV_im_3_Disabled") + obj.setPropertyStatus("AV_re_Disabled", "-LockDynamic") + obj.removeProperty("AV_re_Disabled") obj.setPropertyStatus("AV_im_Disabled", "-LockDynamic") obj.removeProperty("AV_im_Disabled") - except Base.PropertyError: pass @@ -310,3 +396,12 @@ class ConstraintElectrostaticPotential(base_fempythonobject.BaseFemPythonObject) except Base.PropertyError: pass + + # rename ElectricInfinity + try: + obj.FarField = obj.getPropertyByName("ElectricInfinity") + obj.setPropertyStatus("ElectricInfinity", "-LockDynamic") + obj.removeProperty("ElectricInfinity") + + except Base.PropertyError: + pass diff --git a/src/Mod/Fem/femsolver/elmer/equations/electrostatic_writer.py b/src/Mod/Fem/femsolver/elmer/equations/electrostatic_writer.py index 9f6b2999be..14d9389c55 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/electrostatic_writer.py +++ b/src/Mod/Fem/femsolver/elmer/equations/electrostatic_writer.py @@ -138,7 +138,7 @@ class ESwriter: self.write.boundary(name, "Electric Flux", flux_density) if obj.PotentialConstant: self.write.boundary(name, "Potential Constant", True) - if obj.ElectricInfinity: + if obj.FarField: self.write.boundary(name, "Electric Infinity BC", True) if obj.ElectricForcecalculation: self.write.boundary(name, "Calculate Electric Force", True) diff --git a/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic2D_writer.py b/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic2D_writer.py index 2b0ffb93ab..17895cd139 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic2D_writer.py +++ b/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic2D_writer.py @@ -215,8 +215,24 @@ class MgDyn2Dwriter: potential = obj.AV_im_3.getValueAs("Wb/m") self.write.boundary(name, "Potential im", potential) - if obj.ElectricInfinity: + elif obj.BoundaryCondition == "Neumann": + if obj.EnableMagnetic_1: + b_1 = obj.Magnetic_re_1.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density 1", b_1) + if equation.IsHarmonic: + b_1 = obj.Magnetic_im_1.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density 1 im", b_1) + + if obj.EnableMagnetic_2: + b_2 = obj.Magnetic_re_2.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density 2", b_2) + if equation.IsHarmonic: + b_2 = obj.Magnetic_im_2.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density 2 im", b_2) + + if obj.FarField: self.write.boundary(name, "Infinity BC", True) + self.write.handled(obj) def handleMagnetodynamic2DEquation(self, bodies, equation): diff --git a/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic_writer.py b/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic_writer.py index cfb9095c95..95ba4e5aa7 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic_writer.py +++ b/src/Mod/Fem/femsolver/elmer/equations/magnetodynamic_writer.py @@ -282,38 +282,61 @@ class MgDynwriter: self.write.boundary(name, "Electric Current Density Im", current_density) if femutils.is_derived_from(obj, "Fem::ConstraintElectrostaticPotential"): - if obj.EnableAV: - potential = obj.AV_re.getValueAs("V") - if equation.IsHarmonic: - self.write.boundary(name, "AV re", potential) - potential = obj.AV_im.getValueAs("V") - self.write.boundary(name, "AV im", potential) - else: - self.write.boundary(name, "AV", potential) - if obj.EnableAV_1: - potential = obj.AV_re_1.getValueAs("Wb/m") - if equation.IsHarmonic: - self.write.boundary(name, "AV re {e} 1", potential) - potential = obj.AV_im_1.getValueAs("Wb/m") - self.write.boundary(name, "AV im {e} 1", potential) - else: - self.write.boundary(name, "AV {e} 1", potential) - if obj.EnableAV_2: - potential = obj.AV_re_2.getValueAs("Wb/m") - if equation.IsHarmonic: - self.write.boundary(name, "AV re {e} 2", potential) - potential = obj.AV_im_2.getValueAs("Wb/m") - self.write.boundary(name, "AV im {e} 2", potential) - else: - self.write.boundary(name, "AV {e} 2", potential) - if obj.EnableAV_3: - potential = obj.AV_re_3.getValueAs("Wb/m") - if equation.IsHarmonic: - self.write.boundary(name, "AV re {e} 3", potential) - potential = obj.AV_im_3.getValueAs("Wb/m") - self.write.boundary(name, "AV im {e} 3", potential) - else: - self.write.boundary(name, "AV {e} 3", potential) + if obj.BoundaryCondition == "Dirichlet": + if obj.EnableAV: + potential = obj.AV_re.getValueAs("V") + if equation.IsHarmonic: + self.write.boundary(name, "AV re", potential) + potential = obj.AV_im.getValueAs("V") + self.write.boundary(name, "AV im", potential) + else: + self.write.boundary(name, "AV", potential) + if obj.EnableAV_1: + potential = obj.AV_re_1.getValueAs("Wb/m") + if equation.IsHarmonic: + self.write.boundary(name, "AV re {e} 1", potential) + potential = obj.AV_im_1.getValueAs("Wb/m") + self.write.boundary(name, "AV im {e} 1", potential) + else: + self.write.boundary(name, "AV {e} 1", potential) + if obj.EnableAV_2: + potential = obj.AV_re_2.getValueAs("Wb/m") + if equation.IsHarmonic: + self.write.boundary(name, "AV re {e} 2", potential) + potential = obj.AV_im_2.getValueAs("Wb/m") + self.write.boundary(name, "AV im {e} 2", potential) + else: + self.write.boundary(name, "AV {e} 2", potential) + if obj.EnableAV_3: + potential = obj.AV_re_3.getValueAs("Wb/m") + if equation.IsHarmonic: + self.write.boundary(name, "AV re {e} 3", potential) + potential = obj.AV_im_3.getValueAs("Wb/m") + self.write.boundary(name, "AV im {e} 3", potential) + else: + self.write.boundary(name, "AV {e} 3", potential) + + elif obj.BoundaryCondition == "Neumann": + if obj.EnableMagnetic_1: + b1 = obj.Magnetic_re_1.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density 1", b1) + if equation.IsHarmonic: + b1 = obj.Magnetic_im_1.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density Im 1", b1) + + if obj.EnableMagnetic_2: + b2 = obj.Magnetic_re_2.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density 2", b2) + if equation.IsHarmonic: + b2 = obj.Magnetic_im_2.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density Im 2", b2) + + if obj.EnableMagnetic_3: + b3 = obj.Magnetic_re_3.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density 3", b3) + if equation.IsHarmonic: + b3 = obj.Magnetic_im_3.getValueAs("Wb/m^2") + self.write.boundary(name, "Magnetic Flux Density Im 3", b3) def handleMagnetodynamicBndConditions(self, equation): # the current density can either be a body force or a boundary constraint diff --git a/src/Mod/Fem/femtaskpanels/task_constraint_electrostaticpotential.py b/src/Mod/Fem/femtaskpanels/task_constraint_electrostaticpotential.py index e4d1b39c06..c6cbc3adfe 100644 --- a/src/Mod/Fem/femtaskpanels/task_constraint_electrostaticpotential.py +++ b/src/Mod/Fem/femtaskpanels/task_constraint_electrostaticpotential.py @@ -166,9 +166,9 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): self.potential_constant_changed, ) QtCore.QObject.connect( - self.parameter_widget.ckb_electric_infinity, + self.parameter_widget.ckb_far_field, QtCore.SIGNAL("toggled(bool)"), - self.electric_infinity_changed, + self.far_field_changed, ) QtCore.QObject.connect( self.parameter_widget.qsb_electric_flux_density, @@ -176,6 +176,58 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): self.electric_flux_density_changed, ) + QtCore.QObject.connect( + self.parameter_widget.ckb_magnetic, + QtCore.SIGNAL("toggled(bool)"), + self.magnetic_enabled_changed, + ) + + QtCore.QObject.connect( + self.parameter_widget.ckb_magnetic_1, + QtCore.SIGNAL("toggled(bool)"), + self.magnetic_1_enabled_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.qsb_magnetic_re_1, + QtCore.SIGNAL("valueChanged(Base::Quantity)"), + self.magnetic_re_1_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.qsb_magnetic_im_1, + QtCore.SIGNAL("valueChanged(Base::Quantity)"), + self.magnetic_im_1_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.ckb_magnetic_2, + QtCore.SIGNAL("toggled(bool)"), + self.magnetic_2_enabled_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.qsb_magnetic_re_2, + QtCore.SIGNAL("valueChanged(Base::Quantity)"), + self.magnetic_re_2_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.qsb_magnetic_im_2, + QtCore.SIGNAL("valueChanged(Base::Quantity)"), + self.magnetic_im_2_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.ckb_magnetic_3, + QtCore.SIGNAL("toggled(bool)"), + self.magnetic_3_enabled_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.qsb_magnetic_re_3, + QtCore.SIGNAL("valueChanged(Base::Quantity)"), + self.magnetic_re_3_changed, + ) + QtCore.QObject.connect( + self.parameter_widget.qsb_magnetic_im_3, + QtCore.SIGNAL("valueChanged(Base::Quantity)"), + self.magnetic_im_3_changed, + ) + self.init_parameter_widget() def open(self): @@ -229,11 +281,22 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): self.boundary_condition = self.obj.BoundaryCondition self.potential_constant = self.obj.PotentialConstant - self.electric_infinity = self.obj.ElectricInfinity + self.far_field = self.obj.FarField self.capacitance_body_enabled = self.obj.CapacitanceBodyEnabled self.capacitance_body = self.obj.CapacitanceBody self.electric_flux_density = self.obj.ElectricFluxDensity + self.magnetic_1_enabled = self.obj.EnableMagnetic_1 + self.magnetic_2_enabled = self.obj.EnableMagnetic_2 + self.magnetic_3_enabled = self.obj.EnableMagnetic_3 + + self.magnetic_re_1 = self.obj.Magnetic_re_1 + self.magnetic_re_2 = self.obj.Magnetic_re_2 + self.magnetic_re_3 = self.obj.Magnetic_re_3 + self.magnetic_im_1 = self.obj.Magnetic_im_1 + self.magnetic_im_2 = self.obj.Magnetic_im_2 + self.magnetic_im_3 = self.obj.Magnetic_im_3 + def _set_params(self): self.obj.Potential = self.potential self.obj.PotentialEnabled = self.potential_enabled @@ -254,12 +317,23 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): self.obj.BoundaryCondition = self.boundary_condition self.obj.PotentialConstant = self.potential_constant - self.obj.ElectricInfinity = self.electric_infinity + self.obj.FarField = self.far_field self.obj.CapacitanceBodyEnabled = self.capacitance_body_enabled self.obj.CapacitanceBody = self.capacitance_body self.obj.ElectricFluxDensity = self.electric_flux_density + self.obj.Magnetic_re_1 = self.magnetic_re_1 + self.obj.Magnetic_re_2 = self.magnetic_re_2 + self.obj.Magnetic_re_3 = self.magnetic_re_3 + self.obj.Magnetic_im_1 = self.magnetic_im_1 + self.obj.Magnetic_im_2 = self.magnetic_im_2 + self.obj.Magnetic_im_3 = self.magnetic_im_3 + + self.obj.EnableMagnetic_1 = self.magnetic_1_enabled + self.obj.EnableMagnetic_2 = self.magnetic_2_enabled + self.obj.EnableMagnetic_3 = self.magnetic_3_enabled + def init_parameter_widget(self): self._get_params() @@ -305,7 +379,7 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): self.parameter_widget.ckb_potential_constant.setChecked(self.potential_constant) - self.parameter_widget.ckb_electric_infinity.setChecked(self.electric_infinity) + self.parameter_widget.ckb_far_field.setChecked(self.far_field) self.parameter_widget.ckb_capacitance_body.setChecked(self.capacitance_body_enabled) self.parameter_widget.spb_capacitance_body.setProperty("value", self.capacitance_body) @@ -320,6 +394,43 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): self.obj, "ElectricFluxDensity" ) + # magnetic flux density + self.parameter_widget.qsb_magnetic_re_1.setProperty("value", self.magnetic_re_1) + self.parameter_widget.qsb_magnetic_re_1.setEnabled(self.magnetic_1_enabled) + FreeCADGui.ExpressionBinding(self.parameter_widget.qsb_magnetic_re_1).bind( + self.obj, "Magnetic_re_1" + ) + self.parameter_widget.qsb_magnetic_re_2.setProperty("value", self.magnetic_re_2) + self.parameter_widget.qsb_magnetic_re_2.setEnabled(self.magnetic_2_enabled) + FreeCADGui.ExpressionBinding(self.parameter_widget.qsb_magnetic_re_2).bind( + self.obj, "Magnetic_re_2" + ) + self.parameter_widget.qsb_magnetic_re_3.setProperty("value", self.magnetic_re_3) + self.parameter_widget.qsb_magnetic_re_3.setEnabled(self.magnetic_3_enabled) + FreeCADGui.ExpressionBinding(self.parameter_widget.qsb_magnetic_re_3).bind( + self.obj, "Magnetic_re_3" + ) + + self.parameter_widget.qsb_magnetic_im_1.setProperty("value", self.magnetic_im_1) + self.parameter_widget.qsb_magnetic_im_1.setEnabled(self.magnetic_1_enabled) + FreeCADGui.ExpressionBinding(self.parameter_widget.qsb_magnetic_im_1).bind( + self.obj, "Magnetic_im_1" + ) + self.parameter_widget.qsb_magnetic_im_2.setProperty("value", self.magnetic_im_2) + self.parameter_widget.qsb_magnetic_im_2.setEnabled(self.magnetic_2_enabled) + FreeCADGui.ExpressionBinding(self.parameter_widget.qsb_magnetic_im_2).bind( + self.obj, "Magnetic_im_2" + ) + self.parameter_widget.qsb_magnetic_im_3.setProperty("value", self.magnetic_im_3) + self.parameter_widget.qsb_magnetic_im_3.setEnabled(self.magnetic_3_enabled) + FreeCADGui.ExpressionBinding(self.parameter_widget.qsb_magnetic_im_3).bind( + self.obj, "Magnetic_im_3" + ) + + self.parameter_widget.ckb_magnetic_1.setChecked(self.magnetic_1_enabled) + self.parameter_widget.ckb_magnetic_2.setChecked(self.magnetic_2_enabled) + self.parameter_widget.ckb_magnetic_3.setChecked(self.magnetic_3_enabled) + self.bc_enum = self.obj.getEnumerationsOfProperty("BoundaryCondition") index = self.bc_enum.index(self.boundary_condition) self.parameter_widget.cb_boundary_condition.addItems(self.bc_enum) @@ -329,6 +440,10 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): if not (self.av_enabled or self.av_1_enabled or self.av_2_enabled or self.av_3_enabled): self.parameter_widget.ckb_electromagnetic.setChecked(False) + # start with magnetic inputs hidden if no field is set + if not (self.magnetic_1_enabled or self.magnetic_2_enabled or self.magnetic_3_enabled): + self.parameter_widget.ckb_magnetic.setChecked(False) + def potential_changed(self, value): self.potential = value @@ -386,8 +501,8 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): def potential_constant_changed(self, value): self.potential_constant = value - def electric_infinity_changed(self, value): - self.electric_infinity = value + def far_field_changed(self, value): + self.far_field = value def capacitance_body_enabled_changed(self, value): self.capacitance_body_enabled = value @@ -408,3 +523,39 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel): elif self.boundary_condition == "Neumann": self.parameter_widget.gb_neumann.setEnabled(True) self.parameter_widget.gb_dirichlet.setEnabled(False) + + def magnetic_enabled_changed(self, value): + self.parameter_widget.gb_magnetic.setVisible(value) + + def magnetic_1_enabled_changed(self, value): + self.magnetic_1_enabled = value + self.parameter_widget.qsb_magnetic_re_1.setEnabled(value) + self.parameter_widget.qsb_magnetic_im_1.setEnabled(value) + + def magnetic_2_enabled_changed(self, value): + self.magnetic_2_enabled = value + self.parameter_widget.qsb_magnetic_re_2.setEnabled(value) + self.parameter_widget.qsb_magnetic_im_2.setEnabled(value) + + def magnetic_3_enabled_changed(self, value): + self.magnetic_3_enabled = value + self.parameter_widget.qsb_magnetic_re_3.setEnabled(value) + self.parameter_widget.qsb_magnetic_im_3.setEnabled(value) + + def magnetic_re_1_changed(self, value): + self.magnetic_re_1 = value + + def magnetic_re_2_changed(self, value): + self.magnetic_re_2 = value + + def magnetic_re_3_changed(self, value): + self.magnetic_re_3 = value + + def magnetic_im_1_changed(self, value): + self.magnetic_im_1 = value + + def magnetic_im_2_changed(self, value): + self.magnetic_im_2 = value + + def magnetic_im_3_changed(self, value): + self.magnetic_im_3 = value From e5e1729c35a4953fc13ac4ace2b0fb5dca55345a Mon Sep 17 00:00:00 2001 From: marioalexis Date: Tue, 2 Dec 2025 13:34:01 -0300 Subject: [PATCH 2/4] Fem: Add magnetic shielding example --- src/Mod/Fem/CMakeLists.txt | 1 + .../Fem/femexamples/magnetic_shielding_2D.py | 163 ++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 src/Mod/Fem/femexamples/magnetic_shielding_2D.py diff --git a/src/Mod/Fem/CMakeLists.txt b/src/Mod/Fem/CMakeLists.txt index dbb030212c..083c07b367 100755 --- a/src/Mod/Fem/CMakeLists.txt +++ b/src/Mod/Fem/CMakeLists.txt @@ -98,6 +98,7 @@ SET(FemExamples_SRCS femexamples/equation_magnetostatics_2D_elmer.py femexamples/equation_staticcurrent_elmer.py femexamples/frequency_beamsimple.py + femexamples/magnetic_shielding_2D.py femexamples/manager.py femexamples/material_multiple_bendingbeam_fiveboxes.py femexamples/material_multiple_bendingbeam_fivefaces.py diff --git a/src/Mod/Fem/femexamples/magnetic_shielding_2D.py b/src/Mod/Fem/femexamples/magnetic_shielding_2D.py new file mode 100644 index 0000000000..b042fbb368 --- /dev/null +++ b/src/Mod/Fem/femexamples/magnetic_shielding_2D.py @@ -0,0 +1,163 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +# *************************************************************************** +# * Copyright (c) 2025 Mario Passaglia * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +# to run the example use: +""" +from femexamples.magnetic_shielding_2D import setup +setup() +""" + + +import sys +import FreeCAD + +import ObjectsFem +import Materials +import Part + +from . import manager + + +def get_information(): + return { + "name": "Magnetic shielding 2D", + "meshtype": "face", + "meshelement": "Tria6", + "constraints": ["electrostatic potential"], + "solvers": ["elmer"], + "material": "solid", + "equations": ["electromagnetic"], + } + + +def get_explanation(header=""): + return ( + header + + """ + +To run the example from Python console use: +from femexamples.magnetic_shielding_2D import setup +setup() + +Magnetostatic equation - Elmer solver + +""" + ) + + +def setup(doc=None, solvertype="elmer"): + + # init FreeCAD document + if doc is None: + doc = manager.init_doc() + + # explanation object + manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information()))) + + # geometric objects + c1 = Part.makeCircle(15) + c2 = Part.makeCircle(20) + c3 = Part.makeCircle(100) + f1 = Part.makeFace([c1]) + f2 = Part.makeFace([c1, c2]) + f3 = Part.makeFace([c2, c3]) + + shape = Part.makeShell([f1, f2, f3]) + shell = doc.addObject("Part::Feature", "Shell") + shell.Shape = shape + + if FreeCAD.GuiUp: + shell.ViewObject.Visibility = True + shell.ViewObject.Document.ActiveView.viewTop() + shell.ViewObject.Document.ActiveView.fitAll() + + # analysis + analysis = ObjectsFem.makeAnalysis(doc, "Analysis") + if FreeCAD.GuiUp: + import FemGui + + FemGui.setActiveAnalysis(analysis) + + # solver + if solvertype == "elmer": + solver_obj = ObjectsFem.makeSolverElmer(doc, "SolverElmer") + solver_obj.SimulationType = "Steady State" + solver_obj.CoordinateSystem = "Cartesian 2D" + eq_mgdyn_2d = ObjectsFem.makeEquationMagnetodynamic2D(doc, solver_obj) + eq_mgdyn_2d.References = [(shell, ("Face1", "Face2", "Face3"))] + else: + FreeCAD.Console.PrintWarning( + "Unknown or unsupported solver type: {}. " + "No solver object was created.\n".format(solvertype) + ) + analysis.addObject(solver_obj) + + # material + mat_manager = Materials.MaterialManager() + air = mat_manager.getMaterial("94370b96-c97e-4a3f-83b2-11d7461f7da7") + air_obj = ObjectsFem.makeMaterialFluid(doc, "Air") + air_obj.UUID = "94370b96-c97e-4a3f-83b2-11d7461f7da7" + air_obj.Material = air.Properties + + iron = mat_manager.getMaterial("1826c364-d26a-43fb-8f61-288281236836") + iron_obj = ObjectsFem.makeMaterialFluid(doc, "Iron") + iron_obj.UUID = "1826c364-d26a-43fb-8f61-288281236836" + iron_obj.Material = iron.Properties + + air_obj.References = [(shell, ("Face1","Face3"))] + iron_obj.References = [(shell, ("Face2",))] + analysis.addObject(air_obj) + analysis.addObject(iron_obj) + + # boundary condition + mg_den = ObjectsFem.makeConstraintElectrostaticPotential(doc, "MagneticDensity") + mg_den.References = [(shell, "Edge3")] + mg_den.BoundaryCondition = "Neumann" + mg_den.EnableMagnetic_1 = True + mg_den.Magnetic_re_1 = "10.0 G" + analysis.addObject(mg_den) + + # mesh + femmesh_obj = analysis.addObject(ObjectsFem.makeMeshGmsh(doc, manager.get_meshname()))[0] + femmesh_obj.Shape = shell + femmesh_obj.ElementOrder = "2nd" + femmesh_obj.CharacteristicLengthMax = "8 mm" + femmesh_obj.ViewObject.Visibility = False + # mesh_region + mesh_region = ObjectsFem.makeMeshRegion(doc, femmesh_obj, name="MeshRegion") + mesh_region.CharacteristicLength = "2 mm" + mesh_region.References = [(shell, "Face2")] + mesh_region.ViewObject.Visibility = False + + # generate the mesh + from femmesh import gmshtools + + gmsh_mesh = gmshtools.GmshTools(femmesh_obj, analysis) + try: + gmsh_mesh.create_mesh() + except Exception: + error = sys.exc_info()[1] + FreeCAD.Console.PrintError(f"Unexpected error when creating mesh: {error}\n") + + doc.recompute() + return doc From bfb0efd5f9af1b66a17e329c0e8a5d35b6952af0 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Tue, 16 Dec 2025 12:35:01 -0300 Subject: [PATCH 3/4] Base: Insert SPDX specifier in parser script --- src/Base/Parser.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Base/Parser.sh b/src/Base/Parser.sh index 601b395d3c..5d01ba19a9 100644 --- a/src/Base/Parser.sh +++ b/src/Base/Parser.sh @@ -3,6 +3,6 @@ (cd "$(dirname "$0")" && \ flex -oQuantity.lex.c Quantity.l && \ bison -oQuantity.tab.c Quantity.y && \ - sed -i '1s|^|// clang-format off\n|' Quantity.tab.c && \ - sed -i '1s|^|// clang-format off\n|' Quantity.lex.c \ + sed -i '1s|^|// SPDX-License-Identifier: LGPL-2.1-or-later\n\n// clang-format off\n|' Quantity.tab.c && \ + sed -i '1s|^|// SPDX-License-Identifier: LGPL-2.1-or-later\n\n// clang-format off\n|' Quantity.lex.c \ ) From 0f148f6e635e842967a0b5e1ebb25fcdc0043f6e Mon Sep 17 00:00:00 2001 From: marioalexis Date: Fri, 28 Nov 2025 18:18:21 -0300 Subject: [PATCH 4/4] Base: Add millitesla unit --- src/App/Expression.l | 1 + src/App/Expression.lex.c | 837 ++++++++++++++++++------------------ src/Base/Quantity.cpp | 1 + src/Base/Quantity.h | 1 + src/Base/Quantity.l | 1 + src/Base/Quantity.lex.c | 499 ++++++++++----------- src/Base/Quantity.tab.c | 84 ++-- src/Base/UnitsSchemasData.h | 4 +- 8 files changed, 722 insertions(+), 706 deletions(-) diff --git a/src/App/Expression.l b/src/App/Expression.l index f89bf02636..8c8e333593 100644 --- a/src/App/Expression.l +++ b/src/App/Expression.l @@ -289,6 +289,7 @@ EXPO [eE][-+]?[0-9]+ "C" COUNTCHARS; yylval.quantity.scaler = Quantity::Coulomb; yylval.quantity.unitStr = yytext; return UNIT; // Coulomb (A*s) "T" COUNTCHARS; yylval.quantity.scaler = Quantity::Tesla; yylval.quantity.unitStr = yytext; return UNIT; // Tesla (kg/s^2/A) +"mT" COUNTCHARS; yylval.quantity.scaler = Quantity::MilliTesla; yylval.quantity.unitStr = yytext; return UNIT; // milli Tesla "G" COUNTCHARS; yylval.quantity.scaler = Quantity::Gauss; yylval.quantity.unitStr = yytext; return UNIT; // Gauss (1 G = 1e-4 T) "Wb" COUNTCHARS; yylval.quantity.scaler = Quantity::Weber; yylval.quantity.unitStr = yytext; return UNIT; // Weber (kg*m^2/s^2/A) diff --git a/src/App/Expression.lex.c b/src/App/Expression.lex.c index 9672886e89..3024709533 100644 --- a/src/App/Expression.lex.c +++ b/src/App/Expression.lex.c @@ -1,7 +1,7 @@ // clang-format off -#line 2 "Expression.lex.c" +#line 1 "Expression.lex.c" -#line 4 "Expression.lex.c" +#line 3 "Expression.lex.c" #define YY_INT_ALIGNED short int @@ -613,8 +613,8 @@ static void yynoreturn yy_fatal_error ( const char* msg ); (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 150 -#define YY_END_OF_BUFFER 151 +#define YY_NUM_RULES 151 +#define YY_END_OF_BUFFER 152 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -624,51 +624,349 @@ struct yy_trans_info }; static const flex_int16_t yy_accept[3331] = { 0, - 0, 0, 151, 150, 1, 2, 150, 49, 4, 150, - 51, 4, 11, 4, 137, 8, 4, 7, 37, 149, - 98, 102, 100, 108, 113, 41, 130, 65, 149, 149, - 91, 99, 86, 82, 149, 149, 149, 149, 139, 149, - 31, 36, 149, 149, 21, 19, 149, 149, 149, 149, - 34, 33, 149, 149, 150, 150, 150, 150, 150, 150, + 0, 0, 152, 151, 1, 2, 151, 49, 4, 151, + 51, 4, 11, 4, 138, 8, 4, 7, 37, 150, + 98, 103, 101, 109, 114, 41, 131, 65, 150, 150, + 91, 99, 86, 82, 150, 150, 150, 150, 140, 150, + 31, 36, 150, 150, 21, 19, 150, 150, 150, 150, + 34, 33, 150, 150, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 1, + + 6, 0, 136, 135, 0, 0, 138, 0, 0, 10, + 5, 9, 0, 0, 149, 150, 150, 150, 133, 150, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 119, 150, 150, 150, + 23, 40, 150, 68, 150, 150, 89, 150, 150, 117, + 150, 150, 69, 150, 150, 150, 85, 102, 120, 150, + 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 150, 150, 47, 150, + 17, 150, 150, 18, 122, 150, 50, 150, 48, 39, + 150, 116, 67, 150, 150, 90, 87, 84, 150, 150, + 32, 20, 150, 59, 38, 104, 110, 115, 42, 66, + 92, 100, 88, 83, 150, 30, 55, 22, 16, 150, + 150, 107, 113, 13, 61, 108, 139, 150, 150, 150, + 62, 150, 150, 106, 112, 44, 93, 150, 28, 14, + + 54, 150, 127, 150, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 73, 125, 58, + 63, 128, 150, 130, 24, 150, 70, 121, 150, 123, + 80, 64, 60, 150, 150, 53, 35, 150, 45, 56, + 79, 129, 150, 150, 150, 150, 105, 111, 43, 94, + 150, 29, 15, 150, 150, 150, 150, 132, 134, 150, + 12, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 146, 0, 0, 136, + 0, 135, 3, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 1, - - 6, 0, 135, 134, 0, 0, 137, 0, 0, 10, - 5, 9, 0, 0, 148, 149, 149, 149, 132, 149, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 118, 149, 149, 149, - 23, 40, 149, 68, 149, 149, 89, 149, 149, 116, - 149, 149, 69, 149, 149, 149, 85, 101, 119, 149, - 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 149, 149, 47, 149, - 17, 149, 149, 18, 121, 149, 50, 149, 48, 39, - 149, 115, 67, 149, 149, 90, 87, 84, 149, 149, - 32, 20, 149, 59, 38, 103, 109, 114, 42, 66, - 92, 149, 88, 83, 149, 30, 55, 22, 16, 149, - 149, 106, 112, 13, 61, 107, 138, 149, 149, 149, - 62, 149, 149, 105, 111, 44, 93, 149, 28, 14, - - 54, 149, 126, 149, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 150, 97, 81, 141, 75, 142, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -676,320 +974,22 @@ static const flex_int16_t yy_accept[3331] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 150, 96, 126, 150, 74, 46, + 57, 52, 143, 150, 150, 150, 150, 150, 150, 0, + 0, 0, 0, 150, 150, 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 150, 150, 150, 150, + 150, 150, 144, 150, 150, 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0,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 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 73, 124, 58, - 63, 127, 149, 129, 24, 149, 70, 120, 149, 122, - 80, 64, 60, 149, 149, 53, 35, 149, 45, 56, - 79, 128, 149, 149, 149, 149, 104, 110, 43, 94, - 149, 29, 15, 149, 149, 149, 149, 131, 133, 149, - 12, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 145, 0, 0, 135, - 0, 134, 3, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 149, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 97, 81, 140, 75, 141, 149, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 149, 149, - - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 149, 96, 125, 149, 74, 46, - 57, 52, 142, 149, 149, 149, 149, 149, 149, 0, - 0, 0, 0, 149, 149, 149, 149, 149, 149, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 149, 149, 149, 149, - 149, 149, 143, 149, 149, 149, 149, 149, 149, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 149, 149, 149, 149, - 144, 76, 77, 149, 149, 149, 149, 149, 78, 0 + 0, 0, 0, 0, 0, 0, 150, 150, 150, 150, + 145, 76, 77, 150, 150, 150, 150, 150, 78, 0 } ; static const YY_CHAR yy_ec[256] = @@ -8602,14 +8602,14 @@ extern int column; #define COUNTCHARS do { last_column = column; column += yyleng; } while (0) -#line 8605 "Expression.lex.c" +#line 8604 "Expression.lex.c" /*** Flex Declarations and Options ***/ /* change the name of the scanner class. */ /* the manual says "somewhat more optimized" */ /* no support for include files is planned */ /* UTF-8 unicode regular expressions. */ /* http://www.unicode.org/reports/tr44/#General_Category_Values */ -#line 8612 "Expression.lex.c" +#line 8611 "Expression.lex.c" #define INITIAL 0 @@ -8827,7 +8827,7 @@ YY_DECL #line 163 "Expression.l" -#line 8830 "Expression.lex.c" +#line 8829 "Expression.lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -9380,27 +9380,27 @@ COUNTCHARS; yylval.quantity.scaler = Quantity::Tesla; yylval.quan case 100: YY_RULE_SETUP #line 292 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Gauss; yylval.quantity.unitStr = yytext; return UNIT; // Gauss (1 G = 1e-4 T) +COUNTCHARS; yylval.quantity.scaler = Quantity::MilliTesla; yylval.quantity.unitStr = yytext; return UNIT; // milli Tesla YY_BREAK case 101: YY_RULE_SETUP -#line 294 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Weber; yylval.quantity.unitStr = yytext; return UNIT; // Weber (kg*m^2/s^2/A) +#line 293 "Expression.l" +COUNTCHARS; yylval.quantity.scaler = Quantity::Gauss; yylval.quantity.unitStr = yytext; return UNIT; // Gauss (1 G = 1e-4 T) YY_BREAK case 102: YY_RULE_SETUP -#line 296 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Farad; yylval.quantity.unitStr = yytext; return UNIT; // Farad (s^4*A^2/m^2/kg) +#line 295 "Expression.l" +COUNTCHARS; yylval.quantity.scaler = Quantity::Weber; yylval.quantity.unitStr = yytext; return UNIT; // Weber (kg*m^2/s^2/A) YY_BREAK case 103: YY_RULE_SETUP #line 297 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::MilliFarad; yylval.quantity.unitStr = yytext; return UNIT; // milli Farad +COUNTCHARS; yylval.quantity.scaler = Quantity::Farad; yylval.quantity.unitStr = yytext; return UNIT; // Farad (s^4*A^2/m^2/kg) YY_BREAK case 104: YY_RULE_SETUP #line 298 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::MicroFarad; yylval.quantity.unitStr = yytext; return UNIT; // micro Farad +COUNTCHARS; yylval.quantity.scaler = Quantity::MilliFarad; yylval.quantity.unitStr = yytext; return UNIT; // milli Farad YY_BREAK case 105: YY_RULE_SETUP @@ -9410,107 +9410,107 @@ COUNTCHARS; yylval.quantity.scaler = Quantity::MicroFarad; yylval.quan case 106: YY_RULE_SETUP #line 300 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::NanoFarad; yylval.quantity.unitStr = yytext; return UNIT; // nano Farad +COUNTCHARS; yylval.quantity.scaler = Quantity::MicroFarad; yylval.quantity.unitStr = yytext; return UNIT; // micro Farad YY_BREAK case 107: YY_RULE_SETUP #line 301 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::PicoFarad; yylval.quantity.unitStr = yytext; return UNIT; // pico Farad +COUNTCHARS; yylval.quantity.scaler = Quantity::NanoFarad; yylval.quantity.unitStr = yytext; return UNIT; // nano Farad YY_BREAK case 108: YY_RULE_SETUP -#line 303 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Henry; yylval.quantity.unitStr = yytext; return UNIT; // Henry (kg*m^2/s^2/A^2) +#line 302 "Expression.l" +COUNTCHARS; yylval.quantity.scaler = Quantity::PicoFarad; yylval.quantity.unitStr = yytext; return UNIT; // pico Farad YY_BREAK case 109: YY_RULE_SETUP #line 304 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::MilliHenry; yylval.quantity.unitStr = yytext; return UNIT; // milli Henry +COUNTCHARS; yylval.quantity.scaler = Quantity::Henry; yylval.quantity.unitStr = yytext; return UNIT; // Henry (kg*m^2/s^2/A^2) YY_BREAK case 110: YY_RULE_SETUP #line 305 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::MicroHenry; yylval.quantity.unitStr = yytext; return UNIT; // micro Henry +COUNTCHARS; yylval.quantity.scaler = Quantity::MilliHenry; yylval.quantity.unitStr = yytext; return UNIT; // milli Henry YY_BREAK case 111: YY_RULE_SETUP #line 306 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::MicroHenry; yylval.quantity.unitStr = yytext; return UNIT; // micro Henry) +COUNTCHARS; yylval.quantity.scaler = Quantity::MicroHenry; yylval.quantity.unitStr = yytext; return UNIT; // micro Henry YY_BREAK case 112: YY_RULE_SETUP #line 307 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::NanoHenry; yylval.quantity.unitStr = yytext; return UNIT; // nano Henry +COUNTCHARS; yylval.quantity.scaler = Quantity::MicroHenry; yylval.quantity.unitStr = yytext; return UNIT; // micro Henry) YY_BREAK case 113: YY_RULE_SETUP -#line 309 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Joule; yylval.quantity.unitStr = yytext; return UNIT; // Joule (kg*m^2/s^2) +#line 308 "Expression.l" +COUNTCHARS; yylval.quantity.scaler = Quantity::NanoHenry; yylval.quantity.unitStr = yytext; return UNIT; // nano Henry YY_BREAK case 114: YY_RULE_SETUP #line 310 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::MilliJoule; yylval.quantity.unitStr = yytext; return UNIT; // milli Joule +COUNTCHARS; yylval.quantity.scaler = Quantity::Joule; yylval.quantity.unitStr = yytext; return UNIT; // Joule (kg*m^2/s^2) YY_BREAK case 115: YY_RULE_SETUP #line 311 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::KiloJoule; yylval.quantity.unitStr = yytext; return UNIT; // kilo Joule +COUNTCHARS; yylval.quantity.scaler = Quantity::MilliJoule; yylval.quantity.unitStr = yytext; return UNIT; // milli Joule YY_BREAK case 116: YY_RULE_SETUP #line 312 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::NewtonMeter; yylval.quantity.unitStr = yytext; return UNIT; // N*m = Joule +COUNTCHARS; yylval.quantity.scaler = Quantity::KiloJoule; yylval.quantity.unitStr = yytext; return UNIT; // kilo Joule YY_BREAK case 117: YY_RULE_SETUP #line 313 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::VoltAmpereSecond; yylval.quantity.unitStr = yytext; return UNIT; // V*A*s = Joule +COUNTCHARS; yylval.quantity.scaler = Quantity::NewtonMeter; yylval.quantity.unitStr = yytext; return UNIT; // N*m = Joule YY_BREAK case 118: YY_RULE_SETUP #line 314 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::WattSecond; yylval.quantity.unitStr = yytext; return UNIT; // +COUNTCHARS; yylval.quantity.scaler = Quantity::VoltAmpereSecond; yylval.quantity.unitStr = yytext; return UNIT; // V*A*s = Joule YY_BREAK case 119: YY_RULE_SETUP #line 315 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::WattSecond; yylval.quantity.unitStr = yytext; return UNIT; // W*s = Joule +COUNTCHARS; yylval.quantity.scaler = Quantity::WattSecond; yylval.quantity.unitStr = yytext; return UNIT; // YY_BREAK case 120: YY_RULE_SETUP #line 316 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::KiloWattHour; yylval.quantity.unitStr = yytext; return UNIT; // 1 kWh = 3.6e6 J +COUNTCHARS; yylval.quantity.scaler = Quantity::WattSecond; yylval.quantity.unitStr = yytext; return UNIT; // W*s = Joule YY_BREAK case 121: YY_RULE_SETUP #line 317 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::ElectronVolt; yylval.quantity.unitStr = yytext; return UNIT; // 1 eV = 1.602176634e-19 J +COUNTCHARS; yylval.quantity.scaler = Quantity::KiloWattHour; yylval.quantity.unitStr = yytext; return UNIT; // 1 kWh = 3.6e6 J YY_BREAK case 122: YY_RULE_SETUP #line 318 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::KiloElectronVolt; yylval.quantity.unitStr = yytext; return UNIT; +COUNTCHARS; yylval.quantity.scaler = Quantity::ElectronVolt; yylval.quantity.unitStr = yytext; return UNIT; // 1 eV = 1.602176634e-19 J YY_BREAK case 123: YY_RULE_SETUP #line 319 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::MegaElectronVolt; yylval.quantity.unitStr = yytext; return UNIT; +COUNTCHARS; yylval.quantity.scaler = Quantity::KiloElectronVolt; yylval.quantity.unitStr = yytext; return UNIT; YY_BREAK case 124: YY_RULE_SETUP #line 320 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Calorie; yylval.quantity.unitStr = yytext; return UNIT; // 1 cal = 4.1868 J +COUNTCHARS; yylval.quantity.scaler = Quantity::MegaElectronVolt; yylval.quantity.unitStr = yytext; return UNIT; YY_BREAK case 125: YY_RULE_SETUP #line 321 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::KiloCalorie; yylval.quantity.unitStr = yytext; return UNIT; +COUNTCHARS; yylval.quantity.scaler = Quantity::Calorie; yylval.quantity.unitStr = yytext; return UNIT; // 1 cal = 4.1868 J YY_BREAK case 126: YY_RULE_SETUP -#line 323 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Degree; yylval.quantity.unitStr = yytext; return UNIT; // degree (internal standard angle) +#line 322 "Expression.l" +COUNTCHARS; yylval.quantity.scaler = Quantity::KiloCalorie; yylval.quantity.unitStr = yytext; return UNIT; YY_BREAK case 127: YY_RULE_SETUP @@ -9520,42 +9520,42 @@ COUNTCHARS; yylval.quantity.scaler = Quantity::Degree; yylval.quan case 128: YY_RULE_SETUP #line 325 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Radian; yylval.quantity.unitStr = yytext; return UNIT; // radian +COUNTCHARS; yylval.quantity.scaler = Quantity::Degree; yylval.quantity.unitStr = yytext; return UNIT; // degree (internal standard angle) YY_BREAK case 129: YY_RULE_SETUP #line 326 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::Gon; yylval.quantity.unitStr = yytext; return UNIT; // gon +COUNTCHARS; yylval.quantity.scaler = Quantity::Radian; yylval.quantity.unitStr = yytext; return UNIT; // radian YY_BREAK case 130: YY_RULE_SETUP #line 327 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::AngMinute; yylval.quantity.unitStr = yytext; return UNIT; // angminute +COUNTCHARS; yylval.quantity.scaler = Quantity::Gon; yylval.quantity.unitStr = yytext; return UNIT; // gon YY_BREAK case 131: YY_RULE_SETUP #line 328 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::AngMinute; yylval.quantity.unitStr = yytext; return UNIT; // angminute U+2032 ′ ′ ′ +COUNTCHARS; yylval.quantity.scaler = Quantity::AngMinute; yylval.quantity.unitStr = yytext; return UNIT; // angminute YY_BREAK case 132: YY_RULE_SETUP #line 329 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::AngSecond; yylval.quantity.unitStr = yytext; return UNIT; // angsecond +COUNTCHARS; yylval.quantity.scaler = Quantity::AngMinute; yylval.quantity.unitStr = yytext; return UNIT; // angminute U+2032 ′ ′ ′ YY_BREAK case 133: YY_RULE_SETUP #line 330 "Expression.l" -COUNTCHARS; yylval.quantity.scaler = Quantity::AngSecond; yylval.quantity.unitStr = yytext; return UNIT; // angsecond U+2033 ″ ″ ″ +COUNTCHARS; yylval.quantity.scaler = Quantity::AngSecond; yylval.quantity.unitStr = yytext; return UNIT; // angsecond YY_BREAK case 134: YY_RULE_SETUP -#line 332 "Expression.l" -COUNTCHARS; yylval.fvalue = num_change(yytext,'.',','); return yylval.fvalue == 1 ? ONE : NUM; +#line 331 "Expression.l" +COUNTCHARS; yylval.quantity.scaler = Quantity::AngSecond; yylval.quantity.unitStr = yytext; return UNIT; // angsecond U+2033 ″ ″ ″ YY_BREAK case 135: YY_RULE_SETUP #line 333 "Expression.l" -COUNTCHARS; yylval.fvalue = num_change(yytext,',','.'); return yylval.fvalue == 1 ? ONE : NUM; +COUNTCHARS; yylval.fvalue = num_change(yytext,'.',','); return yylval.fvalue == 1 ? ONE : NUM; YY_BREAK case 136: YY_RULE_SETUP @@ -9565,6 +9565,11 @@ COUNTCHARS; yylval.fvalue = num_change(yytext,',','.'); return yylval.fval case 137: YY_RULE_SETUP #line 335 "Expression.l" +COUNTCHARS; yylval.fvalue = num_change(yytext,',','.'); return yylval.fvalue == 1 ? ONE : NUM; + YY_BREAK +case 138: +YY_RULE_SETUP +#line 336 "Expression.l" { COUNTCHARS; yylval.ivalue = strtoll( yytext, NULL, 10 ); if (yylval.ivalue == std::numeric_limits::min()) @@ -9574,25 +9579,20 @@ YY_RULE_SETUP if (yylval.ivalue == 1) { yylval.fvalue = 1; return ONE; } else return INTEGER; } YY_BREAK -case 138: -YY_RULE_SETUP -#line 344 "Expression.l" -COUNTCHARS; yylval.constant.fvalue = std::numbers::pi; yylval.constant.name = "pi"; return CONSTANT; // constant pi - YY_BREAK case 139: YY_RULE_SETUP #line 345 "Expression.l" -COUNTCHARS; yylval.constant.fvalue = std::numbers::e; yylval.constant.name = "e"; return CONSTANT; // constant e +COUNTCHARS; yylval.constant.fvalue = std::numbers::pi; yylval.constant.name = "pi"; return CONSTANT; // constant pi YY_BREAK case 140: YY_RULE_SETUP -#line 347 "Expression.l" -COUNTCHARS; yylval.constant.fvalue = 0; yylval.constant.name = "None"; return CONSTANT; +#line 346 "Expression.l" +COUNTCHARS; yylval.constant.fvalue = std::numbers::e; yylval.constant.name = "e"; return CONSTANT; // constant e YY_BREAK case 141: YY_RULE_SETUP #line 348 "Expression.l" -COUNTCHARS; yylval.constant.fvalue = 1; yylval.constant.name = "True"; return CONSTANT; +COUNTCHARS; yylval.constant.fvalue = 0; yylval.constant.name = "None"; return CONSTANT; YY_BREAK case 142: YY_RULE_SETUP @@ -9602,7 +9602,7 @@ COUNTCHARS; yylval.constant.fvalue = 1; yylval.constant.name = "True"; return CO case 143: YY_RULE_SETUP #line 350 "Expression.l" -COUNTCHARS; yylval.constant.fvalue = 0; yylval.constant.name = "False"; return CONSTANT; +COUNTCHARS; yylval.constant.fvalue = 1; yylval.constant.name = "True"; return CONSTANT; YY_BREAK case 144: YY_RULE_SETUP @@ -9611,8 +9611,8 @@ COUNTCHARS; yylval.constant.fvalue = 0; yylval.constant.name = "False"; return C YY_BREAK case 145: YY_RULE_SETUP -#line 353 "Expression.l" -COUNTCHARS; yylval.string = yytext; return CELLADDRESS; +#line 352 "Expression.l" +COUNTCHARS; yylval.constant.fvalue = 0; yylval.constant.name = "False"; return CONSTANT; YY_BREAK case 146: YY_RULE_SETUP @@ -9626,7 +9626,12 @@ COUNTCHARS; yylval.string = yytext; return CELLADDRESS; YY_BREAK case 148: YY_RULE_SETUP -#line 357 "Expression.l" +#line 356 "Expression.l" +COUNTCHARS; yylval.string = yytext; return CELLADDRESS; + YY_BREAK +case 149: +YY_RULE_SETUP +#line 358 "Expression.l" { COUNTCHARS; std::string s = yytext; @@ -9642,17 +9647,17 @@ YY_RULE_SETUP return FUNC; } YY_BREAK -case 149: -YY_RULE_SETUP -#line 372 "Expression.l" -COUNTCHARS; yylval.string = yytext; return IDENTIFIER; - YY_BREAK case 150: YY_RULE_SETUP #line 373 "Expression.l" +COUNTCHARS; yylval.string = yytext; return IDENTIFIER; + YY_BREAK +case 151: +YY_RULE_SETUP +#line 374 "Expression.l" ECHO; YY_BREAK -#line 9655 "Expression.lex.c" +#line 9659 "Expression.lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -10621,4 +10626,4 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 373 "Expression.l" +#line 374 "Expression.l" diff --git a/src/Base/Quantity.cpp b/src/Base/Quantity.cpp index 58c3f15fe3..854c711928 100644 --- a/src/Base/Quantity.cpp +++ b/src/Base/Quantity.cpp @@ -438,6 +438,7 @@ const Quantity Quantity::MegaOhm ( 1e+12 , Unit:: const Quantity Quantity::Coulomb ( 1.0 , Unit::ElectricCharge ); // Coulomb (A*s) const Quantity Quantity::Tesla ( 1.0 , Unit::MagneticFluxDensity ); // Tesla (kg/s^2/A) +const Quantity Quantity::MilliTesla ( 1e-3 , Unit::MagneticFluxDensity ); const Quantity Quantity::Gauss ( 1e-4 , Unit::MagneticFluxDensity ); // 1 G = 1e-4 T const Quantity Quantity::Weber ( 1e6 , Unit::MagneticFlux ); // Weber (kg*m^2/s^2/A) diff --git a/src/Base/Quantity.h b/src/Base/Quantity.h index c4f8a07b49..6f21392006 100644 --- a/src/Base/Quantity.h +++ b/src/Base/Quantity.h @@ -304,6 +304,7 @@ public: static const Quantity Coulomb; static const Quantity Tesla; + static const Quantity MilliTesla; static const Quantity Gauss; static const Quantity Weber; diff --git a/src/Base/Quantity.l b/src/Base/Quantity.l index b3cc743e94..8e12b721e3 100644 --- a/src/Base/Quantity.l +++ b/src/Base/Quantity.l @@ -173,6 +173,7 @@ CGRP '\,'[0-9][0-9][0-9] "C" yylval = Quantity::Coulomb; return UNIT; // Coulomb (A*s) "T" yylval = Quantity::Tesla; return UNIT; // Tesla (kg/s^2/A) +"mT" yylval = Quantity::MilliTesla; return UNIT; // milli Tesla "G" yylval = Quantity::Gauss; return UNIT; // Gauss (1 G = 1e-4 T) "Wb" yylval = Quantity::Weber; return UNIT; // Weber (kg*m^2/s^2/A) diff --git a/src/Base/Quantity.lex.c b/src/Base/Quantity.lex.c index eccf555a53..c2ff4c6f2f 100644 --- a/src/Base/Quantity.lex.c +++ b/src/Base/Quantity.lex.c @@ -1,9 +1,9 @@ // SPDX-License-Identifier: LGPL-2.1-or-later // clang-format off -#line 2 "Quantity.lex.c" +#line 1 "Quantity.lex.c" -#line 4 "Quantity.lex.c" +#line 3 "Quantity.lex.c" #define YY_INT_ALIGNED short int @@ -356,8 +356,8 @@ static void yynoreturn yy_fatal_error ( const char* msg ); (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 154 -#define YY_END_OF_BUFFER 155 +#define YY_NUM_RULES 155 +#define YY_END_OF_BUFFER 156 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -367,34 +367,34 @@ struct yy_trans_info }; static const flex_int16_t yy_accept[265] = { 0, - 0, 0, 0, 0, 155, 153, 4, 5, 45, 47, - 6, 153, 7, 153, 131, 130, 33, 94, 98, 96, - 104, 109, 37, 126, 61, 153, 153, 87, 95, 82, - 78, 1, 153, 153, 153, 153, 136, 153, 27, 32, - 153, 153, 17, 15, 153, 153, 153, 153, 30, 29, - 153, 153, 153, 153, 3, 154, 2, 5, 134, 132, - 133, 131, 131, 0, 128, 114, 0, 0, 19, 36, - 0, 64, 0, 0, 85, 0, 0, 112, 0, 65, - 0, 0, 81, 97, 115, 0, 0, 0, 0, 0, - 0, 43, 0, 13, 0, 0, 0, 14, 117, 0, + 0, 0, 0, 0, 156, 154, 4, 5, 45, 47, + 6, 154, 7, 154, 132, 131, 33, 94, 99, 97, + 105, 110, 37, 127, 61, 154, 154, 87, 95, 82, + 78, 1, 154, 154, 154, 154, 137, 154, 27, 32, + 154, 154, 17, 15, 154, 154, 154, 154, 30, 29, + 154, 154, 154, 154, 3, 155, 2, 5, 135, 133, + 134, 132, 132, 0, 129, 115, 0, 0, 19, 36, + 0, 64, 0, 0, 85, 0, 0, 113, 0, 65, + 0, 0, 81, 98, 116, 0, 0, 0, 0, 0, + 0, 43, 0, 13, 0, 0, 0, 14, 118, 0, - 46, 0, 44, 35, 0, 111, 63, 0, 0, 86, + 46, 0, 44, 35, 0, 112, 63, 0, 0, 86, 83, 80, 0, 0, 28, 16, 0, 55, 0, 34, - 99, 105, 110, 38, 62, 88, 0, 84, 79, 0, - 26, 51, 18, 12, 0, 0, 102, 108, 9, 57, - 103, 135, 0, 0, 0, 0, 0, 58, 0, 0, - 101, 107, 40, 90, 0, 24, 10, 50, 122, 0, - 0, 0, 0, 0, 133, 0, 131, 0, 0, 131, - 22, 68, 21, 0, 67, 119, 0, 91, 23, 0, - 113, 143, 0, 0, 0, 69, 120, 54, 141, 59, - 123, 142, 125, 20, 0, 66, 116, 0, 118, 76, + 100, 106, 111, 38, 62, 88, 96, 84, 79, 0, + 26, 51, 18, 12, 0, 0, 103, 109, 9, 57, + 104, 136, 0, 0, 0, 0, 0, 58, 0, 0, + 102, 108, 40, 90, 0, 24, 10, 50, 123, 0, + 0, 0, 0, 0, 134, 0, 132, 0, 0, 132, + 22, 68, 21, 0, 67, 120, 0, 91, 23, 0, + 114, 144, 0, 0, 0, 69, 121, 54, 142, 59, + 124, 143, 126, 20, 0, 66, 117, 0, 119, 76, - 60, 56, 145, 0, 0, 49, 31, 0, 144, 41, - 52, 147, 75, 124, 148, 0, 0, 150, 0, 0, - 100, 106, 39, 89, 0, 25, 11, 127, 129, 8, - 0, 134, 0, 132, 0, 133, 0, 131, 93, 77, - 71, 137, 138, 139, 92, 121, 0, 0, 70, 42, - 149, 53, 152, 151, 48, 0, 0, 140, 146, 72, + 60, 56, 146, 0, 0, 49, 31, 0, 145, 41, + 52, 148, 75, 125, 149, 0, 0, 151, 0, 0, + 101, 107, 39, 89, 0, 25, 11, 128, 130, 8, + 0, 135, 0, 133, 0, 134, 0, 132, 93, 77, + 71, 138, 139, 140, 92, 122, 0, 0, 70, 42, + 150, 53, 153, 152, 48, 0, 0, 141, 147, 72, 73, 0, 74, 0 } ; @@ -631,6 +631,8 @@ int yy_flex_debug = 0; char *yytext; #line 1 "Quantity.l" #line 2 "Quantity.l" +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + /*************************************************************************** * Copyright (c) 2013 Jürgen Riegel * * * @@ -657,12 +659,12 @@ char *yytext; * on Win32. The C++ scanner uses STL streams instead. */ #define YY_NO_UNISTD_H -#line 658 "Quantity.lex.c" +#line 659 "Quantity.lex.c" /*** Flex Declarations and Options ***/ /* the manual says "somewhat more optimized" */ /* no support for include files is planned */ -#line 663 "Quantity.lex.c" +#line 664 "Quantity.lex.c" #define INITIAL 0 #define C_COMMENT 1 @@ -878,10 +880,10 @@ YY_DECL } { -#line 49 "Quantity.l" +#line 51 "Quantity.l" -#line 882 "Quantity.lex.c" +#line 883 "Quantity.lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -936,776 +938,781 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 51 "Quantity.l" +#line 53 "Quantity.l" { BEGIN(C_COMMENT); } YY_BREAK case 2: YY_RULE_SETUP -#line 52 "Quantity.l" +#line 54 "Quantity.l" { BEGIN(INITIAL); } YY_BREAK case 3: YY_RULE_SETUP -#line 53 "Quantity.l" +#line 55 "Quantity.l" { ;} YY_BREAK case 4: YY_RULE_SETUP -#line 56 "Quantity.l" +#line 58 "Quantity.l" ; YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP -#line 57 "Quantity.l" +#line 59 "Quantity.l" ; YY_BREAK case 6: YY_RULE_SETUP -#line 59 "Quantity.l" +#line 61 "Quantity.l" return *yytext; YY_BREAK case 7: YY_RULE_SETUP -#line 61 "Quantity.l" +#line 63 "Quantity.l" return MINUSSIGN; YY_BREAK case 8: YY_RULE_SETUP -#line 62 "Quantity.l" +#line 64 "Quantity.l" return MINUSSIGN; YY_BREAK case 9: YY_RULE_SETUP -#line 64 "Quantity.l" +#line 66 "Quantity.l" yylval = Quantity::NanoMetre; return UNIT; // nano meter YY_BREAK case 10: YY_RULE_SETUP -#line 65 "Quantity.l" +#line 67 "Quantity.l" yylval = Quantity::MicroMetre; return UNIT; // micro meter YY_BREAK case 11: YY_RULE_SETUP -#line 66 "Quantity.l" +#line 68 "Quantity.l" yylval = Quantity::MicroMetre; return UNIT; // micro meter (greek micro in UTF8) YY_BREAK case 12: YY_RULE_SETUP -#line 67 "Quantity.l" +#line 69 "Quantity.l" yylval = Quantity::MilliMetre; return UNIT; // milli meter (internal standard length) YY_BREAK case 13: YY_RULE_SETUP -#line 68 "Quantity.l" +#line 70 "Quantity.l" yylval = Quantity::CentiMetre; return UNIT; // centi meter YY_BREAK case 14: YY_RULE_SETUP -#line 69 "Quantity.l" +#line 71 "Quantity.l" yylval = Quantity::DeciMetre; return UNIT; // deci meter YY_BREAK case 15: YY_RULE_SETUP -#line 70 "Quantity.l" +#line 72 "Quantity.l" yylval = Quantity::Metre; return UNIT; // Metre YY_BREAK case 16: YY_RULE_SETUP -#line 71 "Quantity.l" +#line 73 "Quantity.l" yylval = Quantity::KiloMetre; return UNIT; // kilo meter YY_BREAK case 17: YY_RULE_SETUP -#line 73 "Quantity.l" +#line 75 "Quantity.l" yylval = Quantity::Liter; return UNIT; // Liter (dm^3) YY_BREAK case 18: YY_RULE_SETUP -#line 74 "Quantity.l" +#line 76 "Quantity.l" yylval = Quantity::MilliLiter; return UNIT; // milli Liter YY_BREAK case 19: YY_RULE_SETUP -#line 76 "Quantity.l" +#line 78 "Quantity.l" yylval = Quantity::Hertz; return UNIT; // Hertz YY_BREAK case 20: YY_RULE_SETUP -#line 77 "Quantity.l" +#line 79 "Quantity.l" yylval = Quantity::KiloHertz; return UNIT; // kilo Hertz YY_BREAK case 21: YY_RULE_SETUP -#line 78 "Quantity.l" +#line 80 "Quantity.l" yylval = Quantity::MegaHertz; return UNIT; // mega Hertz YY_BREAK case 22: YY_RULE_SETUP -#line 79 "Quantity.l" +#line 81 "Quantity.l" yylval = Quantity::GigaHertz; return UNIT; // giga Hertz YY_BREAK case 23: YY_RULE_SETUP -#line 80 "Quantity.l" +#line 82 "Quantity.l" yylval = Quantity::TeraHertz; return UNIT; // tera Hertz YY_BREAK case 24: YY_RULE_SETUP -#line 82 "Quantity.l" +#line 84 "Quantity.l" yylval = Quantity::MicroGram; return UNIT; // micro gram YY_BREAK case 25: YY_RULE_SETUP -#line 83 "Quantity.l" +#line 85 "Quantity.l" yylval = Quantity::MicroGram; return UNIT; // micro gram YY_BREAK case 26: YY_RULE_SETUP -#line 84 "Quantity.l" +#line 86 "Quantity.l" yylval = Quantity::MilliGram; return UNIT; // milli gram YY_BREAK case 27: YY_RULE_SETUP -#line 85 "Quantity.l" +#line 87 "Quantity.l" yylval = Quantity::Gram; return UNIT; // gram YY_BREAK case 28: YY_RULE_SETUP -#line 86 "Quantity.l" +#line 88 "Quantity.l" yylval = Quantity::KiloGram; return UNIT; // kilo gram (internal standard for mass) YY_BREAK case 29: YY_RULE_SETUP -#line 87 "Quantity.l" +#line 89 "Quantity.l" yylval = Quantity::Ton; return UNIT; // Metric Tonne YY_BREAK case 30: YY_RULE_SETUP -#line 89 "Quantity.l" +#line 91 "Quantity.l" yylval = Quantity::Second; return UNIT; // second (internal standard time) YY_BREAK case 31: YY_RULE_SETUP -#line 90 "Quantity.l" +#line 92 "Quantity.l" yylval = Quantity::Minute; return UNIT; // minute YY_BREAK case 32: YY_RULE_SETUP -#line 91 "Quantity.l" +#line 93 "Quantity.l" yylval = Quantity::Hour; return UNIT; // hour YY_BREAK case 33: YY_RULE_SETUP -#line 93 "Quantity.l" +#line 95 "Quantity.l" yylval = Quantity::Ampere; return UNIT; // Ampere (internal standard electric current) YY_BREAK case 34: YY_RULE_SETUP -#line 94 "Quantity.l" +#line 96 "Quantity.l" yylval = Quantity::MilliAmpere; return UNIT; // milli Ampere YY_BREAK case 35: YY_RULE_SETUP -#line 95 "Quantity.l" +#line 97 "Quantity.l" yylval = Quantity::KiloAmpere; return UNIT; // kilo Ampere YY_BREAK case 36: YY_RULE_SETUP -#line 96 "Quantity.l" +#line 98 "Quantity.l" yylval = Quantity::MegaAmpere; return UNIT; // mega Ampere YY_BREAK case 37: YY_RULE_SETUP -#line 98 "Quantity.l" +#line 100 "Quantity.l" yylval = Quantity::Kelvin; return UNIT; // Kelvin (internal standard thermodynamic temperature) YY_BREAK case 38: YY_RULE_SETUP -#line 99 "Quantity.l" +#line 101 "Quantity.l" yylval = Quantity::MilliKelvin; return UNIT; // milli Kelvin YY_BREAK case 39: YY_RULE_SETUP -#line 100 "Quantity.l" +#line 102 "Quantity.l" yylval = Quantity::MicroKelvin; return UNIT; // micro Kelvin YY_BREAK case 40: YY_RULE_SETUP -#line 101 "Quantity.l" +#line 103 "Quantity.l" yylval = Quantity::MicroKelvin; return UNIT; // micro Kelvin YY_BREAK case 41: YY_RULE_SETUP -#line 103 "Quantity.l" +#line 105 "Quantity.l" yylval = Quantity::Mole; return UNIT; // Mole (internal standard amount of substance) YY_BREAK case 42: YY_RULE_SETUP -#line 104 "Quantity.l" +#line 106 "Quantity.l" yylval = Quantity::MilliMole; return UNIT; // Milli Mole YY_BREAK case 43: YY_RULE_SETUP -#line 106 "Quantity.l" +#line 108 "Quantity.l" yylval = Quantity::Candela; return UNIT; // Candela (internal standard luminous intensity) YY_BREAK case 44: YY_RULE_SETUP -#line 108 "Quantity.l" +#line 110 "Quantity.l" yylval = Quantity::Inch; return UNIT; // inch YY_BREAK case 45: YY_RULE_SETUP -#line 109 "Quantity.l" +#line 111 "Quantity.l" yylval = Quantity::Inch; return UNIT; // inch YY_BREAK case 46: YY_RULE_SETUP -#line 110 "Quantity.l" +#line 112 "Quantity.l" yylval = Quantity::Foot; return UNIT; // foot YY_BREAK case 47: YY_RULE_SETUP -#line 111 "Quantity.l" +#line 113 "Quantity.l" yylval = Quantity::Foot; return UNIT; // foot YY_BREAK case 48: YY_RULE_SETUP -#line 112 "Quantity.l" +#line 114 "Quantity.l" yylval = Quantity::Thou; return UNIT; // thou (in/1000) YY_BREAK case 49: YY_RULE_SETUP -#line 113 "Quantity.l" +#line 115 "Quantity.l" yylval = Quantity::Thou; return UNIT; // mil (the thou in US) YY_BREAK case 50: YY_RULE_SETUP -#line 114 "Quantity.l" +#line 116 "Quantity.l" yylval = Quantity::Yard; return UNIT; // yard YY_BREAK case 51: YY_RULE_SETUP -#line 115 "Quantity.l" +#line 117 "Quantity.l" yylval = Quantity::Mile; return UNIT; // mile YY_BREAK case 52: YY_RULE_SETUP -#line 117 "Quantity.l" +#line 119 "Quantity.l" yylval = Quantity::MilePerHour; return UNIT; // mile per hour YY_BREAK case 53: YY_RULE_SETUP -#line 118 "Quantity.l" +#line 120 "Quantity.l" yylval = Quantity::SquareFoot; return UNIT; // square foot YY_BREAK case 54: YY_RULE_SETUP -#line 119 "Quantity.l" +#line 121 "Quantity.l" yylval = Quantity::CubicFoot; return UNIT; // cubic foot YY_BREAK case 55: YY_RULE_SETUP -#line 121 "Quantity.l" +#line 123 "Quantity.l" yylval = Quantity::Pound; return UNIT; // pound YY_BREAK case 56: YY_RULE_SETUP -#line 122 "Quantity.l" +#line 124 "Quantity.l" yylval = Quantity::Pound; return UNIT; // pound YY_BREAK case 57: YY_RULE_SETUP -#line 123 "Quantity.l" +#line 125 "Quantity.l" yylval = Quantity::Ounce; return UNIT; // ounce YY_BREAK case 58: YY_RULE_SETUP -#line 124 "Quantity.l" +#line 126 "Quantity.l" yylval = Quantity::Stone; return UNIT; // Stone YY_BREAK case 59: YY_RULE_SETUP -#line 125 "Quantity.l" +#line 127 "Quantity.l" yylval = Quantity::Hundredweights; return UNIT; // hundredweights YY_BREAK case 60: YY_RULE_SETUP -#line 127 "Quantity.l" +#line 129 "Quantity.l" yylval = Quantity::PoundForce; return UNIT; // pound YY_BREAK case 61: YY_RULE_SETUP -#line 129 "Quantity.l" +#line 131 "Quantity.l" yylval = Quantity::Newton; return UNIT; // Newton (kg*m/s^2) YY_BREAK case 62: YY_RULE_SETUP -#line 130 "Quantity.l" +#line 132 "Quantity.l" yylval = Quantity::MilliNewton; return UNIT; // milli Newton YY_BREAK case 63: YY_RULE_SETUP -#line 131 "Quantity.l" +#line 133 "Quantity.l" yylval = Quantity::KiloNewton; return UNIT; // kilo Newton YY_BREAK case 64: YY_RULE_SETUP -#line 132 "Quantity.l" +#line 134 "Quantity.l" yylval = Quantity::MegaNewton; return UNIT; // mega Newton YY_BREAK case 65: YY_RULE_SETUP -#line 134 "Quantity.l" +#line 136 "Quantity.l" yylval = Quantity::Pascal; return UNIT; // Pascal (kg/m/s^2 or N/m^2) YY_BREAK case 66: YY_RULE_SETUP -#line 135 "Quantity.l" +#line 137 "Quantity.l" yylval = Quantity::KiloPascal; return UNIT; // kilo Pascal YY_BREAK case 67: YY_RULE_SETUP -#line 136 "Quantity.l" +#line 138 "Quantity.l" yylval = Quantity::MegaPascal; return UNIT; // mega Pascal YY_BREAK case 68: YY_RULE_SETUP -#line 137 "Quantity.l" +#line 139 "Quantity.l" yylval = Quantity::GigaPascal; return UNIT; // giga Pascal YY_BREAK case 69: YY_RULE_SETUP -#line 139 "Quantity.l" +#line 141 "Quantity.l" yylval = Quantity::Bar; return UNIT; // 1 bar = 100 kPa YY_BREAK case 70: YY_RULE_SETUP -#line 140 "Quantity.l" +#line 142 "Quantity.l" yylval = Quantity::MilliBar; return UNIT; // milli Bar YY_BREAK case 71: YY_RULE_SETUP -#line 142 "Quantity.l" +#line 144 "Quantity.l" yylval = Quantity::Torr; return UNIT; // portion of Pascal ( 101325/760 ) YY_BREAK case 72: YY_RULE_SETUP -#line 143 "Quantity.l" +#line 145 "Quantity.l" yylval = Quantity::mTorr; return UNIT; // YY_BREAK case 73: YY_RULE_SETUP -#line 144 "Quantity.l" +#line 146 "Quantity.l" yylval = Quantity::yTorr; return UNIT; // YY_BREAK case 74: YY_RULE_SETUP -#line 145 "Quantity.l" +#line 147 "Quantity.l" yylval = Quantity::yTorr; return UNIT; // YY_BREAK case 75: YY_RULE_SETUP -#line 147 "Quantity.l" +#line 149 "Quantity.l" yylval = Quantity::PSI; return UNIT; // pounds/in^2 YY_BREAK case 76: YY_RULE_SETUP -#line 148 "Quantity.l" +#line 150 "Quantity.l" yylval = Quantity::KSI; return UNIT; // 1000 x pounds/in^2 YY_BREAK case 77: YY_RULE_SETUP -#line 149 "Quantity.l" +#line 151 "Quantity.l" yylval = Quantity::MPSI; return UNIT; // 1000 ksi YY_BREAK case 78: YY_RULE_SETUP -#line 151 "Quantity.l" +#line 153 "Quantity.l" yylval = Quantity::Watt; return UNIT; // Watt (kg*m^2/s^3) YY_BREAK case 79: YY_RULE_SETUP -#line 152 "Quantity.l" +#line 154 "Quantity.l" yylval = Quantity::MilliWatt; return UNIT; // milli Watt YY_BREAK case 80: YY_RULE_SETUP -#line 153 "Quantity.l" +#line 155 "Quantity.l" yylval = Quantity::KiloWatt; return UNIT; // kilo Watt YY_BREAK case 81: YY_RULE_SETUP -#line 154 "Quantity.l" +#line 156 "Quantity.l" yylval = Quantity::VoltAmpere; return UNIT; // VoltAmpere (kg*m^2/s^3) YY_BREAK case 82: YY_RULE_SETUP -#line 156 "Quantity.l" +#line 158 "Quantity.l" yylval = Quantity::Volt; return UNIT; // Volt (kg*m^2/A/s^3) YY_BREAK case 83: YY_RULE_SETUP -#line 157 "Quantity.l" +#line 159 "Quantity.l" yylval = Quantity::KiloVolt; return UNIT; // kilo Volt YY_BREAK case 84: YY_RULE_SETUP -#line 158 "Quantity.l" +#line 160 "Quantity.l" yylval = Quantity::MilliVolt; return UNIT; // milli Volt YY_BREAK case 85: YY_RULE_SETUP -#line 160 "Quantity.l" +#line 162 "Quantity.l" yylval = Quantity::MegaSiemens; return UNIT; // mega Siemens YY_BREAK case 86: YY_RULE_SETUP -#line 161 "Quantity.l" +#line 163 "Quantity.l" yylval = Quantity::KiloSiemens; return UNIT; // kilo Siemens YY_BREAK case 87: YY_RULE_SETUP -#line 162 "Quantity.l" +#line 164 "Quantity.l" yylval = Quantity::Siemens; return UNIT; // Siemens (A^2*s^3/kg/m^2) YY_BREAK case 88: YY_RULE_SETUP -#line 163 "Quantity.l" +#line 165 "Quantity.l" yylval = Quantity::MilliSiemens; return UNIT; // milli Siemens YY_BREAK case 89: YY_RULE_SETUP -#line 164 "Quantity.l" +#line 166 "Quantity.l" yylval = Quantity::MicroSiemens; return UNIT; // micro Siemens YY_BREAK case 90: YY_RULE_SETUP -#line 165 "Quantity.l" +#line 167 "Quantity.l" yylval = Quantity::MicroSiemens; return UNIT; // micro Siemens YY_BREAK case 91: YY_RULE_SETUP -#line 167 "Quantity.l" +#line 169 "Quantity.l" yylval = Quantity::Ohm; return UNIT; // Ohm (kg*m^2/A^2/s^3) YY_BREAK case 92: YY_RULE_SETUP -#line 168 "Quantity.l" +#line 170 "Quantity.l" yylval = Quantity::KiloOhm; return UNIT; // kilo Ohm YY_BREAK case 93: YY_RULE_SETUP -#line 169 "Quantity.l" +#line 171 "Quantity.l" yylval = Quantity::MegaOhm; return UNIT; // mega Ohm YY_BREAK case 94: YY_RULE_SETUP -#line 171 "Quantity.l" +#line 173 "Quantity.l" yylval = Quantity::Coulomb; return UNIT; // Coulomb (A*s) YY_BREAK case 95: YY_RULE_SETUP -#line 173 "Quantity.l" +#line 175 "Quantity.l" yylval = Quantity::Tesla; return UNIT; // Tesla (kg/s^2/A) YY_BREAK case 96: YY_RULE_SETUP -#line 174 "Quantity.l" -yylval = Quantity::Gauss; return UNIT; // Gauss (1 G = 1e-4 T) +#line 176 "Quantity.l" +yylval = Quantity::MilliTesla; return UNIT; // milli Tesla YY_BREAK case 97: YY_RULE_SETUP -#line 176 "Quantity.l" -yylval = Quantity::Weber; return UNIT; // Weber (kg*m^2/s^2/A) +#line 177 "Quantity.l" +yylval = Quantity::Gauss; return UNIT; // Gauss (1 G = 1e-4 T) YY_BREAK case 98: YY_RULE_SETUP -#line 178 "Quantity.l" -yylval = Quantity::Farad; return UNIT; // Farad (s^4*A^2/m^2/kg) +#line 179 "Quantity.l" +yylval = Quantity::Weber; return UNIT; // Weber (kg*m^2/s^2/A) YY_BREAK case 99: YY_RULE_SETUP -#line 179 "Quantity.l" -yylval = Quantity::MilliFarad; return UNIT; // milli Farad +#line 181 "Quantity.l" +yylval = Quantity::Farad; return UNIT; // Farad (s^4*A^2/m^2/kg) YY_BREAK case 100: YY_RULE_SETUP -#line 180 "Quantity.l" -yylval = Quantity::MicroFarad; return UNIT; // micro Farad +#line 182 "Quantity.l" +yylval = Quantity::MilliFarad; return UNIT; // milli Farad YY_BREAK case 101: YY_RULE_SETUP -#line 181 "Quantity.l" +#line 183 "Quantity.l" yylval = Quantity::MicroFarad; return UNIT; // micro Farad YY_BREAK case 102: YY_RULE_SETUP -#line 182 "Quantity.l" -yylval = Quantity::NanoFarad; return UNIT; // nano Farad +#line 184 "Quantity.l" +yylval = Quantity::MicroFarad; return UNIT; // micro Farad YY_BREAK case 103: YY_RULE_SETUP -#line 183 "Quantity.l" -yylval = Quantity::PicoFarad; return UNIT; // pico Farad +#line 185 "Quantity.l" +yylval = Quantity::NanoFarad; return UNIT; // nano Farad YY_BREAK case 104: YY_RULE_SETUP -#line 185 "Quantity.l" -yylval = Quantity::Henry; return UNIT; // Henry (kg*m^2/s^2/A^2) +#line 186 "Quantity.l" +yylval = Quantity::PicoFarad; return UNIT; // pico Farad YY_BREAK case 105: YY_RULE_SETUP -#line 186 "Quantity.l" -yylval = Quantity::MilliHenry; return UNIT; // milli Henry +#line 188 "Quantity.l" +yylval = Quantity::Henry; return UNIT; // Henry (kg*m^2/s^2/A^2) YY_BREAK case 106: YY_RULE_SETUP -#line 187 "Quantity.l" -yylval = Quantity::MicroHenry; return UNIT; // micro Henry +#line 189 "Quantity.l" +yylval = Quantity::MilliHenry; return UNIT; // milli Henry YY_BREAK case 107: YY_RULE_SETUP -#line 188 "Quantity.l" +#line 190 "Quantity.l" yylval = Quantity::MicroHenry; return UNIT; // micro Henry YY_BREAK case 108: YY_RULE_SETUP -#line 189 "Quantity.l" -yylval = Quantity::NanoHenry; return UNIT; // nano Henry +#line 191 "Quantity.l" +yylval = Quantity::MicroHenry; return UNIT; // micro Henry YY_BREAK case 109: YY_RULE_SETUP -#line 191 "Quantity.l" -yylval = Quantity::Joule; return UNIT; // Joule (kg*m^2/s^2) +#line 192 "Quantity.l" +yylval = Quantity::NanoHenry; return UNIT; // nano Henry YY_BREAK case 110: YY_RULE_SETUP -#line 192 "Quantity.l" -yylval = Quantity::MilliJoule; return UNIT; // milli Joule +#line 194 "Quantity.l" +yylval = Quantity::Joule; return UNIT; // Joule (kg*m^2/s^2) YY_BREAK case 111: YY_RULE_SETUP -#line 193 "Quantity.l" -yylval = Quantity::KiloJoule; return UNIT; // kilo Joule +#line 195 "Quantity.l" +yylval = Quantity::MilliJoule; return UNIT; // milli Joule YY_BREAK case 112: YY_RULE_SETUP -#line 194 "Quantity.l" -yylval = Quantity::NewtonMeter; return UNIT; // N*m = Joule +#line 196 "Quantity.l" +yylval = Quantity::KiloJoule; return UNIT; // kilo Joule YY_BREAK case 113: YY_RULE_SETUP -#line 195 "Quantity.l" -yylval = Quantity::VoltAmpereSecond; return UNIT; // V*A*s = Joule +#line 197 "Quantity.l" +yylval = Quantity::NewtonMeter; return UNIT; // N*m = Joule YY_BREAK case 114: YY_RULE_SETUP -#line 196 "Quantity.l" -yylval = Quantity::WattSecond; return UNIT; // +#line 198 "Quantity.l" +yylval = Quantity::VoltAmpereSecond; return UNIT; // V*A*s = Joule YY_BREAK case 115: YY_RULE_SETUP -#line 197 "Quantity.l" -yylval = Quantity::WattSecond; return UNIT; // W*s = Joule +#line 199 "Quantity.l" +yylval = Quantity::WattSecond; return UNIT; // YY_BREAK case 116: YY_RULE_SETUP -#line 198 "Quantity.l" -yylval = Quantity::KiloWattHour; return UNIT; // 1 kWh = 3.6e6 J +#line 200 "Quantity.l" +yylval = Quantity::WattSecond; return UNIT; // W*s = Joule YY_BREAK case 117: YY_RULE_SETUP -#line 199 "Quantity.l" -yylval = Quantity::ElectronVolt; return UNIT; // 1 eV = 1.602176634e-19 J +#line 201 "Quantity.l" +yylval = Quantity::KiloWattHour; return UNIT; // 1 kWh = 3.6e6 J YY_BREAK case 118: YY_RULE_SETUP -#line 200 "Quantity.l" -yylval = Quantity::KiloElectronVolt; return UNIT; +#line 202 "Quantity.l" +yylval = Quantity::ElectronVolt; return UNIT; // 1 eV = 1.602176634e-19 J YY_BREAK case 119: YY_RULE_SETUP -#line 201 "Quantity.l" -yylval = Quantity::MegaElectronVolt; return UNIT; +#line 203 "Quantity.l" +yylval = Quantity::KiloElectronVolt; return UNIT; YY_BREAK case 120: YY_RULE_SETUP -#line 202 "Quantity.l" -yylval = Quantity::Calorie; return UNIT; // 1 cal = 4.1868 J +#line 204 "Quantity.l" +yylval = Quantity::MegaElectronVolt; return UNIT; YY_BREAK case 121: YY_RULE_SETUP -#line 203 "Quantity.l" -yylval = Quantity::KiloCalorie; return UNIT; +#line 205 "Quantity.l" +yylval = Quantity::Calorie; return UNIT; // 1 cal = 4.1868 J YY_BREAK case 122: YY_RULE_SETUP -#line 205 "Quantity.l" -yylval = Quantity::Degree; return UNIT; // degree (internal standard angle) +#line 206 "Quantity.l" +yylval = Quantity::KiloCalorie; return UNIT; YY_BREAK case 123: YY_RULE_SETUP -#line 206 "Quantity.l" +#line 208 "Quantity.l" yylval = Quantity::Degree; return UNIT; // degree (internal standard angle) YY_BREAK case 124: YY_RULE_SETUP -#line 207 "Quantity.l" -yylval = Quantity::Radian; return UNIT; // radian +#line 209 "Quantity.l" +yylval = Quantity::Degree; return UNIT; // degree (internal standard angle) YY_BREAK case 125: YY_RULE_SETUP -#line 208 "Quantity.l" -yylval = Quantity::Gon; return UNIT; // gon +#line 210 "Quantity.l" +yylval = Quantity::Radian; return UNIT; // radian YY_BREAK case 126: YY_RULE_SETUP -#line 209 "Quantity.l" -yylval = Quantity::AngMinute; return UNIT; // minute(Angular) +#line 211 "Quantity.l" +yylval = Quantity::Gon; return UNIT; // gon YY_BREAK case 127: YY_RULE_SETUP -#line 210 "Quantity.l" +#line 212 "Quantity.l" yylval = Quantity::AngMinute; return UNIT; // minute(Angular) YY_BREAK case 128: YY_RULE_SETUP -#line 211 "Quantity.l" -yylval = Quantity::AngSecond; return UNIT; // second(Angular) +#line 213 "Quantity.l" +yylval = Quantity::AngMinute; return UNIT; // minute(Angular) YY_BREAK case 129: YY_RULE_SETUP -#line 212 "Quantity.l" +#line 214 "Quantity.l" yylval = Quantity::AngSecond; return UNIT; // second(Angular) YY_BREAK case 130: YY_RULE_SETUP -#line 214 "Quantity.l" -yylval = Quantity(1.0); return ONE; +#line 215 "Quantity.l" +yylval = Quantity::AngSecond; return UNIT; // second(Angular) YY_BREAK case 131: YY_RULE_SETUP -#line 215 "Quantity.l" -yylval = Quantity(num_change(yytext,'.',',')); return NUM; +#line 217 "Quantity.l" +yylval = Quantity(1.0); return ONE; YY_BREAK case 132: YY_RULE_SETUP -#line 216 "Quantity.l" +#line 218 "Quantity.l" yylval = Quantity(num_change(yytext,'.',',')); return NUM; YY_BREAK case 133: YY_RULE_SETUP -#line 217 "Quantity.l" -yylval = Quantity(num_change(yytext,',','.')); return NUM; +#line 219 "Quantity.l" +yylval = Quantity(num_change(yytext,'.',',')); return NUM; YY_BREAK case 134: YY_RULE_SETUP -#line 218 "Quantity.l" +#line 220 "Quantity.l" yylval = Quantity(num_change(yytext,',','.')); return NUM; YY_BREAK case 135: YY_RULE_SETUP -#line 220 "Quantity.l" -yylval = Quantity(std::numbers::pi); return NUM; // constant pi +#line 221 "Quantity.l" +yylval = Quantity(num_change(yytext,',','.')); return NUM; YY_BREAK case 136: YY_RULE_SETUP -#line 221 "Quantity.l" -yylval = Quantity(std::numbers::e); return NUM; // constant e +#line 223 "Quantity.l" +yylval = Quantity(std::numbers::pi); return NUM; // constant pi YY_BREAK case 137: YY_RULE_SETUP -#line 223 "Quantity.l" -return ACOS; +#line 224 "Quantity.l" +yylval = Quantity(std::numbers::e); return NUM; // constant e YY_BREAK case 138: YY_RULE_SETUP -#line 224 "Quantity.l" -return ASIN; +#line 226 "Quantity.l" +return ACOS; YY_BREAK case 139: YY_RULE_SETUP -#line 225 "Quantity.l" -return ATAN; +#line 227 "Quantity.l" +return ASIN; YY_BREAK case 140: YY_RULE_SETUP -#line 226 "Quantity.l" -return ATAN2; +#line 228 "Quantity.l" +return ATAN; YY_BREAK case 141: YY_RULE_SETUP -#line 227 "Quantity.l" -return COS; +#line 229 "Quantity.l" +return ATAN2; YY_BREAK case 142: YY_RULE_SETUP -#line 228 "Quantity.l" -return EXP; +#line 230 "Quantity.l" +return COS; YY_BREAK case 143: YY_RULE_SETUP -#line 229 "Quantity.l" -return ABS; +#line 231 "Quantity.l" +return EXP; YY_BREAK case 144: YY_RULE_SETUP -#line 230 "Quantity.l" -return MOD; +#line 232 "Quantity.l" +return ABS; YY_BREAK case 145: YY_RULE_SETUP -#line 231 "Quantity.l" -return LOG; +#line 233 "Quantity.l" +return MOD; YY_BREAK case 146: YY_RULE_SETUP -#line 232 "Quantity.l" -return LOG10; +#line 234 "Quantity.l" +return LOG; YY_BREAK case 147: YY_RULE_SETUP -#line 233 "Quantity.l" -return POW; +#line 235 "Quantity.l" +return LOG10; YY_BREAK case 148: YY_RULE_SETUP -#line 234 "Quantity.l" -return SIN; +#line 236 "Quantity.l" +return POW; YY_BREAK case 149: YY_RULE_SETUP -#line 235 "Quantity.l" -return SINH; +#line 237 "Quantity.l" +return SIN; YY_BREAK case 150: YY_RULE_SETUP -#line 236 "Quantity.l" -return TAN; +#line 238 "Quantity.l" +return SINH; YY_BREAK case 151: YY_RULE_SETUP -#line 237 "Quantity.l" -return TANH; +#line 239 "Quantity.l" +return TAN; YY_BREAK case 152: YY_RULE_SETUP -#line 238 "Quantity.l" -return SQRT; +#line 240 "Quantity.l" +return TANH; YY_BREAK case 153: YY_RULE_SETUP -#line 240 "Quantity.l" -return *yytext; +#line 241 "Quantity.l" +return SQRT; YY_BREAK case 154: YY_RULE_SETUP -#line 241 "Quantity.l" +#line 243 "Quantity.l" +return *yytext; + YY_BREAK +case 155: +YY_RULE_SETUP +#line 244 "Quantity.l" ECHO; YY_BREAK -#line 1706 "Quantity.lex.c" +#line 1712 "Quantity.lex.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(C_COMMENT): yyterminate(); @@ -1850,7 +1857,7 @@ case YY_STATE_EOF(C_COMMENT): */ static int yy_get_next_buffer (void) { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; @@ -2021,7 +2028,7 @@ static int yy_get_next_buffer (void) static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; - char *yy_cp = (yy_c_buf_p); + char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) @@ -2174,7 +2181,7 @@ static int yy_get_next_buffer (void) static void yy_load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); @@ -2263,7 +2270,7 @@ static void yy_load_buffer_state (void) */ void yy_flush_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) + if ( ! b ) return; b->yy_n_chars = 0; @@ -2292,7 +2299,7 @@ static void yy_load_buffer_state (void) */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) + if (new_buffer == NULL) return; yyensure_buffer_stack(); @@ -2322,7 +2329,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) */ void yypop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) + if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); @@ -2675,4 +2682,4 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 241 "Quantity.l" +#line 244 "Quantity.l" diff --git a/src/Base/Quantity.tab.c b/src/Base/Quantity.tab.c index 32fede6051..ed6a26efc1 100644 --- a/src/Base/Quantity.tab.c +++ b/src/Base/Quantity.tab.c @@ -70,7 +70,7 @@ /* First part of user prologue. */ -#line 24 "Quantity.y" +#line 26 "Quantity.y" #define YYSTYPE Quantity #define yyparse Quantity_yyparse @@ -583,10 +583,10 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int8 yyrline[] = { - 0, 43, 43, 44, 45, 46, 47, 48, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 74, 75, 76, 77, 78, 79, 81, 82 + 0, 45, 45, 46, 47, 48, 49, 50, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 76, 77, 78, 79, 80, 81, 83, 84 }; #endif @@ -1225,217 +1225,217 @@ yyreduce: switch (yyn) { case 2: /* input: %empty */ -#line 43 "Quantity.y" +#line 45 "Quantity.y" { QuantResult = Quantity(std::numeric_limits::min()); /* empty input */ } #line 1228 "Quantity.tab.c" break; case 3: /* input: num */ -#line 44 "Quantity.y" +#line 46 "Quantity.y" { QuantResult = yyvsp[0]; } #line 1234 "Quantity.tab.c" break; case 4: /* input: unit */ -#line 45 "Quantity.y" +#line 47 "Quantity.y" { QuantResult = yyvsp[0]; } #line 1240 "Quantity.tab.c" break; case 5: /* input: quantity */ -#line 46 "Quantity.y" +#line 48 "Quantity.y" { QuantResult = yyvsp[0]; } #line 1246 "Quantity.tab.c" break; case 6: /* input: quantity quantity */ -#line 47 "Quantity.y" +#line 49 "Quantity.y" { QuantResult = yyvsp[-1] + yyvsp[0]; } #line 1252 "Quantity.tab.c" break; case 7: /* input: quantity quantity quantity */ -#line 48 "Quantity.y" +#line 50 "Quantity.y" { QuantResult = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; } #line 1258 "Quantity.tab.c" break; case 8: /* num: NUM */ -#line 50 "Quantity.y" +#line 52 "Quantity.y" { yyval = yyvsp[0]; } #line 1264 "Quantity.tab.c" break; case 9: /* num: ONE */ -#line 51 "Quantity.y" +#line 53 "Quantity.y" { yyval = yyvsp[0]; } #line 1270 "Quantity.tab.c" break; case 10: /* num: num '+' num */ -#line 52 "Quantity.y" +#line 54 "Quantity.y" { yyval = Quantity(yyvsp[-2].getValue() + yyvsp[0].getValue()); } #line 1276 "Quantity.tab.c" break; case 11: /* num: num MINUSSIGN num */ -#line 53 "Quantity.y" +#line 55 "Quantity.y" { yyval = Quantity(yyvsp[-2].getValue() - yyvsp[0].getValue()); } #line 1282 "Quantity.tab.c" break; case 12: /* num: num '*' num */ -#line 54 "Quantity.y" +#line 56 "Quantity.y" { yyval = Quantity(yyvsp[-2].getValue() * yyvsp[0].getValue()); } #line 1288 "Quantity.tab.c" break; case 13: /* num: num '/' num */ -#line 55 "Quantity.y" +#line 57 "Quantity.y" { yyval = Quantity(yyvsp[-2].getValue() / yyvsp[0].getValue()); } #line 1294 "Quantity.tab.c" break; case 14: /* num: MINUSSIGN num */ -#line 56 "Quantity.y" +#line 58 "Quantity.y" { yyval = Quantity(-yyvsp[0].getValue()); } #line 1300 "Quantity.tab.c" break; case 15: /* num: num '^' num */ -#line 57 "Quantity.y" +#line 59 "Quantity.y" { yyval = Quantity(pow(yyvsp[-2].getValue(), yyvsp[0].getValue())); } #line 1306 "Quantity.tab.c" break; case 16: /* num: '(' num ')' */ -#line 58 "Quantity.y" +#line 60 "Quantity.y" { yyval = yyvsp[-1]; } #line 1312 "Quantity.tab.c" break; case 17: /* num: ACOS '(' num ')' */ -#line 59 "Quantity.y" +#line 61 "Quantity.y" { yyval = Quantity(acos(yyvsp[-1].getValue())); } #line 1318 "Quantity.tab.c" break; case 18: /* num: ASIN '(' num ')' */ -#line 60 "Quantity.y" +#line 62 "Quantity.y" { yyval = Quantity(asin(yyvsp[-1].getValue())); } #line 1324 "Quantity.tab.c" break; case 19: /* num: ATAN '(' num ')' */ -#line 61 "Quantity.y" +#line 63 "Quantity.y" { yyval = Quantity(atan(yyvsp[-1].getValue())); } #line 1330 "Quantity.tab.c" break; case 20: /* num: ABS '(' num ')' */ -#line 62 "Quantity.y" +#line 64 "Quantity.y" { yyval = Quantity(fabs(yyvsp[-1].getValue())); } #line 1336 "Quantity.tab.c" break; case 21: /* num: EXP '(' num ')' */ -#line 63 "Quantity.y" +#line 65 "Quantity.y" { yyval = Quantity(exp(yyvsp[-1].getValue())); } #line 1342 "Quantity.tab.c" break; case 22: /* num: LOG '(' num ')' */ -#line 64 "Quantity.y" +#line 66 "Quantity.y" { yyval = Quantity(log(yyvsp[-1].getValue())); } #line 1348 "Quantity.tab.c" break; case 23: /* num: LOG10 '(' num ')' */ -#line 65 "Quantity.y" +#line 67 "Quantity.y" { yyval = Quantity(log10(yyvsp[-1].getValue())); } #line 1354 "Quantity.tab.c" break; case 24: /* num: SIN '(' num ')' */ -#line 66 "Quantity.y" +#line 68 "Quantity.y" { yyval = Quantity(sin(yyvsp[-1].getValue())); } #line 1360 "Quantity.tab.c" break; case 25: /* num: SINH '(' num ')' */ -#line 67 "Quantity.y" +#line 69 "Quantity.y" { yyval = Quantity(sinh(yyvsp[-1].getValue())); } #line 1366 "Quantity.tab.c" break; case 26: /* num: TAN '(' num ')' */ -#line 68 "Quantity.y" +#line 70 "Quantity.y" { yyval = Quantity(tan(yyvsp[-1].getValue())); } #line 1372 "Quantity.tab.c" break; case 27: /* num: TANH '(' num ')' */ -#line 69 "Quantity.y" +#line 71 "Quantity.y" { yyval = Quantity(tanh(yyvsp[-1].getValue())); } #line 1378 "Quantity.tab.c" break; case 28: /* num: SQRT '(' num ')' */ -#line 70 "Quantity.y" +#line 72 "Quantity.y" { yyval = Quantity(sqrt(yyvsp[-1].getValue())); } #line 1384 "Quantity.tab.c" break; case 29: /* num: COS '(' num ')' */ -#line 71 "Quantity.y" +#line 73 "Quantity.y" { yyval = Quantity(cos(yyvsp[-1].getValue())); } #line 1390 "Quantity.tab.c" break; case 30: /* unit: UNIT */ -#line 74 "Quantity.y" +#line 76 "Quantity.y" { yyval = yyvsp[0]; } #line 1396 "Quantity.tab.c" break; case 31: /* unit: ONE '/' unit */ -#line 75 "Quantity.y" +#line 77 "Quantity.y" { yyval = Quantity(1.0)/yyvsp[0]; } #line 1402 "Quantity.tab.c" break; case 32: /* unit: unit '*' unit */ -#line 76 "Quantity.y" +#line 78 "Quantity.y" { yyval = yyvsp[-2] * yyvsp[0]; } #line 1408 "Quantity.tab.c" break; case 33: /* unit: unit '/' unit */ -#line 77 "Quantity.y" +#line 79 "Quantity.y" { yyval = yyvsp[-2] / yyvsp[0]; } #line 1414 "Quantity.tab.c" break; case 34: /* unit: unit '^' num */ -#line 78 "Quantity.y" +#line 80 "Quantity.y" { yyval = yyvsp[-2].pow (yyvsp[0]); } #line 1420 "Quantity.tab.c" break; case 35: /* unit: '(' unit ')' */ -#line 79 "Quantity.y" +#line 81 "Quantity.y" { yyval = yyvsp[-1]; } #line 1426 "Quantity.tab.c" break; case 36: /* quantity: num unit */ -#line 81 "Quantity.y" +#line 83 "Quantity.y" { yyval = yyvsp[-1]*yyvsp[0]; } #line 1432 "Quantity.tab.c" break; case 37: /* quantity: num '/' unit */ -#line 82 "Quantity.y" +#line 84 "Quantity.y" { yyval = Quantity(yyvsp[-2])/yyvsp[0]; } #line 1438 "Quantity.tab.c" break; @@ -1634,4 +1634,4 @@ yyreturnlab: return yyresult; } -#line 85 "Quantity.y" +#line 87 "Quantity.y" diff --git a/src/Base/UnitsSchemasData.h b/src/Base/UnitsSchemasData.h index d4a471d381..0d4c8ee00b 100644 --- a/src/Base/UnitsSchemasData.h +++ b/src/Base/UnitsSchemasData.h @@ -224,7 +224,7 @@ inline const UnitsSchemaSpec s3 { 0 , "A/mm^2" , 1 }} }, { "MagneticFluxDensity", { - { 1e-3 , "G" , 1e-4 }, + { 1.0 , "mT" , 1e-3 }, { 0 , "T" , 1.0 }} }, { "MagneticFieldStrength", { @@ -436,7 +436,7 @@ inline const UnitsSchemaSpec s4 { 0 , "A/mm^2" , 1.0 }} }, { "MagneticFluxDensity", { - { 1e-3 , "G" , 1e-4 }, + { 1.0 , "mT" , 1e-3 }, { 0 , "T" , 1.0 }} }, { "MagneticFieldStrength", {