diff --git a/CMakeLists.txt b/CMakeLists.txt index fd29de42..3fa55906 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Project declaration project( OpenTurbine - VERSION 0.0.0 + VERSION 0.1.0 DESCRIPTION "A flexible multibody structural dynamics code for wind turbines" LANGUAGES CXX ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ecb0c1d8..8c55804e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,9 @@ if(TARGET MPI::MPI_CXX) target_link_system_libraries(openturbine_library PUBLIC MPI::MPI_CXX ) + target_link_system_libraries(openturbine_library INTERFACE + MPI::MPI_CXX + ) endif() # Include shared libraries for the OpenTurbine library @@ -56,14 +59,16 @@ target_include_directories(openturbine_library $ # Include source directory during build ) -target_include_directories(openturbine_library INTERFACE $) +target_include_directories(openturbine_library INTERFACE $) # Set the C++ standard for the target target_compile_features(openturbine_library PUBLIC cxx_std_17) # Add subdirectories for additional components of the library add_subdirectory(constraints) +add_subdirectory(dof_management) add_subdirectory(elements) +add_subdirectory(interfaces) add_subdirectory(math) add_subdirectory(model) add_subdirectory(solver) @@ -73,20 +78,22 @@ add_subdirectory(system) add_subdirectory(utilities) add_subdirectory(vendor) -add_subdirectory(interfaces/cfd) - -set(openturbine_public_headers "interfaces/cfd/interface.hpp") -set_target_properties(openturbine_library PROPERTIES PUBLIC_HEADER "${openturbine_public_headers}") - install( TARGETS openturbine_library openturbine_options openturbine_warnings EXPORT OpenTurbineTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${PACKAGE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) install(EXPORT OpenTurbineTargets FILE OpenTurbineTargets.cmake NAMESPACE OpenTurbine:: - DESTINATION lib/cmake/OpenTurbine) + DESTINATION lib/cmake/OpenTurbine +) + +install(FILES + types.hpp + DESTINATION include/OpenTurbine/ +) diff --git a/src/constraints/CMakeLists.txt b/src/constraints/CMakeLists.txt index 5be7ffbd..27e84f67 100644 --- a/src/constraints/CMakeLists.txt +++ b/src/constraints/CMakeLists.txt @@ -1,2 +1,19 @@ target_sources(openturbine_library PRIVATE) -set(openturbine_public_headers "${openturbine_public_headers}" "constraints/calculate_constraint_force.hpp") + +install(FILES + calculate_constraint_force.hpp + calculate_constraint_output.hpp + calculate_constraint_residual_gradient.hpp + calculate_fixed_bc_constraint.hpp + calculate_prescribed_bc_constraint.hpp + calculate_revolute_joint_constraint.hpp + calculate_revolute_joint_force.hpp + calculate_revolute_joint_output.hpp + calculate_rigid_joint_constraint.hpp + calculate_rotation_control_constraint.hpp + constraint.hpp + constraints.hpp + constraint_type.hpp + update_lambda_prediction.hpp + DESTINATION include/OpenTurbine/constraints +) diff --git a/src/dof_management/CMakeLists.txt b/src/dof_management/CMakeLists.txt new file mode 100644 index 00000000..31ec76a5 --- /dev/null +++ b/src/dof_management/CMakeLists.txt @@ -0,0 +1,12 @@ +target_sources(openturbine_library + PRIVATE +) + +install(FILES + assemble_node_freedom_allocation_table.hpp + compute_node_freedom_map_table.hpp + create_constraint_freedom_table.hpp + create_element_freedom_table.hpp + freedom_signature.hpp + DESTINATION include/OpenTurbine/dof_management +) diff --git a/src/elements/CMakeLists.txt b/src/elements/CMakeLists.txt index 56f6d478..2bfc8f32 100644 --- a/src/elements/CMakeLists.txt +++ b/src/elements/CMakeLists.txt @@ -1,4 +1,10 @@ target_sources(openturbine_library PRIVATE) +install(FILES + elements.hpp + DESTINATION include/OpenTurbine/elements +) + add_subdirectory(beams) add_subdirectory(masses) +add_subdirectory(springs) diff --git a/src/elements/beams/CMakeLists.txt b/src/elements/beams/CMakeLists.txt index 7a0cd862..321835c1 100644 --- a/src/elements/beams/CMakeLists.txt +++ b/src/elements/beams/CMakeLists.txt @@ -1 +1,22 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + beam_element.hpp + beam_section.hpp + beams.hpp + beams_input.hpp + calculate_jacobian.hpp + calculate_QP_deformation.hpp + calculate_QP_position.hpp + create_beams.hpp + interpolate_QP_position.hpp + interpolate_QP_rotation_derivative.hpp + interpolate_QP_rotation.hpp + interpolate_QP_state.hpp + interpolate_QP_vector.hpp + interpolate_to_quadrature_points.hpp + interpolation.hpp + interpolation_operations.hpp + populate_element_views.hpp + DESTINATION include/OpenTurbine/elements/beams/ +) diff --git a/src/elements/masses/CMakeLists.txt b/src/elements/masses/CMakeLists.txt index 7a0cd862..ba449156 100644 --- a/src/elements/masses/CMakeLists.txt +++ b/src/elements/masses/CMakeLists.txt @@ -1 +1,9 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + create_masses.hpp + mass_element.hpp + masses.hpp + masses_input.hpp + DESTINATION include/OpenTurbine/elements/masses/ +) diff --git a/src/elements/springs/CMakeLists.txt b/src/elements/springs/CMakeLists.txt new file mode 100644 index 00000000..075f8806 --- /dev/null +++ b/src/elements/springs/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(openturbine_library PRIVATE) + +install(FILES + create_springs.hpp + spring_element.hpp + springs.hpp + springs_input.hpp + DESTINATION include/OpenTurbine/elements/springs/ +) diff --git a/src/interfaces/CMakeLists.txt b/src/interfaces/CMakeLists.txt new file mode 100644 index 00000000..966ce580 --- /dev/null +++ b/src/interfaces/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(cfd) diff --git a/src/interfaces/cfd/CMakeLists.txt b/src/interfaces/cfd/CMakeLists.txt index 123f3173..20314cc4 100644 --- a/src/interfaces/cfd/CMakeLists.txt +++ b/src/interfaces/cfd/CMakeLists.txt @@ -2,3 +2,16 @@ target_sources(openturbine_library PRIVATE interface.cpp ) + +install(FILES + floating_platform.hpp + floating_platform_input.hpp + interface.hpp + interface_input.hpp + mooring_line.hpp + mooring_line_input.hpp + node_data.hpp + turbine.hpp + turbine_input.hpp + DESTINATION include/OpenTurbine/interfaces/cfd/ +) diff --git a/src/interfaces/cfd/floating_platform.hpp b/src/interfaces/cfd/floating_platform.hpp index 61c751a5..c9e4eb35 100644 --- a/src/interfaces/cfd/floating_platform.hpp +++ b/src/interfaces/cfd/floating_platform.hpp @@ -1,6 +1,7 @@ #pragma once -#include "vector" +#include +#include #include "interfaces/cfd/mooring_line.hpp" #include "interfaces/cfd/node_data.hpp" diff --git a/src/interfaces/cfd/interface_input.hpp b/src/interfaces/cfd/interface_input.hpp index 0106b85f..83f58835 100644 --- a/src/interfaces/cfd/interface_input.hpp +++ b/src/interfaces/cfd/interface_input.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include "interfaces/cfd/turbine_input.hpp" diff --git a/src/interfaces/cfd/mooring_line.hpp b/src/interfaces/cfd/mooring_line.hpp index 6515fa48..7e6769a1 100644 --- a/src/interfaces/cfd/mooring_line.hpp +++ b/src/interfaces/cfd/mooring_line.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include "node_data.hpp" namespace openturbine::cfd { diff --git a/src/interfaces/cfd/node_data.hpp b/src/interfaces/cfd/node_data.hpp index 0d484f81..e945551e 100644 --- a/src/interfaces/cfd/node_data.hpp +++ b/src/interfaces/cfd/node_data.hpp @@ -1,6 +1,7 @@ #pragma once -#include "array" +#include +#include namespace openturbine::cfd { diff --git a/src/math/CMakeLists.txt b/src/math/CMakeLists.txt index 7a0cd862..d26b48be 100644 --- a/src/math/CMakeLists.txt +++ b/src/math/CMakeLists.txt @@ -1 +1,9 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + least_squares_fit.hpp + matrix_operations.hpp + quaternion_operations.hpp + vector_operations.hpp + DESTINATION include/OpenTurbine/math +) diff --git a/src/model/CMakeLists.txt b/src/model/CMakeLists.txt index 7a0cd862..53375538 100644 --- a/src/model/CMakeLists.txt +++ b/src/model/CMakeLists.txt @@ -1 +1,8 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + copy_nodes_to_state.hpp + model.hpp + node.hpp + DESTINATION include/OpenTurbine/model/ +) diff --git a/src/solver/CMakeLists.txt b/src/solver/CMakeLists.txt index 7a0cd862..d88b2b35 100644 --- a/src/solver/CMakeLists.txt +++ b/src/solver/CMakeLists.txt @@ -1 +1,47 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + calculate_error_sum_squares.hpp + compute_b_num_non_zero.hpp + compute_k_col_inds.hpp + compute_k_num_non_zero.hpp + compute_k_row_ptrs.hpp + compute_number_of_non_zeros_constraints.hpp + compute_num_system_dofs.hpp + compute_t_col_inds.hpp + compute_t_num_non_zero.hpp + compute_t_row_ptrs.hpp + condition_system.hpp + contribute_beams_to_sparse_matrix.hpp + contribute_beams_to_vector.hpp + contribute_constraints_system_residual_to_vector.hpp + contribute_elements_to_sparse_matrix.hpp + contribute_elements_to_vector.hpp + contribute_forces_to_vector.hpp + contribute_masses_to_sparse_matrix.hpp + contribute_masses_to_vector.hpp + contribute_springs_to_sparse_matrix.hpp + contribute_springs_to_vector.hpp + copy_constraints_residual_to_vector.hpp + copy_constraints_to_sparse_matrix.hpp + copy_into_sparse_matrix.hpp + copy_into_sparse_matrix_transpose.hpp + copy_sparse_values_to_transpose.hpp + copy_tangent_to_sparse_matrix.hpp + create_b_matrix.hpp + create_b_t_matrix.hpp + create_constraints_matrix_full.hpp + create_global_matrix.hpp + create_k_matrix.hpp + create_matrix_spadd.hpp + create_matrix_spgemm.hpp + create_sparse_dense_solver.hpp + create_system_matrix_full.hpp + create_t_matrix.hpp + create_transpose_matrix_full.hpp + fill_unshifted_row_ptrs.hpp + populate_sparse_row_ptrs_col_inds_constraints.hpp + populate_sparse_row_ptrs_col_inds_transpose.hpp + solver.hpp + DESTINATION include/OpenTurbine/solver/ +) diff --git a/src/state/CMakeLists.txt b/src/state/CMakeLists.txt index 7a0cd862..ff46f7eb 100644 --- a/src/state/CMakeLists.txt +++ b/src/state/CMakeLists.txt @@ -1 +1,15 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + calculate_displacement.hpp + calculate_next_state.hpp + clone_state.hpp + copy_state_data.hpp + set_node_external_loads.hpp + state.hpp + update_algorithmic_acceleration.hpp + update_dynamic_prediction.hpp + update_global_position.hpp + update_static_prediction.hpp + DESTINATION include/OpenTurbine/state/ +) diff --git a/src/step/CMakeLists.txt b/src/step/CMakeLists.txt index 7a0cd862..c43b20d8 100644 --- a/src/step/CMakeLists.txt +++ b/src/step/CMakeLists.txt @@ -1 +1,34 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + assemble_constraints_matrix.hpp + assemble_constraints_residual.hpp + assemble_inertia_matrix_beams.hpp + assemble_inertia_matrix_masses.hpp + assemble_residual_vector_beams.hpp + assemble_residual_vector_masses.hpp + assemble_residual_vector_springs.hpp + assemble_stiffness_matrix_beams.hpp + assemble_stiffness_matrix_masses.hpp + assemble_stiffness_matrix_springs.hpp + assemble_system_matrix.hpp + assemble_system_residual_beams.hpp + assemble_system_residual.hpp + assemble_system_residual_masses.hpp + assemble_tangent_operator.hpp + calculate_convergence_error.hpp + predict_next_state.hpp + reset_constraints.hpp + solve_system.hpp + step.hpp + step_parameters.hpp + update_constraint_prediction.hpp + update_constraint_variables.hpp + update_state_prediction.hpp + update_system_variables_beams.hpp + update_system_variables.hpp + update_system_variables_masses.hpp + update_system_variables_springs.hpp + update_tangent_operator.hpp + DESTINATION include/OpenTurbine/step/ +) diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt index 00033f72..311587bf 100644 --- a/src/system/CMakeLists.txt +++ b/src/system/CMakeLists.txt @@ -1,5 +1,10 @@ target_sources(openturbine_library PRIVATE) -add_subdirectory(springs) -add_subdirectory(masses) +install(FILES + calculate_tangent_operator.hpp + DESTINATION include/OpenTurbine/system/ +) + add_subdirectory(beams) +add_subdirectory(masses) +add_subdirectory(springs) diff --git a/src/system/beams/CMakeLists.txt b/src/system/beams/CMakeLists.txt index 7a0cd862..8a44df8d 100644 --- a/src/system/beams/CMakeLists.txt +++ b/src/system/beams/CMakeLists.txt @@ -1 +1,24 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + calculate_force_FC.hpp + calculate_force_FD.hpp + calculate_gravity_force.hpp + calculate_gyroscopic_matrix.hpp + calculate_inertial_force.hpp + calculate_inertia_stiffness_matrix.hpp + calculate_mass_matrix_components.hpp + calculate_Ouu.hpp + calculate_Puu.hpp + calculate_quadrature_point_values.hpp + calculate_Quu.hpp + calculate_RR0.hpp + calculate_strain.hpp + calculate_temporary_variables.hpp + integrate_inertia_matrix.hpp + integrate_residual_vector.hpp + integrate_stiffness_matrix.hpp + rotate_section_matrix.hpp + update_node_state.hpp + DESTINATION include/OpenTurbine/system/beams/ +) diff --git a/src/system/masses/CMakeLists.txt b/src/system/masses/CMakeLists.txt index 7a0cd862..ea275d10 100644 --- a/src/system/masses/CMakeLists.txt +++ b/src/system/masses/CMakeLists.txt @@ -1 +1,14 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + calculate_gravity_force.hpp + calculate_gyroscopic_matrix.hpp + calculate_inertial_force.hpp + calculate_inertia_stiffness_matrix.hpp + calculate_mass_matrix_components.hpp + calculate_QP_position.hpp + calculate_RR0.hpp + rotate_section_matrix.hpp + update_node_state.hpp + DESTINATION include/OpenTurbine/system/masses +) diff --git a/src/system/springs/CMakeLists.txt b/src/system/springs/CMakeLists.txt index 7a0cd862..b2aad81a 100644 --- a/src/system/springs/CMakeLists.txt +++ b/src/system/springs/CMakeLists.txt @@ -1 +1,11 @@ target_sources(openturbine_library PRIVATE) + +install(FILES + calculate_distance_components.hpp + calculate_force_coefficients.hpp + calculate_force_vectors.hpp + calculate_length.hpp + calculate_stiffness_matrix.hpp + update_node_state.hpp + DESTINATION include/OpenTurbine/system/springs/ +) diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 62c237e3..6b8df8a8 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -1 +1,2 @@ -add_subdirectory(controllers) \ No newline at end of file +add_subdirectory(aerodynamics) +add_subdirectory(controllers) diff --git a/src/utilities/aerodynamics/CMakeLists.txt b/src/utilities/aerodynamics/CMakeLists.txt new file mode 100644 index 00000000..16e5fd7b --- /dev/null +++ b/src/utilities/aerodynamics/CMakeLists.txt @@ -0,0 +1,6 @@ +target_sources(openturbine_library PRIVATE) + +install(FILES + aerodyn_inflow.hpp + DESTINATION include/OpenTurbine/utilities/aerodynamics/ +) diff --git a/src/utilities/controllers/CMakeLists.txt b/src/utilities/controllers/CMakeLists.txt index 078a6e08..9650a717 100644 --- a/src/utilities/controllers/CMakeLists.txt +++ b/src/utilities/controllers/CMakeLists.txt @@ -11,4 +11,12 @@ target_sources(DISCON target_sources(DISCON_ROTOR_TEST_CONTROLLER PRIVATE discon_rotor_test_controller.cpp -) \ No newline at end of file +) + +install(FILES + controller_io.hpp + discon.hpp + discon_rotor_test_controller.hpp + turbine_controller.hpp + DESTINATION include/OpenTurbine/utilities/controllers/ +) diff --git a/src/vendor/CMakeLists.txt b/src/vendor/CMakeLists.txt index 7a0cd862..e1830491 100644 --- a/src/vendor/CMakeLists.txt +++ b/src/vendor/CMakeLists.txt @@ -1 +1,3 @@ target_sources(openturbine_library PRIVATE) + +add_subdirectory(dylib) diff --git a/src/vendor/dylib/CMakeLists.txt b/src/vendor/dylib/CMakeLists.txt new file mode 100644 index 00000000..07d8bc11 --- /dev/null +++ b/src/vendor/dylib/CMakeLists.txt @@ -0,0 +1,7 @@ +target_sources(openturbine_library PRIVATE) + +install(FILES + dylib.hpp + LICENSE.txt + DESTINATION include/OpenTurbine/vendor/dylib/ +)