Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
26af1f95
Commit
26af1f95
authored
7 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Plain Diff
Merge branch 'units_print' into 'master'
Add a print units See merge request
!463
parents
cb0b4486
7813154b
No related branches found
No related tags found
1 merge request
!463
Add a print units
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/units.c
+14
-0
14 additions, 0 deletions
src/units.c
src/units.h
+2
-0
2 additions, 0 deletions
src/units.h
with
16 additions
and
0 deletions
src/units.c
+
14
−
0
View file @
26af1f95
...
@@ -587,3 +587,17 @@ double units_conversion_factor(const struct unit_system* from,
...
@@ -587,3 +587,17 @@ double units_conversion_factor(const struct unit_system* from,
return
units_general_conversion_factor
(
from
,
to
,
baseUnitsExp
);
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
);
}
This diff is collapsed.
Click to expand it.
src/units.h
+
2
−
0
View file @
26af1f95
...
@@ -137,4 +137,6 @@ double units_conversion_factor(const struct unit_system* from,
...
@@ -137,4 +137,6 @@ double units_conversion_factor(const struct unit_system* from,
const
struct
unit_system
*
to
,
const
struct
unit_system
*
to
,
enum
unit_conversion_factor
unit
);
enum
unit_conversion_factor
unit
);
void
units_print
(
const
struct
unit_system
*
us
);
#endif
/* SWIFT_UNITS_H */
#endif
/* SWIFT_UNITS_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment