/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#include "AMReX_REAL.H"
6
7using namespace amrex::literals;
8
9namespace amr_wind::sampling {
10
17class ProbeSampler : public SamplerBase::Register<ProbeSampler>
18{
19public:
20 static std::string identifier() { return "ProbeSampler"; }
21
23 std::string sampletype() const override { return identifier(); }
24
25 explicit ProbeSampler(const CFDSim& /*unused*/);
26
27 ~ProbeSampler() override;
28
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
51 std::string label() const override { return m_label; }
52 std::string& label() override { return m_label; }
53 int id() const override { return m_id; }
54 int& id() override { return m_id; }
55
56 long num_points() const override { return m_npts; }
57
59 long num_output_points() const override { return m_npts; }
60
61private:
62 const CFDSim& m_sim;
64
65 amrex::Vector<amrex::Real> m_offset_vector{0.0_rt, 0.0_rt, 0.0_rt};
66 amrex::Vector<amrex::Real> m_poffsets;
67
68 std::string m_label;
69 int m_id{-1};
70 int m_npts{0};
71};
72
73} // namespace amr_wind::sampling
74
75#endif /* PROBESAMPLER_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 ProbeSampler.cpp:67
int id() const override
Definition ProbeSampler.H:53
std::string & label() override
Definition ProbeSampler.H:52
long num_output_points() const override
Number of output probe locations (after data reduction etc.)
Definition ProbeSampler.H:59
const CFDSim & m_sim
Definition ProbeSampler.H:62
int m_id
Definition ProbeSampler.H:69
int m_npts
Definition ProbeSampler.H:70
void sampling_locations(SampleLocType &) const override
Populate the vector with coordinates of the sampling locations.
Definition ProbeSampler.cpp:93
amrex::Vector< amrex::Real > m_offset_vector
Definition ProbeSampler.H:65
int & id() override
Definition ProbeSampler.H:54
amrex::Vector< amrex::Real > m_poffsets
Definition ProbeSampler.H:66
std::string m_label
Definition ProbeSampler.H:68
void initialize(const std::string &key) override
Definition ProbeSampler.cpp:15
void output_locations(SampleLocType &sample_locs) const override
Definition ProbeSampler.H:43
void define_netcdf_metadata(const ncutils::NCGroup &) const override
Definition ProbeSampler.cpp:122
long num_points() const override
Definition ProbeSampler.H:56
SampleLocType m_probes
Definition ProbeSampler.H:63
std::string label() const override
Definition ProbeSampler.H:51
static std::string identifier()
Definition ProbeSampler.H:20
std::string sampletype() const override
Type of this sampling object.
Definition ProbeSampler.H:23
ProbeSampler(const CFDSim &)
Definition ProbeSampler.cpp:11
Representation of a NetCDF group.
Definition nc_interface.H:170
Definition DTUSpinnerSampler.cpp:19
Definition SamplerBase.H:19