29 lines
837 B
C++
29 lines
837 B
C++
#pragma once
|
|
|
|
#include "FluidSim/Component.hpp"
|
|
#include "FluidSim/Fluid.hpp"
|
|
#include "FluidSim/RuntimeProfiler.hpp"
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
namespace fluidsim::port {
|
|
|
|
class Solver {
|
|
public:
|
|
Solver(std::vector<Pipe1D>& pipes, BoundarySystem& boundaries);
|
|
std::uint64_t substep_count() const { return substep_count_; }
|
|
int minimum_substeps{4};
|
|
void add_component(Component& component);
|
|
void set_profiler(RuntimeProfiler* profiler) { profiler_=profiler; }
|
|
void step(float dt,bool profile_sample=false);
|
|
std::uint64_t step_count() const { return step_count_; }
|
|
private:
|
|
std::vector<Pipe1D>& pipes_;
|
|
BoundarySystem& boundaries_;
|
|
std::vector<Component*> components_;
|
|
std::uint64_t step_count_{}, substep_count_{};
|
|
RuntimeProfiler* profiler_{};
|
|
};
|
|
|
|
} // namespace fluidsim::port
|