-
Notifications
You must be signed in to change notification settings - Fork 57
Merge added dimensions and units #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mwpowellhtx
wants to merge
3
commits into
boostorg:master
Choose a base branch
from
mwpowellhtx:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and | ||
// unit/quantity manipulation and conversion | ||
// | ||
// Copyright (C) 2003-2008 Matthias Christian Schabel | ||
// Copyright (C) 2008 Steven Watanabe | ||
// Copyright (C) 2015 Michael William Powell | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See | ||
// accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef BOOST_UNITS_DRAG_FACTOR_DERIVED_DIMENSION_HPP | ||
#define BOOST_UNITS_DRAG_FACTOR_DERIVED_DIMENSION_HPP | ||
|
||
#include <boost/units/derived_dimension.hpp> | ||
#include <boost/units/physical_dimensions/length.hpp> | ||
|
||
namespace boost { | ||
|
||
namespace units { | ||
|
||
/// derived dimension for drag factor : L^-1 | ||
typedef derived_dimension<length_base_dimension,-1>::type drag_factor_dimension; | ||
|
||
} // namespace units | ||
|
||
} // namespace boost | ||
|
||
#endif // BOOST_UNITS_DRAG_FACTOR_DERIVED_DIMENSION_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and | ||
// unit/quantity manipulation and conversion | ||
// | ||
// Copyright (C) 2003-2008 Matthias Christian Schabel | ||
// Copyright (C) 2008 Steven Watanabe | ||
// Copyright (C) 2015 Michael William Powell | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See | ||
// accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef BOOST_UNITS_MOLAR_MASS_DERIVED_DIMENSION_HPP | ||
#define BOOST_UNITS_MOLAR_MASS_DERIVED_DIMENSION_HPP | ||
|
||
#include <boost/units/derived_dimension.hpp> | ||
#include <boost/units/physical_dimensions/mass.hpp> | ||
#include <boost/units/physical_dimensions/amount.hpp> | ||
|
||
namespace boost { | ||
|
||
namespace units { | ||
|
||
/// derived dimension for molar mass : M Amount^-1 | ||
typedef derived_dimension<mass_base_dimension,1, | ||
amount_base_dimension,-1>::type molar_mass_dimension; | ||
|
||
} // namespace units | ||
|
||
} // namespace boost | ||
|
||
#endif // BOOST_UNITS_MOLAR_MASS_DERIVED_DIMENSION_HPP |
46 changes: 46 additions & 0 deletions
46
include/boost/units/physical_dimensions/specific_gas_constant.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and | ||
// unit/quantity manipulation and conversion | ||
// | ||
// Copyright (C) 2003-2008 Matthias Christian Schabel | ||
// Copyright (C) 2008 Steven Watanabe | ||
// Copyright (C) 2015 Michael William Powell | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See | ||
// accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef BOOST_UNITS_SPECIFIC_GAS_CONSTANT_DERIVED_DIMENSION_HPP | ||
#define BOOST_UNITS_SPECIFIC_GAS_CONSTANT_DERIVED_DIMENSION_HPP | ||
|
||
#include <boost/units/derived_dimension.hpp> | ||
#include <boost/units/physical_dimensions/length.hpp> | ||
#include <boost/units/physical_dimensions/time.hpp> | ||
#include <boost/units/physical_dimensions/temperature.hpp> | ||
|
||
//#include <boost/units/physical_dimensions/energy.hpp> | ||
//#include <boost/units/physical_dimensions/mass.hpp> | ||
|
||
namespace boost { | ||
|
||
namespace units { | ||
|
||
///// derived dimension for specific gas constant : J M^-1 Theta^-1 | ||
//typedef derived_dimension<energy_dimension,1, | ||
// mass_base_dimension,-1, | ||
// temperature_base_dimension,-1>::type specific_gas_constant_dimension; | ||
|
||
/// derived dimension for specific gas constant : J M^-1 Theta^-1 | ||
/// which effectively reduces to : L^-2 T^-2 Theta^-1 | ||
typedef derived_dimension<length_base_dimension,2, | ||
temperature_base_dimension,-1, | ||
time_base_dimension,-2>::type specific_gas_constant_dimension; | ||
|
||
//typedef derived_dimension<energy_dimension, 1, | ||
// mass_base_dimension, -1, | ||
// temperature_base_dimension, -1>::type specific_gas_constant_dimension2; | ||
|
||
} // namespace units | ||
|
||
} // namespace boost | ||
|
||
#endif // BOOST_UNITS_SPECIFIC_GAS_CONSTANT_DERIVED_DIMENSION_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and | ||
// unit/quantity manipulation and conversion | ||
// | ||
// Copyright (C) 2003-2008 Matthias Christian Schabel | ||
// Copyright (C) 2008 Steven Watanabe | ||
// Copyright (C) 2015 Michael William Powell | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See | ||
// accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef BOOST_UNITS_SI_DRAG_FACTOR_HPP | ||
#define BOOST_UNITS_SI_DRAG_FACTOR_HPP | ||
|
||
#include <boost/units/systems/si/base.hpp> | ||
#include <boost/units/physical_dimensions/drag_factor.hpp> | ||
|
||
namespace boost { | ||
|
||
namespace units { | ||
|
||
namespace si { | ||
|
||
typedef unit<drag_factor_dimension,si::system> drag_factor; | ||
|
||
BOOST_UNITS_STATIC_CONSTANT(dragfactor, drag_factor); | ||
|
||
// "K" | ||
|
||
} // namespace si | ||
|
||
} // namespace units | ||
|
||
} // namespace boost | ||
|
||
#endif // BOOST_UNITS_SI_DRAG_FACTOR_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and | ||
// unit/quantity manipulation and conversion | ||
// | ||
// Copyright (C) 2003-2008 Matthias Christian Schabel | ||
// Copyright (C) 2008 Steven Watanabe | ||
// Copyright (C) 2015 Michael William Powell | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See | ||
// accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef BOOST_UNITS_SI_MOLAR_MASS_HPP | ||
#define BOOST_UNITS_SI_MOLAR_MASS_HPP | ||
|
||
#include <boost/units/systems/si/base.hpp> | ||
#include <boost/units/physical_dimensions/molar_mass.hpp> | ||
|
||
namespace boost { | ||
|
||
namespace units { | ||
|
||
namespace si { | ||
|
||
typedef unit<molar_mass_dimension,si::system> molar_mass; | ||
|
||
BOOST_UNITS_STATIC_CONSTANT(kilogram_per_mole, molar_mass); | ||
BOOST_UNITS_STATIC_CONSTANT(kilograms_per_mole, molar_mass); | ||
BOOST_UNITS_STATIC_CONSTANT(kilogramme_per_mole, molar_mass); | ||
BOOST_UNITS_STATIC_CONSTANT(kilogrammes_per_mole, molar_mass); | ||
|
||
} // namespace si | ||
|
||
} // namespace units | ||
|
||
} // namespace boost | ||
|
||
#endif // BOOST_UNITS_SI_MASS_DENSITY_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and | ||
// unit/quantity manipulation and conversion | ||
// | ||
// Copyright (C) 2003-2008 Matthias Christian Schabel | ||
// Copyright (C) 2008 Steven Watanabe | ||
// Copyright (C) 2015 Michael William Powell | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See | ||
// accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#ifndef BOOST_UNITS_SI_SPECIFIC_GAS_CONSTANT_HPP | ||
#define BOOST_UNITS_SI_SPECIFIC_GAS_CONSTANT_HPP | ||
|
||
#include <boost/units/systems/si/base.hpp> | ||
#include <boost/units/physical_dimensions/specific_gas_constant.hpp> | ||
|
||
namespace boost { | ||
|
||
namespace units { | ||
|
||
namespace si { | ||
|
||
typedef unit<specific_gas_constant_dimension,si::system> specific_gas_constant; | ||
|
||
BOOST_UNITS_STATIC_CONSTANT(joule_per_kilogram_kelvins, specific_gas_constant); | ||
BOOST_UNITS_STATIC_CONSTANT(joules_per_kilogram_kelvins, specific_gas_constant); | ||
BOOST_UNITS_STATIC_CONSTANT(joule_per_kilogramme_kelvins, specific_gas_constant); | ||
BOOST_UNITS_STATIC_CONSTANT(joules_per_kilogrammes_kelvins, specific_gas_constant); | ||
|
||
} // namespace si | ||
|
||
} // namespace units | ||
|
||
} // namespace boost | ||
|
||
#endif // BOOST_UNITS_SI_SPECIFIC_GAS_CONSTANT_HPP |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you should add singular version of kelvins as well? I.e. joule_per_kilogram_kelvin and 3 other variants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly, if I have a need for it, I will patch it. Other's contributions are also welcomed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a question of one's need, but of consistency...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The harder question is how to persuade the units system to accept a true energy (Joules) per mass (kilogram) temperature (kelvins). The closest I could come up with was to "manually" reduce the dimensions, which will work when you involve the quantity calculations, but does not appear to be technically correct, according to the Specific Gas Constant docs I was reading. I don't have any ready answers where that's concerned. Can you help with those bits?