/home/runner/work/amr-wind/amr-wind/amr-wind/immersed_boundary/IBModel.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/immersed_boundary/IBModel.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
IBModel.H
Go to the documentation of this file.
1#ifndef IBMODEL_H
2#define IBMODEL_H
3
8
9namespace amr_wind {
10
11class CFDSim;
12
13namespace ib {
14
26 : public Factory<
27 ImmersedBoundaryModel,
28 CFDSim&,
29 const std::string&,
30 const int>
31{
32public:
33 static std::string base_identifier() { return "ImmersedBoundaryModel"; }
34
35 ~ImmersedBoundaryModel() override = default;
36
37 virtual const std::string& label() const = 0;
38
39 virtual int id() const = 0;
40
41 virtual void read_inputs(const ::amr_wind::utils::MultiParser&) = 0;
42
43 virtual void init_ib() = 0;
44
45 virtual void update_positions() = 0;
46
47 virtual void update_velocities() = 0;
48
49 virtual void compute_forces() = 0;
50
51 virtual void prepare_outputs(const std::string&) = 0;
52
53 virtual void write_outputs() = 0;
54};
55
66template <typename GeomTrait>
67class IBModel : public ImmersedBoundaryModel::Register<IBModel<GeomTrait>>
68{
69private:
72 typename GeomTrait::DataType m_data;
73
76
77public:
78 static std::string identifier() { return GeomTrait::identifier(); }
79
85 IBModel(CFDSim& sim, const std::string& label, const int id)
86 : m_data(sim, label, id), m_out_op(m_data)
87 {}
88
90 const std::string& label() const override { return m_data.info().label; }
91
93 int id() const override { return m_data.info().id; }
94
95 void read_inputs(const ::amr_wind::utils::MultiParser& pp) override
96 {
98 m_out_op.read_io_options(pp);
99 }
100
101 void update_positions() override {}
102
104
106
107 void prepare_outputs(const std::string& out_dir) override
108 {
109 m_out_op.prepare_outputs(out_dir);
110 }
111
112 void write_outputs() override { m_out_op.write_outputs(); }
113
115};
116
117} // namespace ib
118} // namespace amr_wind
119
120#endif /* IBMODEL_H */
Definition CFDSim.H:47
Definition IBModel.H:68
ops::ProcessOutputsOp< GeomTrait > m_out_op
Outputs processor.
Definition IBModel.H:75
void update_positions() override
Definition IBModel.H:101
void prepare_outputs(const std::string &out_dir) override
Definition IBModel.H:107
int id() const override
Return the unique tag (integer ID) for this instance.
Definition IBModel.H:93
void write_outputs() override
Definition IBModel.H:112
static std::string identifier()
Definition IBModel.H:78
void init_ib() override
Definition IBModel.H:114
GeomTrait::DataType m_data
Definition IBModel.H:72
void update_velocities() override
Definition IBModel.H:103
void compute_forces() override
Definition IBModel.H:105
const std::string & label() const override
Return the unique identifier (name) for this instance.
Definition IBModel.H:90
void read_inputs(const ::amr_wind::utils::MultiParser &pp) override
Definition IBModel.H:95
IBModel(CFDSim &sim, const std::string &label, const int id)
Definition IBModel.H:85
virtual void prepare_outputs(const std::string &)=0
virtual const std::string & label() const =0
static std::string base_identifier()
Definition IBModel.H:33
~ImmersedBoundaryModel() override=default
virtual void read_inputs(const ::amr_wind::utils::MultiParser &)=0
Definition BCInterface.cpp:7
Definition Factory.H:65
Definition IBOps.H:32
Definition IBOps.H:19
Definition IBOps.H:54