Skip to content

Commit

Permalink
Square away virtual method implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilMiller committed Aug 23, 2024
1 parent 9b5716e commit fa6c223
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/realizations/coastal/SchismFormulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <memory>
#include <set>

class SchismFormulation : public CoastalFormulation
class SchismFormulation final : public CoastalFormulation
{
public:
using MeshPointsDataProvider = data_access::DataProvider<double, MeshPointsSelector>;
Expand All @@ -33,7 +33,6 @@ class SchismFormulation : public CoastalFormulation
size_t get_ts_index_for_time(const time_t &epoch_time) const override;

data_type get_value(const selection_type& selector, data_access::ReSampleMethod m) override;
std::vector<data_type> get_values(const selection_type& selector, data_access::ReSampleMethod m) override;

// Implementation of CoastalFormulation
void initialize() override;
Expand All @@ -42,6 +41,9 @@ class SchismFormulation : public CoastalFormulation

void get_values(const selection_type& selector, boost::span<double> data) override;

protected:
size_t mesh_size(std::string const& variable_name) override;

private:
std::unique_ptr<models::bmi::Bmi_Fortran_Adapter> bmi_;

Expand Down
52 changes: 52 additions & 0 deletions src/realizations/coastal/SchismFormulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ SchismFormulation::SchismFormulation(
);
}

SchismFormulation::~SchismFormulation() = default;

void SchismFormulation::initialize()
{
bmi_->Initialize();
Expand Down Expand Up @@ -83,11 +85,61 @@ void SchismFormulation::update()
// TMP2m - temperature at 2m
// UU10m, VV10m - wind velocity components at 10m

//auto rain_points = MeshPointsSelector{"RAINRATE", current_time_, time_step_length_, input_variable_units_["RAINRATE"], all_points};

// ETA2_bnd - water surface elevation at the boundaries
// Q_bnd - flows at boundaries


bmi_->Update();
}

boost::span<const std::string> SchismFormulation::get_available_variable_names() const
{
throw std::runtime_error(__func__);
return {};
}

long SchismFormulation::get_data_start_time() const
{
throw std::runtime_error(__func__);
return 0;
}

long SchismFormulation::get_data_stop_time() const
{
throw std::runtime_error(__func__);
return 0;
}

long SchismFormulation::record_duration() const
{
throw std::runtime_error(__func__);
return 0;
}

size_t SchismFormulation::get_ts_index_for_time(const time_t &epoch_time) const
{
throw std::runtime_error(__func__);
return 0;
}

SchismFormulation::data_type SchismFormulation::get_value(const selection_type& selector, data_access::ReSampleMethod m)
{
throw std::runtime_error(__func__);
return 0.0;
}

void SchismFormulation::get_values(const selection_type& selector, boost::span<double> data)
{
throw std::runtime_error(__func__);
}

size_t SchismFormulation::mesh_size(std::string const& variable_name)
{
throw std::runtime_error(__func__);
return 0;
}


#endif // NGEN_WITH_BMI_FORTRAN && NGEN_WITH_MPI

0 comments on commit fa6c223

Please sign in to comment.