Skip to content

Commit

Permalink
Merge pull request #62 from tridelat/reg_standalone
Browse files Browse the repository at this point in the history
Regular waves + include destination folder
  • Loading branch information
tridelat authored Oct 25, 2024
2 parents f40f4d8 + 43997d9 commit 9866b4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ install(
)

install(
DIRECTORY include
DIRECTORY include/hydroc
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

Expand Down
19 changes: 10 additions & 9 deletions src/wave_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<HydroData::RegularWaveInfo>& 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);
Expand All @@ -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<HydroData::RegularWaveInfo>& 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) {
Expand Down

0 comments on commit 9866b4c

Please sign in to comment.