/home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/LineSampler.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/LineSampler.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
LineSampler.H
Go to the documentation of this file.
1#ifndef LINESAMPLER_H
2#define LINESAMPLER_H
3
5
6namespace amr_wind::sampling {
7
15class LineSampler : public SamplerBase::Register<LineSampler>
16{
17public:
18 static std::string identifier() { return "LineSampler"; }
19
20 explicit LineSampler(const CFDSim& /*sim*/);
21
22 ~LineSampler() override;
23
28 void initialize(const std::string& key) override;
29
31 void check_bounds() override;
32
34 void sampling_locations(SampleLocType& /*sample_locs*/) const override;
35
39 SampleLocType& /*sample_locs*/,
40 const amrex::Box& /*box*/) const override;
41
42 void output_locations(SampleLocType& sample_locs) const override
43 {
44 sampling_locations(sample_locs);
45 }
46
47 void
48 define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
49 void
50 populate_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
51
53 [[nodiscard]] std::string label() const override { return m_label; }
54 std::string& label() override { return m_label; }
55
57 [[nodiscard]] std::string sampletype() const override
58 {
59 return identifier();
60 }
61
63 [[nodiscard]] int id() const override { return m_id; }
64 int& id() override { return m_id; }
65
67 [[nodiscard]] long num_points() const override { return m_npts; }
68
70 [[nodiscard]] long num_output_points() const override { return m_npts; }
71
72protected:
73 const CFDSim& m_sim;
74
75 amrex::Vector<amrex::Real> m_start;
76 amrex::Vector<amrex::Real> m_end;
77
78 std::string m_label;
79 int m_id{-1};
80 int m_npts{0};
81};
82
83} // namespace amr_wind::sampling
84
85#endif /* LINESAMPLER_H */
Definition CFDSim.H:54
long num_points() const override
Number of probe locations along the line.
Definition LineSampler.H:67
std::string label() const override
Name of this sampling object.
Definition LineSampler.H:53
void initialize(const std::string &key) override
Definition LineSampler.cpp:14
amrex::Vector< amrex::Real > m_start
Definition LineSampler.H:75
const CFDSim & m_sim
Definition LineSampler.H:73
void define_netcdf_metadata(const ncutils::NCGroup &) const override
Definition LineSampler.cpp:94
int m_npts
Definition LineSampler.H:80
void populate_netcdf_metadata(const ncutils::NCGroup &) const override
Definition LineSampler.cpp:101
LineSampler(const CFDSim &)
Definition LineSampler.cpp:10
std::string & label() override
Definition LineSampler.H:54
int & id() override
Definition LineSampler.H:64
void check_bounds() override
Check and fix the bounds of the sampler so the probes are in the domain.
Definition LineSampler.cpp:25
int m_id
Definition LineSampler.H:79
void output_locations(SampleLocType &sample_locs) const override
Definition LineSampler.H:42
static std::string identifier()
Definition LineSampler.H:18
std::string m_label
Definition LineSampler.H:78
std::string sampletype() const override
Type of this sampling object.
Definition LineSampler.H:57
void sampling_locations(SampleLocType &) const override
Populate and return a vector of probe locations to be sampled.
Definition LineSampler.cpp:57
amrex::Vector< amrex::Real > m_end
Definition LineSampler.H:76
long num_output_points() const override
Number of output probe locations (after data reduction etc.)
Definition LineSampler.H:70
int id() const override
Unique identifier for this set of probe locations.
Definition LineSampler.H:63
Representation of a NetCDF group.
Definition nc_interface.H:162
Definition DTUSpinnerSampler.cpp:19
Definition SamplerBase.H:19