Skip to content

Commit

Permalink
Update documentation (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
acodcha authored Aug 3, 2024
1 parent 12466d4 commit 62b8d8f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 59 deletions.
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Contents:
- [Introduction](#introduction)
- [Configuration](#configuration): [CMake](#configuration-cmake), [Bazel](#configuration-bazel)
- [Background](#background): [Theory](#background-theory), [Design](#background-design)
- [User Guide](#user-guide): [Basics](#user-guide-basics), [Vectors and Tensors](#user-guide-vectors-and-tensors), [Operations](#user-guide-operations), [Units](#user-guide-units), [Unit Systems](#user-guide-unit-systems), [Models](#user-guide-models), [Dimensions](#user-guide-dimensions)
- [User Guide](#user-guide): [Basics](#user-guide-basics), [Vectors and Tensors](#user-guide-vectors-and-tensors), [Operations](#user-guide-operations), [Models](#user-guide-models), [Units](#user-guide-units), [Unit Systems](#user-guide-unit-systems), [Dimensions](#user-guide-dimensions)
- [Features](#features): [Physical Quantities](#features-physical-quantities), [Models](#features-models), [Units](#features-units), [Unit Systems](#features-unit-systems)
- [Developer Guide](#developer-guide): [Documentation](#developer-guide-documentation), [Installation](#developer-guide-installation), [Testing](#developer-guide-testing), [Coverage](#developer-guide-coverage)
- [License](#license)
Expand Down Expand Up @@ -190,9 +190,9 @@ This section presents a basic guide on the use of the Physical Quantities librar
- [Basics](#user-guide-basics)
- [Vectors and Tensors](#user-guide-vectors-and-tensors)
- [Operations](#user-guide-operations)
- [Models](#user-guide-models)
- [Units](#user-guide-units)
- [Unit Systems](#user-guide-unit-systems)
- [Models](#user-guide-models)
- [Dimensions](#user-guide-dimensions)

In addition to this user guide, the full documentation of the Physical Quantities library is hosted at <https://acodcha.github.io/phq-docs>.
Expand Down Expand Up @@ -372,6 +372,29 @@ Similarly, floating-point overflows and underflows can occur during arithmetic o
[(Back to User Guide)](#user-guide)
### User Guide: Models
The Physical Quantities library supports certain physical models. These physical models allow tedious mathematical calculations to be performed easily. For example:
```C++
const std::unique_ptr<const ConstitutiveModel> constitutive_model =
std::make_unique<const ConstitutiveModel::ElasticIsotropicSolid<double>>(
PhQ::YoungModulus<double>{70.0, PhQ::Unit::Pressure::Gigapascal},
PhQ::PoissonRatio<double>{0.33});
PhQ::Strain<double> strain{
/*xx=*/32.0, /*xy=*/-4.0, /*xz=*/-2.0, /*yy=*/16.0, /*yz=*/-1.0, /*zz=*/8.0};
PhQ::Stress<double> stress = constitutive_model->Stress(strain);
std::cout << stress << std::endl;
// (4.54489164086687305e+12, -2.10526315789473663e+11, -1.05263157894736832e+11;
// 3.70278637770897803e+12, -5.26315789473684158e+10; 3.28173374613003076e+12) Pa
```

The above example creates an elastic isotropic solid constitutive model from a Young's modulus and a Poisson's ratio, and then uses it to compute the stress tensor resulting from a given strain tensor.

[(Back to User Guide)](#user-guide)

### User Guide: Units

The Physical Quantities library handles unit conversions automatically, and all unit conversions are exact to within floating-point arithmetic precision.
Expand Down Expand Up @@ -497,29 +520,6 @@ The above example shows that the pound (lbm) mass unit does not relate to any pa
[(Back to User Guide)](#user-guide)
### User Guide: Models
Some physical models and related operations are supported. Physical models allow complex mathematical calculations to be performed easily. For example:
```C++
const std::unique_ptr<const ConstitutiveModel> constitutive_model =
std::make_unique<const ConstitutiveModel::ElasticIsotropicSolid<double>>(
PhQ::YoungModulus<double>{70.0, PhQ::Unit::Pressure::Gigapascal},
PhQ::PoissonRatio<double>{0.33});
PhQ::Strain<double> strain{
/*xx=*/32.0, /*xy=*/-4.0, /*xz=*/-2.0, /*yy=*/16.0, /*yz=*/-1.0, /*zz=*/8.0};
PhQ::Stress<double> stress = constitutive_model->Stress(strain);
std::cout << stress << std::endl;
// (4.54489164086687305e+12, -2.10526315789473663e+11, -1.05263157894736832e+11;
// 3.70278637770897803e+12, -5.26315789473684158e+10; 3.28173374613003076e+12) Pa
```

The above example creates an elastic isotropic solid constitutive model from a Young's modulus and a Poisson's ratio, and then uses it to compute the stress tensor resulting from a given strain tensor.

[(Back to User Guide)](#user-guide)

### User Guide: Dimensions
Seven independent base physical dimensions form the physical dimension set of any unit of measure or physical quantity. These seven independent base physical dimensions are: time (T), length (L), mass (M), electric current (I), temperature (Θ), amount of substance (N), and luminous intensity (J). Units of measure that share the same physical dimension set are of the same type and can be converted between one another.
Expand Down
58 changes: 29 additions & 29 deletions docs/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// - \ref introduction "Introduction"
/// - \ref configuration "Configuration": \ref configuration_cmake "CMake", \ref configuration_bazel "Bazel"
/// - \ref background "Background": \ref background_theory "Theory", \ref background_design "Design"
/// - \ref user_guide "User Guide": \ref user_guide_basics "Basics", \ref user_guide_vectors_and_tensors "Vectors and Tensors", \ref user_guide_operations "Operations", \ref user_guide_units "Units", \ref user_guide_unit_systems "Unit Systems", \ref user_guide_models "Models", \ref user_guide_dimensions "Dimensions"
/// - \ref user_guide "User Guide": \ref user_guide_basics "Basics", \ref user_guide_vectors_and_tensors "Vectors and Tensors", \ref user_guide_operations "Operations", \ref user_guide_models "Models", \ref user_guide_units "Units", \ref user_guide_unit_systems "Unit Systems", \ref user_guide_dimensions "Dimensions"
/// - \ref features "Features": \ref features_physical_quantities "Physical Quantities", \ref features_models "Models", \ref features_units "Units", \ref features_unit_systems "Unit Systems"
/// - \ref developer_guide "Developer Guide": \ref developer_guide_documentation "Documentation", \ref developer_guide_installation "Installation", \ref developer_guide_testing "Testing", \ref developer_guide_coverage "Coverage"
/// - \ref license "License"
Expand Down Expand Up @@ -188,9 +188,9 @@
/// - \ref user_guide_basics "Basics"
/// - \ref user_guide_vectors_and_tensors "Vectors and Tensors"
/// - \ref user_guide_operations "Operations"
/// - \ref user_guide_models "Models"
/// - \ref user_guide_units "Units"
/// - \ref user_guide_unit_systems "Unit Systems"
/// - \ref user_guide_models "Models"
/// - \ref user_guide_dimensions "Dimensions"
///
/// In addition to this user guide, the full documentation of the Physical Quantities library is hosted at <https://acodcha.github.io/phq-docs>.
Expand Down Expand Up @@ -370,6 +370,33 @@
///
/// \ref user_guide "(Back to User Guide)"
///
/// \subsection user_guide_models User Guide: Models
///
/// The Physical Quantities library supports certain physical models. These physical models allow tedious mathematical calculations to be performed easily. For example:
///
/// ```
/// const std::unique_ptr<const ConstitutiveModel> constitutive_model =
/// std::make_unique<const ConstitutiveModel::ElasticIsotropicSolid<double>>(
/// PhQ::YoungModulus<double>{70.0, PhQ::Unit::Pressure::Gigapascal},
/// PhQ::PoissonRatio<double>{0.33});
///
/// PhQ::Strain<double> strain{32.0, // xx
/// -4.0, // xy
/// -2.0, // xz
/// 16.0, // yy
/// -1.0, // yz
/// 8.0}; // zz
///
/// PhQ::Stress<double> stress = constitutive_model->Stress(strain);
/// std::cout << stress << std::endl;
/// // (4.54489164086687305e+12, -2.10526315789473663e+11, -1.05263157894736832e+11;
/// // 3.70278637770897803e+12, -5.26315789473684158e+10; 3.28173374613003076e+12) Pa
/// ```
///
/// The above example creates an elastic isotropic solid constitutive model from a Young's modulus and a Poisson's ratio, and then uses it to compute the stress tensor resulting from a given strain tensor.
///
/// \ref user_guide "(Back to User Guide)"
///
/// \subsection user_guide_units User Guide: Units
///
/// The Physical Quantities library handles unit conversions automatically, and all unit conversions are exact to within floating-point arithmetic precision.
Expand Down Expand Up @@ -495,33 +522,6 @@
///
/// \ref user_guide "(Back to User Guide)"
///
/// \subsection user_guide_models User Guide: Models
///
/// Some physical models and related operations are supported. Physical models allow complex mathematical calculations to be performed easily. For example:
///
/// ```
/// const std::unique_ptr<const ConstitutiveModel> constitutive_model =
/// std::make_unique<const ConstitutiveModel::ElasticIsotropicSolid<double>>(
/// PhQ::YoungModulus<double>{70.0, PhQ::Unit::Pressure::Gigapascal},
/// PhQ::PoissonRatio<double>{0.33});
///
/// PhQ::Strain<double> strain{32.0, // xx
/// -4.0, // xy
/// -2.0, // xz
/// 16.0, // yy
/// -1.0, // yz
/// 8.0}; // zz
///
/// PhQ::Stress<double> stress = constitutive_model->Stress(strain);
/// std::cout << stress << std::endl;
/// // (4.54489164086687305e+12, -2.10526315789473663e+11, -1.05263157894736832e+11;
/// // 3.70278637770897803e+12, -5.26315789473684158e+10; 3.28173374613003076e+12) Pa
/// ```
///
/// The above example creates an elastic isotropic solid constitutive model from a Young's modulus and a Poisson's ratio, and then uses it to compute the stress tensor resulting from a given strain tensor.
///
/// \ref user_guide "(Back to User Guide)"
///
/// \subsection user_guide_dimensions User Guide: Dimensions
///
/// Seven independent base physical dimensions form the physical dimension set of any unit of measure or physical quantity. These seven independent base physical dimensions are: time (T), length (L), mass (M), electric current (I), temperature (Θ), amount of substance (N), and luminous intensity (J). Units of measure that share the same physical dimension set are of the same type and can be converted between one another.
Expand Down
2 changes: 1 addition & 1 deletion include/PhQ/PWaveModulus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace PhQ {
/// \brief P-wave modulus of elasticity of a deformable solid material. A measure of a deformable
/// solid material's elastic modulus. For other measures of a material's elastic modulus, see
/// PhQ::YoungModulus, PhQ::ShearModulus, PhQ::IsentropicBulkModulus, PhQ::IsothermalBulkModulus,
/// PhQ::LameModulus, and PhQ::PoissonRatio.
/// PhQ::LameFirstModulus, and PhQ::PoissonRatio.
template <typename NumericType = double>
class PWaveModulus : public DimensionalScalar<Unit::Pressure, NumericType> {
public:
Expand Down
4 changes: 2 additions & 2 deletions include/PhQ/ShearModulus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace PhQ {

/// \brief Shear modulus of elasticity of a deformable solid material. A measure of a deformable
/// solid material's elastic modulus. For other measures of a material's elastic modulus, see
/// PhQ::YoungModulus, PhQ::IsentropicBulkModulus, PhQ::IsothermalBulkModulus, PhQ::LameModulus,
/// PhQ::PWaveModulus, and PhQ::PoissonRatio.
/// PhQ::YoungModulus, PhQ::IsentropicBulkModulus, PhQ::IsothermalBulkModulus,
/// PhQ::LameFirstModulus, PhQ::PWaveModulus, and PhQ::PoissonRatio.
template <typename NumericType = double>
class ShearModulus : public DimensionalScalar<Unit::Pressure, NumericType> {
public:
Expand Down
4 changes: 2 additions & 2 deletions include/PhQ/YoungModulus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace PhQ {

/// \brief Young's modulus of elasticity of a deformable solid material. A measure of a deformable
/// solid material's elastic modulus. For other measures of a material's elastic modulus, see
/// PhQ::ShearModulus, PhQ::IsentropicBulkModulus, PhQ::IsothermalBulkModulus, PhQ::LameModulus,
/// PhQ::PWaveModulus, and PhQ::PoissonRatio.
/// PhQ::ShearModulus, PhQ::IsentropicBulkModulus, PhQ::IsothermalBulkModulus,
/// PhQ::LameFirstModulus, PhQ::PWaveModulus, and PhQ::PoissonRatio.
template <typename NumericType = double>
class YoungModulus : public DimensionalScalar<Unit::Pressure, NumericType> {
public:
Expand Down

0 comments on commit 62b8d8f

Please sign in to comment.