Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ab700293fb19
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e94a7f85dd91
Choose a head ref
  • 4 commits
  • 6 files changed
  • 1 contributor

Commits on May 30, 2020

  1. Say 'template'.

    pleroy committed May 30, 2020
    Copy the full SHA
    47df3fc View commit details
  2. Indent.

    pleroy committed May 30, 2020
    Copy the full SHA
    32d88ef View commit details
  3. After egg's review.

    pleroy committed May 30, 2020
    Copy the full SHA
    79ec2a4 View commit details
  4. Merge pull request #2598 from pleroy/Template

    Say 'template' everywhere
    pleroy authored May 30, 2020
    Copy the full SHA
    e94a7f8 View commit details
2 changes: 1 addition & 1 deletion physics/barycentric_rotating_dynamic_frame_body.hpp
Original file line number Diff line number Diff line change
@@ -154,7 +154,7 @@ BarycentricRotatingDynamicFrame<InertialFrame, ThisFrame>::MotionOfThisFrame(
Vector<Acceleration, InertialFrame> const r̈ =
secondary_acceleration - primary_acceleration;
AngularVelocity<InertialFrame> const& ω =
to_this_frame.angular_velocity_of<ThisFrame>();
to_this_frame.template angular_velocity_of<ThisFrame>();
Variation<AngularVelocity<InertialFrame>> const
angular_acceleration_of_to_frame =
(Wedge(r, r̈) * Radian - 2 * ω * InnerProduct(r, ṙ)) / r.Norm²();
2 changes: 1 addition & 1 deletion physics/body_centred_body_direction_dynamic_frame_body.hpp
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ MotionOfThisFrame(Instant const& t) const {
Vector<Acceleration, InertialFrame> const r̈ =
secondary_acceleration - primary_acceleration;
AngularVelocity<InertialFrame> const& ω =
to_this_frame.angular_velocity_of<ThisFrame>();
to_this_frame.template angular_velocity_of<ThisFrame>();
Variation<AngularVelocity<InertialFrame>> const
angular_acceleration_of_to_frame =
(Wedge(r, r̈) * Radian - 2 * ω * InnerProduct(r, ṙ)) / r.Norm²();
6 changes: 3 additions & 3 deletions physics/dynamic_frame_body.hpp
Original file line number Diff line number Diff line change
@@ -55,10 +55,10 @@ DynamicFrame<InertialFrame, ThisFrame>::GeometricAcceleration(
// Beware, we want the angular velocity of ThisFrame as seen in the
// InertialFrame, but pushed to ThisFrame. Otherwise the sign is wrong.
AngularVelocity<ThisFrame> const Ω = to_this_frame.orthogonal_map()(
to_this_frame.angular_velocity_of<ThisFrame>());
to_this_frame.template angular_velocity_of<ThisFrame>());
Variation<AngularVelocity<ThisFrame>> const dΩ_over_dt =
to_this_frame.orthogonal_map()(
motion.angular_acceleration_of<ThisFrame>());
motion.template angular_acceleration_of<ThisFrame>());
Displacement<ThisFrame> const r =
degrees_of_freedom.position() - ThisFrame::origin;

@@ -69,7 +69,7 @@ DynamicFrame<InertialFrame, ThisFrame>::GeometricAcceleration(
degrees_of_freedom.position())));
Vector<Acceleration, ThisFrame> const linear_acceleration =
-to_this_frame.orthogonal_map()(
motion.acceleration_of_origin_of<ThisFrame>());
motion.template acceleration_of_origin_of<ThisFrame>());
Vector<Acceleration, ThisFrame> const coriolis_acceleration_at_point =
-2 * Ω * degrees_of_freedom.velocity() / Radian;
Vector<Acceleration, ThisFrame> const centrifugal_acceleration_at_point =
2 changes: 1 addition & 1 deletion physics/mechanical_system_body.hpp
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ void MechanicalSystem<InertialFrame, SystemFrame>::AddRigidBody(
sum_of_inertia_tensors_ += inertia_tensor_in_inertial_axes;
sum_of_intrinsic_angular_momenta_ +=
Anticommutator(inertia_tensor_in_inertial_axes,
motion.angular_velocity_of<BodyFrame>());
motion.template angular_velocity_of<BodyFrame>());
}

template<typename InertialFrame, typename SystemFrame>
19 changes: 11 additions & 8 deletions physics/rigid_motion_body.hpp
Original file line number Diff line number Diff line change
@@ -173,21 +173,24 @@ std::ostream& operator<<(std::ostream& out,
RigidMotion<FromFrame, ToFrame> const& rigid_motion) {
return out << "{transformation: " << rigid_motion.rigid_transformation()
<< ", angular velocity: "
<< rigid_motion.angular_velocity_of<ToFrame>()
<< ", velocity: " << rigid_motion.velocity_of_origin_of<ToFrame>()
<< rigid_motion.template angular_velocity_of<ToFrame>()
<< ", velocity: "
<< rigid_motion.template velocity_of_origin_of<ToFrame>()
<< "}";
}

template<typename FromFrame, typename ToFrame>
std::ostream& operator<<(std::ostream& out,
AcceleratedRigidMotion<FromFrame, ToFrame> const&
accelerated_rigid_motion) {
return out << "{motion: " << accelerated_rigid_motion.rigid_motion()
<< ", angular acceleration: "
<< accelerated_rigid_motion.angular_acceleration_of<ToFrame>()
<< ", acceleration: "
<< accelerated_rigid_motion.acceleration_of_origin_of<ToFrame>()
<< "}";
return out
<< "{motion: " << accelerated_rigid_motion.rigid_motion()
<< ", angular acceleration: "
<< accelerated_rigid_motion.template angular_acceleration_of<ToFrame>()
<< ", acceleration: "
<< accelerated_rigid_motion
.template acceleration_of_origin_of<ToFrame>()
<< "}";
}

template<typename FromFrame, typename ToFrame>
6 changes: 3 additions & 3 deletions quantities/parser_body.hpp
Original file line number Diff line number Diff line change
@@ -220,9 +220,9 @@ inline Unit ParseQuotientUnit(std::string const& s) {
// input like 1.23 / s.
int const first_nonblank = s.find_first_not_of(' ', last_slash + 1);
CHECK_NE(std::string::npos, first_nonblank);
int const last_nonblank = last_slash == 0
? std::string::npos
: s.find_last_not_of(' ', last_slash - 1);
std::size_t const last_nonblank =
last_slash == 0 ? std::string::npos
: s.find_last_not_of(' ', last_slash - 1);
auto const left = last_nonblank == std::string::npos
? Unit(1.0)
: ParseQuotientUnit(s.substr(0, last_nonblank + 1));