Commit Graph

60 Commits

Author SHA1 Message Date
Uwe
201b95a5b2 [Core] add quantity Magnetization
- needed for FEM and Material
2023-02-08 20:33:58 +01:00
Uwe
b41776d077 [Core] disable the the unit Oersted
- is not feasible for practical usage and (was up to now not used, thus no consequence)
  moreover, Oersted is a cgs unit while we use SI units, thus also not suitable for FEM, only makes problems for magnetization
2023-02-08 19:59:36 +01:00
Uwe
2880a5ca2a [Core] add current density
- necessary to implement electromagnetic features to the FEM WB
2023-02-04 03:22:24 -06:00
wmayer
c538824309 Base: [skip ci] fix scale factor in unit schemes 2022-08-24 11:24:52 +02:00
wmayer
a899f078bd CMake: [skip ci] remove trailing whitespaces 2022-08-24 07:46:07 +02:00
Jonas Bähr
983e13c3b7 Fix build on MacOS-X 10.14: missing cmath header
This undoes a small part of commit 9ec0bcdcf2,
which seems a bit too agressive. Without the cmath header the build fails
using Apple clang version 11.0.0 (clang-1100.0.33.17) on Mojave with the
following error:

.../FreeCAD-git/src/Base/UnitsSchemaInternal.cpp:39:24: error: call to 'abs' is ambiguous
    double UnitValue = std::abs(quant.getValue());
                       ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:132:6: note: candidate function
int      abs(int) __pure2;
         ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:111:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long      abs(     long __x) _NOEXCEPT {return  labs(__x);}
                                           ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:113:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
                                           ^
1 error generated.
2022-08-24 07:40:04 +02:00
Uwe
262658685a [Gui] revert the revert of setting unit factor for F/m
- see https://github.com/FreeCAD/FreeCAD/commit/9db5dff7#r81159352
2022-08-14 22:58:12 +02:00
Uwe
37a3338537 [Gui] revert setting unit factor for F/m
- see https://github.com/FreeCAD/FreeCAD/commit/9db5dff7#r81159352
2022-08-14 20:49:58 +02:00
Uwe
9db5dff744 [FEM] fix handling of vacuum permittivity
- fix message that permittivity object was not handled
- set an expression, otherwise the user gets only "0.000" for the default of 8.8e-12
- use as unit the common "F/m" (this is also more user-friendly than "s^4*A^2 / (m^3*kg)")
- fix a ToDo
2022-08-14 17:59:42 +02:00
Uwe
7bf9f30c5f [Base] UnitsSchemaInternal: improve code readability 2022-07-02 05:15:11 +02:00
Stefan Brüns
bd58a73731 Base: Fix wrong character encoding for micro-siemens
Contrary to any other Unit with micro prefix (e.g. ug, uH, uF) the
string was created with a Latin1 encoding instead of UTF-8.

The problem can be verified with these python statements:
```
FreeCAD.Units.schemaTranslate(FreeCAD.Units.MicroSiemens, 0)
FreeCAD.Units.schemaTranslate(FreeCAD.Units.MicroGram, 0)
```
2022-03-06 11:20:09 -05:00
Uwe
9ec0bcdcf2 [Base] Units and Uui: remove unused includes 2022-02-24 11:08:56 +01:00
Preslav
4ab37fc0ca Added stiffness units to FreeCAD [mN/m, N/m, kN/m, MN/m] 2021-08-16 12:27:41 +01:00
donovaly
bcc669b930 [Base] add electrical conductivity
- this is necessary to perform electrodynamics simulations. Since the typical values are in the range of 1e6 S/m, we need the new units kS and MS

