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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/ProbeSampler.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
ProbeSampler.H
Go to the documentation of this file.
1#ifndef PROBESAMPLER_H
2#define PROBESAMPLER_H
3
5
6namespace amr_wind::sampling {
7
14class ProbeSampler : public SamplerBase::Register<ProbeSampler>
15{
16public:
17 static std::string identifier() { return "ProbeSampler"; }
18
20 std::string sampletype() const override { return identifier(); }
21
22 explicit ProbeSampler(const CFDSim& /*unused*/);
23
24 ~ProbeSampler() override;
25
26 void initialize(const std::string& key) override;
27
29 void check_bounds() override;
30
32 void sampling_locations(SampleLocType& /*sample_locs*/) const override;
33
37 SampleLocType& /*sample_locs*/,
38 const amrex::Box& /*box*/) const override;
39
40 void output_locations(SampleLocType& sample_locs) const override
41 {
42 sampling_locations(sample_locs);
43 }
44
45 void
46 define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
47
48 std::string label() const override { return m_label; }
49 std::string& label() override { return m_label; }
50 int id() const override { return m_id; }
51 int& id() override { return m_id; }
52
53 long num_points() const override { return m_npts; }
54
56 long num_output_points() const override { return m_npts; }
57
58private:
59 const CFDSim& m_sim;
61
62 amrex::Vector<amrex::Real> m_offset_vector{0.0, 0.0, 0.0};
63 amrex::Vector<amrex::Real> m_poffsets;
64
65 std::string m_label;
66 int m_id{-1};
67 int m_npts{0};
68};
69
70} // namespace amr_wind::sampling
71
72#endif /* PROBESAMPLER_H */
Definition CFDSim.H:47
Definition ProbeSampler.H:15
void check_bounds() override
Check and fix the bounds of the sampler so the probes are in the domain.
Definition ProbeSampler.cpp:64
int id() const override
Definition ProbeSampler.H:50
std::string & label() override
Definition ProbeSampler.H:49
long num_output_points() const override
Number of output probe locations (after data reduction etc.)
Definition ProbeSampler.H:56
const CFDSim & m_sim
Definition ProbeSampler.H:59
int m_id
Definition ProbeSampler.H:66
int m_npts
Definition ProbeSampler.H:67
void sampling_locations(SampleLocType &) const override
Populate the vector with coordinates of the sampling locations.
Definition ProbeSampler.cpp:90
amrex::Vector< amrex::Real > m_offset_vector
Definition ProbeSampler.H:62
int & id() override
Definition ProbeSampler.H:51
amrex::Vector< amrex::Real > m_poffsets
Definition ProbeSampler.H:63
std::string m_label
Definition ProbeSampler.H:65
void initialize(const std::string &key) override
Definition ProbeSampler.cpp:12
void output_locations(SampleLocType &sample_locs) const override
Definition ProbeSampler.H:40
void define_netcdf_metadata(const ncutils::NCGroup &) const override
Definition ProbeSampler.cpp:119
long num_points() const override
Definition ProbeSampler.H:53
SampleLocType m_probes
Definition ProbeSampler.H:60
std::string label() const override
Definition ProbeSampler.H:48
static std::string identifier()
Definition ProbeSampler.H:17
std::string sampletype() const override
Type of this sampling object.
Definition ProbeSampler.H:20
ProbeSampler(const CFDSim &)
Definition ProbeSampler.cpp:8
Representation of a NetCDF group.
Definition nc_interface.H:166
Definition DTUSpinnerSampler.cpp:16
Definition SamplerBase.H:15