[Core] add current density
- necessary to implement electromagnetic features to the FEM WB
This commit is contained in:
@@ -448,6 +448,8 @@ QString Unit::getTypeString() const
|
||||
return QString::fromLatin1("Acceleration");
|
||||
if(*this == Unit::Temperature )
|
||||
return QString::fromLatin1("Temperature");
|
||||
if (*this == Unit::CurrentDensity)
|
||||
return QString::fromLatin1("CurrentDensity");
|
||||
if(*this == Unit::ElectricCurrent )
|
||||
return QString::fromLatin1("ElectricCurrent");
|
||||
if(*this == Unit::ElectricPotential )
|
||||
@@ -526,6 +528,7 @@ Unit Unit::Velocity(1,0,-1);
|
||||
Unit Unit::Acceleration(1,0,-2);
|
||||
Unit Unit::Temperature(0,0,0,0,1);
|
||||
|
||||
Unit Unit::CurrentDensity(-2,0,0,1);
|
||||
Unit Unit::ElectricCurrent(0,0,0,1);
|
||||
Unit Unit::ElectricPotential(2,1,-3,-1);
|
||||
Unit Unit::ElectricCharge(0,0,1,1);
|
||||
|
||||
@@ -107,6 +107,7 @@ public:
|
||||
static Unit Acceleration;
|
||||
static Unit Temperature;
|
||||
|
||||
static Unit CurrentDensity;
|
||||
static Unit ElectricCurrent;
|
||||
static Unit ElectricPotential;
|
||||
static Unit ElectricCharge;
|
||||
|
||||
@@ -331,6 +331,16 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
|
||||
unitString = QString::fromLatin1("C");
|
||||
factor = 1.0;
|
||||
}
|
||||
else if (unit == Unit::CurrentDensity) {
|
||||
if (UnitValue <= 1e3) {
|
||||
unitString = QString::fromLatin1("A/m^2");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else {
|
||||
unitString = QString::fromLatin1("A/mm^2");
|
||||
factor = 1;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::MagneticFluxDensity) {
|
||||
if (UnitValue <= 1e-3) {
|
||||
unitString = QString::fromLatin1("G");
|
||||
|
||||
@@ -279,6 +279,16 @@ QString UnitsSchemaMKS::schemaTranslate(const Quantity &quant, double &factor, Q
|
||||
unitString = QString::fromLatin1("C");
|
||||
factor = 1.0;
|
||||
}
|
||||
else if (unit == Unit::CurrentDensity) {
|
||||
if (UnitValue <= 1e3) {
|
||||
unitString = QString::fromLatin1("A/m^2");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else {
|
||||
unitString = QString::fromLatin1("A/mm^2");
|
||||
factor = 1;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::MagneticFluxDensity) {
|
||||
if (UnitValue <= 1e-3) {
|
||||
unitString = QString::fromLatin1("G");
|
||||
|
||||
Reference in New Issue
Block a user