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
26af1f95
Commit
26af1f95
authored
Dec 01, 2017
by
Peter W. Draper
Browse files
Merge branch 'units_print' into 'master'
Add a print units See merge request
!463
parents
cb0b4486
7813154b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/units.c
View file @
26af1f95
...
...
@@ -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 @
26af1f95
...
...
@@ -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