skulumani / polyhedron_gravity

Polyhedron gravitational potential model
3 stars 0 forks source link

Build Status

Polyhedron Potential Model in C++

This project defines the gravitational potential of a polyhedron asteroid. It implements the method derived by Werner and Scheeres.

Dependencies

  1. CMake > 3.12
  2. Eigen > 3.3.5
  3. CGAL > 4.12-1
  4. Boost > 1.68

Installation

  1. Install dependencies on MacOS

    brew install cgal cmake libomp

    or for linux

    bash ./utilities/build_cmake.sh
    bash ./utilities/build_boost.sh
    bash ./utilities/build_cgal.sh
    bash ./utilities/build_eigen.sh
  2. Update the submodules

    git submodule update --init --recursive 
  3. LibIGL setup (sometimes)

    CMake doesn't search for matlab in libigl

    Might need to edit

    extern/libigl/shared/cmake/libigl.cmake

References

TODO

/ The attracting shape is a cube of dimensions 1 x 1 x 1 m of density rho = 1e6 kg/m^3
    // The analytic potential and acceleration at (1,2,3) (m) in the shape model's barycentric frame is computed
    // Assumes that G = 6.67408e-11 m^3 / (kg * s ^2)

        // Queried point for pgm validation
        arma::vec p4 = {1, 2, 3};

        arma::vec acc_true = {
            -1.273782722739791e-06,
            -2.548008881415967e-06,
            -3.823026510474731e-06
        };
        double pot_true = 0.26726619638669064 * arma::datum::G * density;