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

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