I have noticed that this problem does not happen when I remove the following part of code:
Code: Select all
<units>
<unit_magnitude n="Angle" pn="Angle" default="deg" SI_base="rad">
<unit n="deg" pn="degree" p="1" factor="0.01745329251994" help="degree=1/180[pi.rad]"/>
<unit n="rad" pn="radian" p="2" units_system="SI" factor="1.0"/>
<unit n="°" pn="degree" p="3" factor="0.01745329251994" printable_name="deg"/>
</unit_magnitude>
<unit_magnitude n="F" pn="Force" default="kN" SI_base="N" basic="L*M/T^2">
<unit n="N" pn="newton" p="2" units_system="SI" factor="1.0" help="Newton=[Kg.m/s2]"/>
<unit n="kN" pn="kilonewton" p="1" units_system="SI"/>
</unit_magnitude>
<unit_magnitude n="L" pn="Length" default="m" SI_base="m">
<unit n="m" pn="meter" p="1" units_system="SI" factor="1.0"/>
<unit n="cm" pn="centimeter" p="2" units_system="SI"/>
<unit n="mm" pn="millimeter" p="2" units_system="SI"/>
<unit n="um" pn="micrometer" p="2" factor="1.0e-6"/>
<unit n="µm" pn="micrometer" p="2" printable_name="um" units_system="SI"/>
</unit_magnitude>
<unit_magnitude n="P" pn="Pressure" default="kPa" SI_base="Pa" basic="F/L^2">
<unit n="Pa" pn="pascal" p="2" units_system="SI" factor="1.0" help="Pascal=[N/m2]"/>
<unit n="kPa" pn="kilopascal" p="1" units_system="SI"/>
<unit n="MPa" pn="megapascal" p="2" units_system="SI"/>
</unit_magnitude>
<unit_magnitude n="Temp" pn="Temperature" default="°C" SI_base="K">
<unit n="°C" pn="degree Celsius" p="1" units_system="SI" factor="1.0" addend="273.15" help="V[default]=(V[unit]+addend)*factor" printable_name="oC"/>
<unit n="K" pn="kelvin" p="2" units_system="SI" factor="1.0"/>
<unit n="°F" pn="degree Farenheit" p="3" units_system="imperial" factor="0.5555555555555556" addend="459.67" help="V[default]=(V[unit]+addend)*factor" printable_name="oF"/>
</unit_magnitude>
</units>
Is there a problem with this code snippet?
Explaning the reason that I wrote this code snippet:
To define the units in the model, I use an approach similar to "cmas2d_customlib" available in the problem type examples. There, the field 'units' is discribed with the following comment: "by now it is compulsory define this node if units are used (could be empty if defaults are enough)".
I use the field 'units' to change default unit (eg. Force -> kN, Angle -> deg, etc...) and to change the priority of units (field 'p' of 'unit', that assumes values 1,2 or 3).
Yet based on "cmas2d_customlib", use the following structure to allow the user change the units:
Code: Select all
<value n='units_mesh' pn='Geometry units' unit_mesh_definition="1"/>
<value n='units_system' pn='Units system' units_system_definition="1">
<dependencies node="//*[@unit_definition or @unit_mesh_definition='1']" att1='change_units_system' v1='{@v}'/>
</value>
<container n="basic_units" pn="Basic units" icon="tree/BasicUnits" help="Basic units to be used in the analysis.">
<value n="units_angle" pn="Angle" unit_definition="Angle"/>
<value n="units_force" pn="Force" unit_definition="F"/>
<value n='units_length' pn='Length' unit_definition="L"/>
<value n="units_pressure" pn="Pressure" unit_definition="P"/>
<value n="units_temperature" pn="Temperature" unit_definition="Temp"/>
</container>
To reaffirm: only removing the first piece of code solves the transformation problem, but I lose the ability to control the standard units and the priority of each one.
How should I proceed in this case?
Regards,
Francisco Dias.