Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
7813154b
Commit
7813154b
authored
Dec 01, 2017
by
lhausamm
Browse files
Add a print units
parent
c1f773e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/units.c
View file @
7813154b
...
...
@@ -587,3 +587,17 @@ double units_conversion_factor(const struct unit_system* from,
return
units_general_conversion_factor
(
from
,
to
,
baseUnitsExp
);
}
/**
* @brief print a #unit_system
*
* @param us The #unit_system
*/
void
units_print
(
const
struct
unit_system
*
us
)
{
message
(
"Units:"
);
message
(
"
\t
Unit Mass: %g"
,
us
->
UnitMass_in_cgs
);
message
(
"
\t
Unit Length: %g"
,
us
->
UnitLength_in_cgs
);
message
(
"
\t
Unit Time: %g"
,
us
->
UnitTime_in_cgs
);
message
(
"
\t
Unit Current: %g"
,
us
->
UnitCurrent_in_cgs
);
message
(
"
\t
Unit Temperature: %g"
,
us
->
UnitTemperature_in_cgs
);
}
src/units.h
View file @
7813154b
...
...
@@ -137,4 +137,6 @@ double units_conversion_factor(const struct unit_system* from,
const
struct
unit_system
*
to
,
enum
unit_conversion_factor
unit
);
void
units_print
(
const
struct
unit_system
*
us
);
#endif
/* SWIFT_UNITS_H */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment