[FEM] add current density constraint

- also add corresponding App::PropertyCurrentDensity

- also fix a typo in test_object.py
This commit is contained in:
Uwe
2023-02-04 08:07:13 +01:00
parent 1f7ab06160
commit 65eb154eac
18 changed files with 625 additions and 17 deletions

View File

@@ -1914,6 +1914,7 @@ void Application::initTypes()
App::PropertyAcceleration ::init();
App::PropertyForce ::init();
App::PropertyPressure ::init();
App::PropertyCurrentDensity ::init();
App::PropertyElectricPotential ::init();
App::PropertyVacuumPermittivity ::init();
App::PropertyInteger ::init();

View File

@@ -20,9 +20,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <cfloat>
#endif
@@ -88,7 +86,6 @@ Base::Quantity PropertyQuantity::createQuantityFromPy(PyObject *value)
return quant;
}
void PropertyQuantity::setPyObject(PyObject *value)
{
// Set the unit if Unit object supplied, else check the unit
@@ -140,7 +137,6 @@ const boost::any PropertyQuantity::getPathValue(const ObjectIdentifier & /*path*
TYPESYSTEM_SOURCE(App::PropertyQuantityConstraint, App::PropertyQuantity)
void PropertyQuantityConstraint::setConstraints(const Constraints* sConstrain)
{
_ConstStruct = sConstrain;
@@ -151,7 +147,6 @@ const char* PropertyQuantityConstraint::getEditorName() const
return "Gui::PropertyEditor::PropertyUnitConstraintItem";
}
const PropertyQuantityConstraint::Constraints* PropertyQuantityConstraint::getConstraints() const
{
return _ConstStruct;
@@ -253,6 +248,18 @@ PropertyDistance::PropertyDistance()
setUnit(Base::Unit::Length);
}
//**************************************************************************
//**************************************************************************
// PropertyCurrentDensity
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TYPESYSTEM_SOURCE(App::PropertyCurrentDensity, App::PropertyQuantity)
PropertyCurrentDensity::PropertyCurrentDensity()
{
setUnit(Base::Unit::CurrentDensity);
}
//**************************************************************************
//**************************************************************************
// PropertyElectricPotential

View File

@@ -172,6 +172,19 @@ public:
~PropertyDistance() override = default;
};
/** CurrentDensity property
* This is a property for electric current densities. It is basically a float
* property. On the Gui it has a quantity of Ampere/m^2.
*/
class AppExport PropertyCurrentDensity: public PropertyQuantity
{
TYPESYSTEM_HEADER_WITH_OVERRIDE();
public:
PropertyCurrentDensity();
~PropertyCurrentDensity() override = default;
};
/** ElectricPotential property
* This is a property for electric potentials. It is basically a float
* property. On the Gui it has a quantity of Volt.