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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/PlaneSampler.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
PlaneSampler.H
Go to the documentation of this file.
1#ifndef PLANESAMPLER_H
2#define PLANESAMPLER_H
3
5
6namespace amr_wind::sampling {
7
26class PlaneSampler : public SamplerBase::Register<PlaneSampler>
27{
28public:
29 static std::string identifier() { return "PlaneSampler"; }
30
31 explicit PlaneSampler(const CFDSim& /*unused*/);
32
33 ~PlaneSampler() override;
34
39 void initialize(const std::string& key) override;
40
42 void check_bounds() override;
43
45 void sampling_locations(SampleLocType& /*sample_locs*/) const override;
46
50 SampleLocType& /*sample_locs*/,
51 const amrex::Box& /*box*/) const override;
52
53 void output_locations(SampleLocType& sample_locs) const override
54 {
55 sampling_locations(sample_locs);
56 }
57
58 void
59 define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
60 void
61 populate_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
62
64 std::string label() const override { return m_label; }
65 std::string& label() override { return m_label; }
66
68 std::string sampletype() const override { return identifier(); }
69
71 int id() const override { return m_id; }
72 int& id() override { return m_id; }
73
75 long num_points() const override { return m_npts; }
76
78 long num_output_points() const override { return m_npts; }
79
80private:
81 const CFDSim& m_sim;
82
83 amrex::Vector<amrex::Real> m_axis1;
84 amrex::Vector<amrex::Real> m_axis2;
85 amrex::Vector<amrex::Real> m_origin;
86 amrex::Vector<amrex::Real> m_offset_vector{0.0, 0.0, 0.0};
87 amrex::Vector<amrex::Real> m_poffsets;
88 amrex::Vector<int> m_npts_dir;
89
90 std::string m_label;
91
92 int m_id{-1};
93 int m_npts{0};
94};
95
96} // namespace amr_wind::sampling
97
98#endif /* PLANESAMPLER_H */
Definition CFDSim.H:47
Definition PlaneSampler.H:27
void check_bounds() override
Check and fix the bounds of the sampler so the probes are in the domain.
Definition PlaneSampler.cpp:55
std::string & label() override
Definition PlaneSampler.H:65
void define_netcdf_metadata(const ncutils::NCGroup &) const override
Definition PlaneSampler.cpp:159
std::string m_label
Definition PlaneSampler.H:90
amrex::Vector< int > m_npts_dir
Definition PlaneSampler.H:88
const CFDSim & m_sim
Definition PlaneSampler.H:81
std::string sampletype() const override
Type of this sampling object.
Definition PlaneSampler.H:68
void sampling_locations(SampleLocType &) const override
Populate and return a vector of probe locations to be sampled.
Definition PlaneSampler.cpp:112
amrex::Vector< amrex::Real > m_poffsets
Definition PlaneSampler.H:87
int m_id
Definition PlaneSampler.H:92
void initialize(const std::string &key) override
Definition PlaneSampler.cpp:14
amrex::Vector< amrex::Real > m_origin
Definition PlaneSampler.H:85
amrex::Vector< amrex::Real > m_axis1
Definition PlaneSampler.H:83
void output_locations(SampleLocType &sample_locs) const override
Definition PlaneSampler.H:53
int & id() override
Definition PlaneSampler.H:72
int m_npts
Definition PlaneSampler.H:93
std::string label() const override
Name of this sampling object.
Definition PlaneSampler.H:64
int id() const override
Unique identifier for this set of probe locations.
Definition PlaneSampler.H:71
long num_output_points() const override
Number of output probe locations (after data reduction etc.)
Definition PlaneSampler.H:78
amrex::Vector< amrex::Real > m_offset_vector
Definition PlaneSampler.H:86
void populate_netcdf_metadata(const ncutils::NCGroup &) const override
Definition PlaneSampler.cpp:172
amrex::Vector< amrex::Real > m_axis2
Definition PlaneSampler.H:84
long num_points() const override
Number of probe locations along the line.
Definition PlaneSampler.H:75
PlaneSampler(const CFDSim &)
Definition PlaneSampler.cpp:10
static std::string identifier()
Definition PlaneSampler.H:29
Representation of a NetCDF group.
Definition nc_interface.H:166
Definition DTUSpinnerSampler.cpp:16
Definition SamplerBase.H:15