Skip to content

Commit

Permalink
Simplify the codes
Browse files Browse the repository at this point in the history
  • Loading branch information
200km committed Jul 15, 2023
1 parent 5f5fe99 commit 7f7b3a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/dynamics/orbit/initialize_orbit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,7 @@ libra::Vector<6> InitializePosVel(std::string initialize_file, double current_ti
kepler_orbit.CalcOrbit(current_time_jd);
position_i_m = kepler_orbit.GetPosition_i_m();
velocity_i_m_s = kepler_orbit.GetVelocity_i_m_s();
} else if (initialize_mode == OrbitInitializeMode::kInertialPositionAndVelocity) {
conf.ReadVector<3>(section_, "initial_position_i_m", position_i_m);
conf.ReadVector<3>(section_, "initial_velocity_i_m_s", velocity_i_m_s);
} else {
if (initialize_mode != OrbitInitializeMode::kDefault) {
std::cerr << "WARNINGS: orbit initialize mode is not defined!" << std::endl;
std::cerr << "The orbit is automatically initialized as default mode" << std::endl;
}
conf.ReadVector<3>(section_, "initial_position_i_m", position_i_m);
conf.ReadVector<3>(section_, "initial_velocity_i_m_s", velocity_i_m_s);
}
Expand Down
2 changes: 2 additions & 0 deletions src/dynamics/orbit/orbit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ OrbitInitializeMode SetOrbitInitializeMode(const std::string initialize_mode) {
} else if (initialize_mode == "ORBITAL_ELEMENTS") {
return OrbitInitializeMode::kOrbitalElements;
} else {
std::cerr << "WARNINGS: orbit initialize mode is not defined!" << std::endl;
std::cerr << "The orbit is automatically initialized as default mode" << std::endl;
return OrbitInitializeMode::kDefault;
}
}
Expand Down

0 comments on commit 7f7b3a6

Please sign in to comment.