- since this is for simulations, also add electrical conductivity to the FEM material cards
2021-03-25 17:13:52 +01:00
qingfengxia
5da01ab8b0 Base: add VolExpansionCoeff and complete KinematicViscosity unit 2020-05-23 00:03:09 +02:00
wmayer
ec8b1bc072 [skip ci] use QLocale class consistently to make it possible to change it application-wide 2020-03-26 16:37:45 +01:00
donovaly
66354b3c58 add units Gauss, Weber and Oersted 2020-01-07 07:36:22 -03:00
donovaly
05dadb4c75 add the units Ohm and Siemens 2020-01-05 15:00:46 +01:00
luz.paz
6f11ed298a src/Base: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Base` files
2019-12-25 11:38:58 +01:00
donovaly
cd8b63028c missing parts from from commit d9d903faea
- also add keV and MeV since these are the units used in practice
2019-12-24 13:31:00 +01:00
donovaly
9c707479a6 also add unit THz as requested 2019-12-23 16:49:45 +01:00
donovaly
2949afb55b add mJ and kW
- also some fixes
- add conversions for forces
2019-12-19 13:31:12 +01:00
donovaly
317dd26a7d correct Unit::Work conversions
- also add conversions for Unit::Mass and Unit::Power
2019-12-19 13:31:12 +01:00
donovaly
f5f0728a9f take care of the UnitsCalculator
- also fix uF and uH
- add conversion routine for C and T
2019-12-19 13:31:12 +01:00
donovaly
1ffaaf100a generate QuantityLexer.c
- also set proper unit conversions
- fix MilliWatt and MilliMole
2019-12-19 13:31:12 +01:00
donovaly
82dc8e88f5 add the following units:
- mmol
- ml
- bar
- mbar
- kJ
- kWh
- eV
- C
- T
- F (p, n, u, m)
- H (n, u, m)
2019-12-19 13:31:12 +01:00
wmayer
d7ca604c99 Support for Frequency in quantity parser 2019-10-21 11:49:55 +02:00
luz.paz
4c2f2cd210 Misc. typos and whitespace
Found via `codespell -q 3 --skip="*.po,*.ts,./.git,./src/3rdParty,./src/CXX,./src/zipios++,./src/Mod/Assembly/App/opendcm,./ChangeLog.txt" -I ../fc-word-whitelist.txt` and `grep`. Excess whitespace auto-removed by Atom editor.
2018-11-03 16:13:06 -03:00
wmayer
9aab910981 add derived unit electric potential 2017-10-16 21:56:13 +02:00
Harald Geyer
ed7630503c Fix rendering of Unit::ThermalConductivity
The old behaviour was:
>>> Quantity('0.9 W/m/K').UserString
u'0.00 W/mm/K'
>>> Quantity('1.1 W/m/K').UserString
u'1.10 W/m/K'
>>> Quantity('1100 W/m/K').UserString
u'1100.00 W/m/K'

The new behaviour is:
>>> Quantity('0.9 W/m/K').UserString
u'0.90 W/m/K'
>>> Quantity('1.1 W/m/K').UserString
u'1.10 W/m/K'
>>> Quantity('1100 W/m/K').UserString
u'1.10 W/mm/K'
2017-10-10 20:35:33 +02:00
Oliver Oxtoby
38fa712032 Base: Add DynamicViscosity and SpecificEnergy units 2017-08-20 16:50:11 +02:00
wmayer
7ab8a9996d fixes #0003137: Unit UserString wrong 2017-07-24 16:52:03 +02:00
wmayer
63f9e6c528 quantities must be expressed in units m,g,s for MKS and internal scheme 2017-06-18 23:43:42 +02:00
Itai Nahshon
634cbf1566 Add Units schemaTranslate for Unit::Velocity.
Independent of scale, use only mm/min or in/min because it is compatible
with GCODE feed rate units.
(My use case is definition os feed-rates in PathLoadTool.py).
2017-06-18 17:11:49 +02:00
vdwalts
9a3b750fb7 Base: Units for FEM, new heat and heat flux functions 2016-12-21 11:27:41 -02:00
wmayer
f39b89a54d add class QuantityFormat to control user string of Quantity
do some code refactoration to reduce duplicate code
2016-08-06 19:06:29 +02:00
wmayer
7979ec275b fix bug in factor for Pa in units system 2016-08-05 13:57:27 +02:00
wmayer
1eca045744 use the unicode symbol for mu 2016-08-05 10:38:33 +02:00
wmayer
6176756b28 use const reference in schemaTranslate to avoid tmp. copy 2016-08-05 10:33:41 +02:00
wmayer
5cb8873794 improve whitespaces, fix typos 2016-08-05 10:00:12 +02:00
wmayer
1c89c566c9 whitespace improvements 2016-08-04 17:45:04 +02:00
vdwalts
f9c5661096 Base: Units: add units for thermomechanical analysis 2016-08-04 17:45:04 +02:00
WandererFan
eabc483c6c Use Units Decimals pref in Quantity::getUserString 2016-07-21 12:55:39 -04:00
Przemo Firszt
7d8fb99cea Units: Add Density to internal schema
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-31 14:04:14 -03:00
Przemo Firszt
b7e7f1f40a Base: Handle Unit::Stress tha same way as Unit::Pressure in UnitsSchema
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-18 16:43:45 +01:00
Przemo Firszt
72b73d8208 Base: Fix pressure unit problem in internal unit schema
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:09 +02:00
jriegel
9af9283d19 Using Locale delimiter 2014-02-10 21:25:53 +01:00
jriegel
152ecf2df9 More choices in Sketcher grid and later switching to um 2013-12-21 19:15:28 +01:00
jriegel
e7e0bbfbe5 Try to fix std::abs() error... 2013-12-16 00:20:47 +01:00
jriegel
73684a9fdb fix negative value cascading in unti schemas 2013-12-16 00:02:58 +01:00