diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d6781c..aa70bed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,6 @@ message(STATUS "[GCTL_POTENTIAL] Use the exprtk library: " ${GCTL_POTENTIAL_EXPR find_package(GCTL REQUIRED) include_directories(${GCTL_INC_DIR}) -find_package(GCTL_GRAPHIC REQUIRED) -include_directories(${GCTL_GRAPHIC_INC_DIR}) - find_package(GCTL_MESH REQUIRED) include_directories(${GCTL_MESH_INC_DIR}) @@ -41,7 +38,7 @@ if(GCTL_POTENTIAL_FFTW3) if(NOT FFTW3_FOUND) find_package(FFTW3 REQUIRED) message(STATUS "Found FFTW3") - include_directories(${FFTW3_INC_DIR}) + include_directories(${FFTW3_INCLUDE_DIRS}) endif() endif() @@ -72,6 +69,7 @@ if(GCTL_POTENTIAL_AUTODIFF) find_package(autodiff REQUIRED) if(autodiff_FOUND) message(STATUS "autodiff Found.") + include_directories(${autodiff_INCLUDE_DIR}) endif() endif() endif() diff --git a/GCTL_POTENTIALConfig.cmake.in b/GCTL_POTENTIALConfig.cmake.in index 1823a27..c28ee00 100644 --- a/GCTL_POTENTIALConfig.cmake.in +++ b/GCTL_POTENTIALConfig.cmake.in @@ -40,7 +40,7 @@ endif() if(@PROJECT_NAME@_FFTW3) if(NOT FFTW3_FOUND) find_package(FFTW3 REQUIRED) - include_directories(${FFTW3_INC_DIR}) + include_directories(${FFTW3_INCLUDE_DIRS}) endif() endif() diff --git a/example/gobser_tri2d_ex.cpp b/example/gobser_tri2d_ex.cpp index bf5e72b..94e6f38 100644 --- a/example/gobser_tri2d_ex.cpp +++ b/example/gobser_tri2d_ex.cpp @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) geodsv_io tio; tio.init_table(obsp.size(), 8); - tio.set_column_names({"X", "Y", "Vx", "Vz", "Vxx", "Vxz", "Vzx", "Vzz"}); + tio.column_names({"X", "Y", "Vx", "Vz", "Vxx", "Vxz", "Vzx", "Vzz"}); tio.fill_column_point2dc(obsp, "X", "Y"); tio.fill_column(vx, "Vx", 12); tio.fill_column(vz, "Vz", 12); diff --git a/example/gobser_tri2d_sph_ex.cpp b/example/gobser_tri2d_sph_ex.cpp index 5c83f64..99abe80 100644 --- a/example/gobser_tri2d_sph_ex.cpp +++ b/example/gobser_tri2d_sph_ex.cpp @@ -25,12 +25,11 @@ * Also add information on how to contact you by electronic and paper mail. ******************************************************/ +#include "toml.hpp" +#include "../lib/potential.h" #include "gctl/core.h" #include "gctl/geometry.h" #include "gctl/io.h" -#include "../lib/potential.h" - -#include "toml.hpp" using namespace gctl; int main(int argc, char *argv[]) try @@ -94,7 +93,7 @@ int main(int argc, char *argv[]) try geodsv_io gio; gio.init_table(obsp.size(), 8); - gio.set_column_names({"rad", "deg", "gx", "gz", "gxx", "gxz", "gzx", "gzz"}); + gio.column_names({"rad", "deg", "gx", "gz", "gxx", "gxz", "gzx", "gzz"}); gio.fill_column(r, "rad"); gio.fill_column(d, "deg"); gio.fill_column(gx, "gx"); diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4c8e64d..4c851b0 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -41,20 +41,13 @@ target_link_libraries(gctl_potential_static ${GCTL_LIB}) target_link_libraries(gctl_potential PUBLIC ${GCTL_MESH_LIB}) target_link_libraries(gctl_potential_static ${GCTL_MESH_LIB}) -target_link_libraries(gctl_potential PUBLIC ${GCTL_GRAPHIC_LIB}) -target_link_libraries(gctl_potential_static ${GCTL_GRAPHIC_LIB}) - target_link_libraries(gctl_potential PUBLIC ${GCTL_OPTIMIZATION_LIB}) target_link_libraries(gctl_potential_static ${GCTL_OPTIMIZATION_LIB}) -#if(GCTL_GRAPHIC_MATHGL) -# target_link_libraries(gctl_potential PUBLIC ${MathGL2_LIBRARIES} ${MathGL2_FLTK_LIBRARIES}) -# target_link_libraries(gctl_potential_static ${MathGL2_LIBRARIES} ${MathGL2_FLTK_LIBRARIES}) -#endif() - if(GCTL_POTENTIAL_FFTW3) - target_link_libraries(gctl_potential PUBLIC ${FFTW3_LIBRARIES}) - target_link_libraries(gctl_potential_static ${FFTW3_LIBRARIES}) + find_library(FFTW_LIB ${FFTW3_LIBRARIES} HINTS ${FFTW3_LIBRARY_DIRS}) + target_link_libraries(gctl_potential PUBLIC ${FFTW_LIB}) + target_link_libraries(gctl_potential_static ${FFTW_LIB}) endif() if(GCTL_POTENTIAL_TESS) diff --git a/lib/potential/gkernel_block.h b/lib/potential/gkernel_block.h index 5402123..fa25a48 100644 --- a/lib/potential/gkernel_block.h +++ b/lib/potential/gkernel_block.h @@ -56,6 +56,6 @@ namespace gctl */ void gobser(array &out_obs, const array &ele, const array &obsp, const array &rho, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_GRAV_KERNEL_BLOCK_H \ No newline at end of file diff --git a/lib/potential/gkernel_polygon.h b/lib/potential/gkernel_polygon.h index 70f18b9..c58e32c 100644 --- a/lib/potential/gkernel_polygon.h +++ b/lib/potential/gkernel_polygon.h @@ -43,6 +43,6 @@ namespace gctl */ void gobser(array &out_obs, const array &cor_vert, const array &obsp, const double &rho, gravitational_field_type_e comp_id = Vz); -} +}; #endif // _GCTL_GRAV_KERNEL_POLYGON_H \ No newline at end of file diff --git a/lib/potential/gkernel_rectangle2d.h b/lib/potential/gkernel_rectangle2d.h index 89a7dc6..cb85157 100644 --- a/lib/potential/gkernel_rectangle2d.h +++ b/lib/potential/gkernel_rectangle2d.h @@ -56,6 +56,6 @@ namespace gctl */ void gobser(array &out_obs, const array &ele, const array &obsp, const array &rho, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_GRAV_KERNEL_RECTANGLE2D_H \ No newline at end of file diff --git a/lib/potential/gkernel_sphere.h b/lib/potential/gkernel_sphere.h index 6f50be6..256a99b 100644 --- a/lib/potential/gkernel_sphere.h +++ b/lib/potential/gkernel_sphere.h @@ -28,12 +28,8 @@ #ifndef _GCTL_GRAV_KERNEL_SPHERE_H #define _GCTL_GRAV_KERNEL_SPHERE_H -#include "gctl/core/array.h" -#include "gctl/geometry/point3c.h" -#include "gctl/geometry/sphere.h" -#include "gctl/optimization/loss_func.h" - #include "gm_data.h" +#include "gctl/optimization/loss_func.h" #ifdef GCTL_POTENTIAL_AUTODIFF #include "autodiff/reverse/var.hpp" @@ -84,6 +80,6 @@ namespace gctl #endif // GCTL_POTENTIAL_AUTODIFF -} +}; #endif // _GCTL_GRAV_KERNEL_SPHERE_H \ No newline at end of file diff --git a/lib/potential/gkernel_tesseroid.h b/lib/potential/gkernel_tesseroid.h index a0ecf89..459f151 100644 --- a/lib/potential/gkernel_tesseroid.h +++ b/lib/potential/gkernel_tesseroid.h @@ -61,7 +61,7 @@ namespace gctl */ void gobser(array &out_obs, const array &ele, const array &obsp, const array &rho, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg); -} +}; #endif // GCTL_POTENTIAL_TESS diff --git a/lib/potential/gkernel_tetrahedron.h b/lib/potential/gkernel_tetrahedron.h index 46cccf5..65ad1de 100644 --- a/lib/potential/gkernel_tetrahedron.h +++ b/lib/potential/gkernel_tetrahedron.h @@ -152,6 +152,6 @@ namespace gctl */ void gobser(array &out_obs, const array &ele, const array &obsp, const array &rho, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_GRAV_KERNEL_TETRAHEDRON_H \ No newline at end of file diff --git a/lib/potential/gkernel_triangle.h b/lib/potential/gkernel_triangle.h index d7475f8..51e12ee 100644 --- a/lib/potential/gkernel_triangle.h +++ b/lib/potential/gkernel_triangle.h @@ -123,6 +123,6 @@ namespace gctl */ void gobser(array &out_obs, const array &ele, const array &obsp, double rho, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_GRAV_KERNEL_TRIANGLE_H \ No newline at end of file diff --git a/lib/potential/gkernel_triangle2d.h b/lib/potential/gkernel_triangle2d.h index 08079c9..d599a83 100644 --- a/lib/potential/gkernel_triangle2d.h +++ b/lib/potential/gkernel_triangle2d.h @@ -81,6 +81,6 @@ namespace gctl */ void gobser(array &out_obs, const array &ele, const array &obsp, const array &rho, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_GRAV_KERNEL_TRIANGLE2D_H \ No newline at end of file diff --git a/lib/potential/gkernel_tricone.h b/lib/potential/gkernel_tricone.h index 32b31b2..f6d49bc 100644 --- a/lib/potential/gkernel_tricone.h +++ b/lib/potential/gkernel_tricone.h @@ -148,6 +148,6 @@ namespace gctl const array &obs_diff, const array &obsp, const array &rho, const array *verts_ptr = nullptr, double ang_limit = -1.0, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_GRAV_KERNEL_TRICONE_H \ No newline at end of file diff --git a/lib/potential/gm_data.h b/lib/potential/gm_data.h index ad6ea1f..20d620f 100644 --- a/lib/potential/gm_data.h +++ b/lib/potential/gm_data.h @@ -28,17 +28,17 @@ #ifndef _GCTL_GM_DATA_H #define _GCTL_GM_DATA_H +#include "gctl_potential_config.h" +#ifdef GCTL_POTENTIAL_OPENMP +#include "omp.h" +#include +#endif + #include "gctl/core.h" #include "gctl/utility.h" #include "gctl/geometry.h" #include "gctl/maths.h" -#include "gctl/algorithm.h" -#include "gctl_potential_config.h" - -#ifdef GCTL_POTENTIAL_OPENMP -#include "omp.h" -#include "thread" -#endif +#include "gctl/algorithms.h" namespace gctl { diff --git a/lib/potential/gm_regular_grid.h b/lib/potential/gm_regular_grid.h index 7692662..4287db6 100644 --- a/lib/potential/gm_regular_grid.h +++ b/lib/potential/gm_regular_grid.h @@ -120,6 +120,6 @@ namespace gctl */ void trend(std::string datname, std::string regname, std::string resname, int wx_size, int wy_size, int x_order, int y_order); }; -} +}; #endif //_GM_REGULAR_GRID_H \ No newline at end of file diff --git a/lib/potential/gm_regular_mesh_2d.h b/lib/potential/gm_regular_mesh_2d.h index c8d8d28..59241b6 100644 --- a/lib/potential/gm_regular_mesh_2d.h +++ b/lib/potential/gm_regular_mesh_2d.h @@ -46,6 +46,6 @@ namespace gctl void gobser(array &out_data, std::string data_name, const array &obs, gravitational_field_type_e comp_id = Vz, verbose_type_e verbose = FullMsg); }; -} +}; #endif //_GRAV_REGULAR_MESH_2D_H \ No newline at end of file diff --git a/lib/potential/gm_regular_mesh_3d.h b/lib/potential/gm_regular_mesh_3d.h index 499d0b4..063f58c 100644 --- a/lib/potential/gm_regular_mesh_3d.h +++ b/lib/potential/gm_regular_mesh_3d.h @@ -64,6 +64,6 @@ namespace gctl const array &inc_deg, const array &dec_deg, magnetic_field_type_e comp_id = Za, verbose_type_e verbose = FullMsg); }; -} +}; #endif //_GM_REGULAR_MESH_3D_H \ No newline at end of file diff --git a/lib/potential/gm_regular_mesh_sph_3d.h b/lib/potential/gm_regular_mesh_sph_3d.h index c94a366..566c312 100644 --- a/lib/potential/gm_regular_mesh_sph_3d.h +++ b/lib/potential/gm_regular_mesh_sph_3d.h @@ -63,6 +63,6 @@ namespace gctl magnetic_field_type_e comp_id = Za, verbose_type_e verbose = FullMsg); #endif // GCTL_POTENTIAL_MAGTESS }; -} +}; #endif //_GM_REGULAR_MESH_SPH_3D_H \ No newline at end of file diff --git a/lib/potential/gm_tet_mesh.h b/lib/potential/gm_tet_mesh.h index f25ab3e..2ca26a4 100644 --- a/lib/potential/gm_tet_mesh.h +++ b/lib/potential/gm_tet_mesh.h @@ -87,6 +87,6 @@ namespace gctl void magobser(array &out_obs, std::string magz_name, const array &obsp, verbose_type_e verbose = FullMsg); }; -} +}; #endif // _GM_TET_MESH_H \ No newline at end of file diff --git a/lib/potential/mkernel_block.h b/lib/potential/mkernel_block.h index a7afb35..089e4fe 100644 --- a/lib/potential/mkernel_block.h +++ b/lib/potential/mkernel_block.h @@ -77,5 +77,7 @@ namespace gctl magnetic_field_type_e comp_id = Za, verbose_type_e verbose = FullMsg); #endif // GCTL_POTENTIAL_AUTODIFF -} + +}; + #endif // _GCTL_MAG_KERNEL_BLOCK_H \ No newline at end of file diff --git a/lib/potential/mkernel_dipole.h b/lib/potential/mkernel_dipole.h index 82469dd..a73e7b4 100644 --- a/lib/potential/mkernel_dipole.h +++ b/lib/potential/mkernel_dipole.h @@ -97,6 +97,6 @@ namespace gctl */ void magobser(array &out_obs, const array &dipoles, const array &obsp, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_MAG_KERNEL_DIPOLE_H \ No newline at end of file diff --git a/lib/potential/mkernel_tesseroid.h b/lib/potential/mkernel_tesseroid.h index f99884e..4112ef5 100644 --- a/lib/potential/mkernel_tesseroid.h +++ b/lib/potential/mkernel_tesseroid.h @@ -125,7 +125,7 @@ namespace gctl void magobser(array &out_obs, const array &ele, const array &obsp, const array &sus, magnetic_field_type_e comp_id = Za, int gauss_order = 4, verbose_type_e verbose = FullMsg); -} +}; #endif // GCTL_POTENTIAL_MAGTESS diff --git a/lib/potential/mkernel_tetrahedron.h b/lib/potential/mkernel_tetrahedron.h index 77f6abf..90c7e2b 100644 --- a/lib/potential/mkernel_tetrahedron.h +++ b/lib/potential/mkernel_tetrahedron.h @@ -129,6 +129,6 @@ namespace gctl */ void magobser(array &out_obs, const array &ele, const array &obsp, const array &sus, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_MAG_KERNEL_TETRAHEDRON_H \ No newline at end of file diff --git a/lib/potential/mkernel_tetrahedron_Ren2017.h b/lib/potential/mkernel_tetrahedron_Ren2017.h index 506c2dc..e08307a 100644 --- a/lib/potential/mkernel_tetrahedron_Ren2017.h +++ b/lib/potential/mkernel_tetrahedron_Ren2017.h @@ -295,5 +295,6 @@ namespace gctl */ void magobser(array &out_obs, const array &ele, const array &obsp, const array &sus, verbose_type_e verbose = FullMsg); -} +}; + #endif // _GCTL_MAG_KERNEL_TETRAHEDRON_REN2017_H \ No newline at end of file diff --git a/lib/potential/mkernel_triangle.h b/lib/potential/mkernel_triangle.h index b937935..b855e5f 100644 --- a/lib/potential/mkernel_triangle.h +++ b/lib/potential/mkernel_triangle.h @@ -129,6 +129,6 @@ namespace gctl */ void magobser(array &out_obs, const array &ele, const array &obsp, const array &sus, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_MAG_KERNEL_TRIANGLE_H \ No newline at end of file diff --git a/lib/potential/mkernel_tricone.h b/lib/potential/mkernel_tricone.h index 60f04ea..1d99651 100644 --- a/lib/potential/mkernel_tricone.h +++ b/lib/potential/mkernel_tricone.h @@ -77,6 +77,6 @@ namespace gctl void magobser(array &out_obs, const array &top_ele, const array &btm_ele, const array &obsp, const array &sus, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_MAG_KERNEL_TRICONE_H \ No newline at end of file diff --git a/lib/potential/mkernel_tricone_Ren2017.h b/lib/potential/mkernel_tricone_Ren2017.h index 7632fde..e5595d7 100644 --- a/lib/potential/mkernel_tricone_Ren2017.h +++ b/lib/potential/mkernel_tricone_Ren2017.h @@ -137,6 +137,6 @@ namespace gctl */ void magobser(array &out_obs, const array &top_ele, const array &btm_ele, const array &obsp, const array &sus, verbose_type_e verbose = FullMsg); -} +}; #endif // _GCTL_MAG_KERNEL_TRICONE_REN2017_H \ No newline at end of file diff --git a/tool/gridmanager-potential/gridmanager-potential.cpp b/tool/gridmanager-potential/gridmanager-potential.cpp index 5dea932..2d9b9fe 100644 --- a/tool/gridmanager-potential/gridmanager-potential.cpp +++ b/tool/gridmanager-potential/gridmanager-potential.cpp @@ -372,7 +372,7 @@ void save_gmsh(const std::vector &cmd_units) // save gmsh if (cmd_units.size() < 3) throw std::runtime_error("save: insufficient parameters."); - rg.save_gmsh(cmd_units[2], OverWrite, NotPacked); + rg.save_gmsh(cmd_units[2], NotPacked); return; }