diff --git a/CMakeLists.txt b/CMakeLists.txt index 448bd4f..7efa3ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,7 +257,7 @@ install( ) install( - DIRECTORY include + DIRECTORY include/hydroc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/src/wave_types.cpp b/src/wave_types.cpp index bf42b8f..97edfa3 100644 --- a/src/wave_types.cpp +++ b/src/wave_types.cpp @@ -82,6 +82,7 @@ Eigen::Vector3d GetWaterVelocity(const Eigen::Vector3d& position, water_velocity[2] = omega * amplitude * std::sinh(wavenumber * (z_pos + water_depth)) / std::sinh(wavenumber * water_depth) * sin(wavenumber * x_pos - omega * time + phase); } + return water_velocity; } @@ -200,6 +201,15 @@ RegularWave::RegularWave(unsigned int num_b) { } void RegularWave::Initialize() { + wavenumber_ = ComputeWaveNumber(regular_wave_omega_, water_depth_, g_); +} + +void RegularWave::AddH5Data(std::vector& reg_h5_data, + HydroData::SimulationParameters& sim_data) { + wave_info_ = reg_h5_data; + water_depth_ = sim_data.water_depth; + g_ = sim_data.g; + // set up regular waves here, call other helper functions as necessary int total_dofs = 6 * num_bodies_; excitation_force_mag_.resize(total_dofs); @@ -216,15 +226,6 @@ void RegularWave::Initialize() { excitation_force_phase_[body_offset + rowEx] = GetExcitationPhaseInterp(b, rowEx, 0, freq_index_des); } } - - wavenumber_ = ComputeWaveNumber(regular_wave_omega_, water_depth_, g_); -} - -void RegularWave::AddH5Data(std::vector& reg_h5_data, - HydroData::SimulationParameters& sim_data) { - wave_info_ = reg_h5_data; - water_depth_ = sim_data.water_depth; - g_ = sim_data.g; } Eigen::Vector3d RegularWave::GetVelocity(const Eigen::Vector3d& position, double time) {