/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#include "AMReX_REAL.H"
6
7using namespace amrex::literals;
8
9namespace amr_wind::sampling {
10
29class PlaneSampler : public SamplerBase::Register<PlaneSampler>
30{
31public:
32 static std::string identifier() { return "PlaneSampler"; }
33
34 explicit PlaneSampler(const CFDSim& /*unused*/);
35
36 ~PlaneSampler() override;
37
42 void initialize(const std::string& key) override;
43
45 void check_bounds() override;
46
48 void sampling_locations(SampleLocType& /*sample_locs*/) const override;
49
53 SampleLocType& /*sample_locs*/,
54 const amrex::Box& /*box*/) const override;
55
56 void output_locations(SampleLocType& sample_locs) const override
57 {
58 sampling_locations(sample_locs);
59 }
60
61 void
62 define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
63 void
64 populate_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
65
67 std::string label() const override { return m_label; }
68 std::string& label() override { return m_label; }
69
71 std::string sampletype() const override { return identifier(); }
72
74 int id() const override { return m_id; }
75 int& id() override { return m_id; }
76
78 long num_points() const override { return m_npts; }
79
81 long num_output_points() const override { return m_npts; }
82
83private:
84 const CFDSim& m_sim;
85
86 amrex::Vector<amrex::Real> m_axis1;
87 amrex::Vector<amrex::Real> m_axis2;
88 amrex::Vector<amrex::Real> m_origin;
89 amrex::Vector<amrex::Real> m_offset_vector{0.0_rt, 0.0_rt, 0.0_rt};
90 amrex::Vector<amrex::Real> m_poffsets;
91 amrex::Vector<int> m_npts_dir;
92
93 std::string m_label;
94
95 int m_id{-1};
96 int m_npts{0};
97};
98
99} // namespace amr_wind::sampling
100
101#endif /* PLANESAMPLER_H */
Definition CFDSim.H:54
void check_bounds() override
Check and fix the bounds of the sampler so the probes are in the domain.
Definition PlaneSampler.cpp:57
std::string & label() override
Definition PlaneSampler.H:68
void define_netcdf_metadata(const ncutils::NCGroup &) const override
Definition PlaneSampler.cpp:167
std::string m_label
Definition PlaneSampler.H:93
amrex::Vector< int > m_npts_dir
Definition PlaneSampler.H:91
const CFDSim & m_sim
Definition PlaneSampler.H:84
std::string sampletype() const override
Type of this sampling object.
Definition PlaneSampler.H:71
void sampling_locations(SampleLocType &) const override
Populate and return a vector of probe locations to be sampled.
Definition PlaneSampler.cpp:120
amrex::Vector< amrex::Real > m_poffsets
Definition PlaneSampler.H:90
int m_id
Definition PlaneSampler.H:95
void initialize(const std::string &key) override
Definition PlaneSampler.cpp:16
amrex::Vector< amrex::Real > m_origin
Definition PlaneSampler.H:88
amrex::Vector< amrex::Real > m_axis1
Definition PlaneSampler.H:86
void output_locations(SampleLocType &sample_locs) const override
Definition PlaneSampler.H:56
int & id() override
Definition PlaneSampler.H:75
int m_npts
Definition PlaneSampler.H:96
std::string label() const override
Name of this sampling object.
Definition PlaneSampler.H:67
int id() const override
Unique identifier for this set of probe locations.
Definition PlaneSampler.H:74
long num_output_points() const override
Number of output probe locations (after data reduction etc.)
Definition PlaneSampler.H:81
amrex::Vector< amrex::Real > m_offset_vector
Definition PlaneSampler.H:89
void populate_netcdf_metadata(const ncutils::NCGroup &) const override
Definition PlaneSampler.cpp:180
amrex::Vector< amrex::Real > m_axis2
Definition PlaneSampler.H:87
long num_points() const override
Number of probe locations along the line.
Definition PlaneSampler.H:78
PlaneSampler(const CFDSim &)
Definition PlaneSampler.cpp:12
static std::string identifier()
Definition PlaneSampler.H:32
Representation of a NetCDF group.
Definition nc_interface.H:170
Definition DTUSpinnerSampler.cpp:19
Definition SamplerBase.H:19