/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 std::string label() const override { return m_label; }
54 std::string& label() override { return m_label; }
55
57 std::string sampletype() const override { return identifier(); }
58
60 int id() const override { return m_id; }
61 int& id() override { return m_id; }
62
64 long num_points() const override { return m_npts; }
65
67 long num_output_points() const override { return m_npts; }
68
69protected:
70 const CFDSim& m_sim;
71
72 amrex::Vector<amrex::Real> m_start;
73 amrex::Vector<amrex::Real> m_end;
74
75 std::string m_label;
76 int m_id{-1};
77 int m_npts{0};
78};
79
80} // namespace amr_wind::sampling
81
82#endif /* LINESAMPLER_H */
Definition CFDSim.H:47
Definition LineSampler.H:16
long num_points() const override
Number of probe locations along the line.
Definition LineSampler.H:64
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:72
const CFDSim & m_sim
Definition LineSampler.H:70
void define_netcdf_metadata(const ncutils::NCGroup &) const override
Definition LineSampler.cpp:94
int m_npts
Definition LineSampler.H:77
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:61
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:76
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:75
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:73
long num_output_points() const override
Number of output probe locations (after data reduction etc.)
Definition LineSampler.H:67
int id() const override
Unique identifier for this set of probe locations.
Definition LineSampler.H:60
Representation of a NetCDF group.
Definition nc_interface.H:166
Definition DTUSpinnerSampler.cpp:16
Definition SamplerBase.H:15