RadarSampler Class Reference

AMR-Wind API: amr_wind::sampling::RadarSampler Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches

#include <RadarSampler.H>

Inheritance diagram for amr_wind::sampling::RadarSampler:
[legend]
Collaboration diagram for amr_wind::sampling::RadarSampler:
[legend]

Public Types

enum class  phase { FORWARD , FORWARD_PAUSE , REVERSE , REVERSE_PAUSE }
 
using LosRotType = amrex::Vector<vs::Tensor>
 
using LosUnitType = amrex::Vector<vs::Vector>
 

Public Member Functions

 RadarSampler (const CFDSim &)
 
 ~RadarSampler () override
 
void initialize (const std::string &key) override
 
void check_bounds () override
 Check and fix the bounds of the sampler so the probes are in the domain.
 
void new_cone ()
 
double total_sweep_time () const
 
double periodic_time ()
 
int sweep_count () const
 
phase determine_operation_phase () const
 
double determine_current_sweep_angle () const
 
void sampling_locations (SampleLocType &) const override
 Populate and return a vector of probe locations to be sampled.
 
void sampling_locations (SampleLocType &, const amrex::Box &) const override
 
bool update_sampling_locations () override
 
void cone_axis_locations (SampleLocType &) const
 
void output_locations (SampleLocType &sample_locs) const override
 
void post_sample_actions () override
 
void define_netcdf_metadata (const ncutils::NCGroup &) const override
 
void populate_netcdf_metadata (const ncutils::NCGroup &) const override
 
void output_netcdf_data (const ncutils::NCGroup &, const size_t) const override
 
bool output_netcdf_field (const std::vector< double > &output_buffer, ncutils::NCGroup &grp, const size_t nt) override
 
std::string label () const override
 Name of this sampling object.
 
std::string & label () override
 
std::string sampletype () const override
 Type of this sampling object.
 
int id () const override
 Unique identifier for this set of probe locations.
 
int & id () override
 
long num_points () const override
 Number of sampling container locations in a timestep.
 
long num_output_points () const override
 Number of probe locations to output.
 
long num_points_scan () const
 Number of sampling container locations per interp step.
 
long num_points_axis () const
 Number of probe locations on Radar axis.
 
long num_points_cone () const
 Number of probe locations in a cone.
 
long num_points_quad () const
 Number of probe locations in a spherical cap.
 
bool do_data_modification () override
 Run data modification for specific sampler.
 
bool do_convert_velocity_los () override
 
bool do_subsampling_interp () override
 
std::vector< double > modify_sample_data (const std::vector< double > &sample_data, const std::string &) override
 Modify sample buffer after sampling happens.
 
void calc_lineofsight_velocity (const std::vector< std::vector< double > > &, const int) override
 

Static Public Member Functions

static std::string identifier ()
 
static void line_average (const std::vector< double > &weights, const std::vector< double > &values, std::vector< double > &reduced, long offset)
 

Protected Attributes

const CFDSimm_sim
 
std::string m_label
 
int m_id {-1}
 
amrex::Real m_radtodeg {180.0 / M_PI}
 
amrex::Vector< amrex::Real > m_start
 
amrex::Vector< amrex::Real > m_end
 
SampleLocType::LocType m_initial_cone
 
SampleLocType::LocType m_current_cones
 
SampleLocType::LocType m_prior_cones
 
SampleLocType::LocType m_sample_cones
 
LosRotType m_los_proj
 
LosUnitType m_los_unit
 
std::vector< double > m_los_velocity
 
std::vector< double > m_los_velocity_next
 
std::vector< double > m_los_velocity_prior
 
std::vector< double > m_los_velocity_interp
 
std::vector< double > m_weights
 
std::vector< vs::Vectorm_rays
 
amrex::Real m_sample_freq
 
amrex::Real m_radar_sample_freq
 
int m_npts {0}
 
amrex::Real m_cone_angle
 
std::string m_radar_quad_type
 
int m_npts_azimuth {0}
 
amrex::Real m_beam_length
 
amrex::Real m_angular_speed
 
amrex::Vector< amrex::Real > m_axis
 
amrex::Vector< amrex::Real > m_vertical
 
amrex::Real m_sweep_angle
 
amrex::Real m_reset_time
 
amrex::Vector< amrex::Real > m_elevation_angles
 
int m_nphi {5}
 
int m_ntheta {5}
 
vs::Vector m_radar_rotation_axis
 
long m_radar_iter {0}
 
amrex::Real m_radar_time
 
amrex::Real m_periodic_time
 
int m_ns
 
long m_ntotal
 
long m_cone_size
 
phase m_current_phase
 
bool m_debug_print {false}
 
bool m_output_cone_points {false}
 
long m_interp_steps {2}
 
int m_ns_prior
 
long m_ntotal_prior
 
long m_num_points_prior
 
long m_num_output_points_prior
 
amrex::Real m_fill_val {-99999.99}
 

Detailed Description

Sample data along a line

Defines probes along a line defined by start and end coordinates and divides it into equal segments as determined by num_points. The length of each segment is given by

\[ (end - start) / (num_points - 1) \]

Member Typedef Documentation

◆ LosRotType

◆ LosUnitType

Member Enumeration Documentation

◆ phase

Enumerator
FORWARD 
FORWARD_PAUSE 
REVERSE 
REVERSE_PAUSE 

Constructor & Destructor Documentation

◆ RadarSampler()

amr_wind::sampling::RadarSampler::RadarSampler ( const CFDSim & sim)
explicit

◆ ~RadarSampler()

amr_wind::sampling::RadarSampler::~RadarSampler ( )
overridedefault

Member Function Documentation

◆ calc_lineofsight_velocity()

void amr_wind::sampling::RadarSampler::calc_lineofsight_velocity ( const std::vector< std::vector< double > > & velocity_raw,
const int interp_idx )
override

◆ check_bounds()

void amr_wind::sampling::RadarSampler::check_bounds ( )
override

Check and fix the bounds of the sampler so the probes are in the domain.

◆ cone_axis_locations()

void amr_wind::sampling::RadarSampler::cone_axis_locations ( SampleLocType & axis_locs) const

◆ define_netcdf_metadata()

void amr_wind::sampling::RadarSampler::define_netcdf_metadata ( const ncutils::NCGroup & grp) const
override

◆ determine_current_sweep_angle()

double amr_wind::sampling::RadarSampler::determine_current_sweep_angle ( ) const

◆ determine_operation_phase()

RadarSampler::phase amr_wind::sampling::RadarSampler::determine_operation_phase ( ) const

◆ do_convert_velocity_los()

bool amr_wind::sampling::RadarSampler::do_convert_velocity_los ( )
inlineoverride

◆ do_data_modification()

bool amr_wind::sampling::RadarSampler::do_data_modification ( )
inlineoverride

Run data modification for specific sampler.

◆ do_subsampling_interp()

bool amr_wind::sampling::RadarSampler::do_subsampling_interp ( )
inlineoverride

◆ id() [1/2]

int amr_wind::sampling::RadarSampler::id ( ) const
inlineoverride

Unique identifier for this set of probe locations.

◆ id() [2/2]

int & amr_wind::sampling::RadarSampler::id ( )
inlineoverride

◆ identifier()

static std::string amr_wind::sampling::RadarSampler::identifier ( )
inlinestatic

◆ initialize()

void amr_wind::sampling::RadarSampler::initialize ( const std::string & key)
override

Read user inputs and initialize the sampling object

Parameters
keyPrefix used to parse inputs from file

◆ label() [1/2]

std::string amr_wind::sampling::RadarSampler::label ( ) const
inlineoverride

Name of this sampling object.

◆ label() [2/2]

std::string & amr_wind::sampling::RadarSampler::label ( )
inlineoverride

◆ line_average()

void amr_wind::sampling::RadarSampler::line_average ( const std::vector< double > & weights,
const std::vector< double > & values,
std::vector< double > & reduced,
long offset )
static

◆ modify_sample_data()

std::vector< double > amr_wind::sampling::RadarSampler::modify_sample_data ( const std::vector< double > & sample_data,
const std::string &  )
override

Modify sample buffer after sampling happens.

◆ new_cone()

void amr_wind::sampling::RadarSampler::new_cone ( )

◆ num_output_points()

long amr_wind::sampling::RadarSampler::num_output_points ( ) const
inlineoverride

Number of probe locations to output.

◆ num_points()

long amr_wind::sampling::RadarSampler::num_points ( ) const
inlineoverride

Number of sampling container locations in a timestep.

◆ num_points_axis()

long amr_wind::sampling::RadarSampler::num_points_axis ( ) const
inline

Number of probe locations on Radar axis.

◆ num_points_cone()

long amr_wind::sampling::RadarSampler::num_points_cone ( ) const
inline

Number of probe locations in a cone.

◆ num_points_quad()

long amr_wind::sampling::RadarSampler::num_points_quad ( ) const
inline

Number of probe locations in a spherical cap.

◆ num_points_scan()

long amr_wind::sampling::RadarSampler::num_points_scan ( ) const
inline

Number of sampling container locations per interp step.

◆ output_locations()

void amr_wind::sampling::RadarSampler::output_locations ( SampleLocType & sample_locs) const
inlineoverride

◆ output_netcdf_data()

void amr_wind::sampling::RadarSampler::output_netcdf_data ( const ncutils::NCGroup & grp,
const size_t nt ) const
override

◆ output_netcdf_field()

bool amr_wind::sampling::RadarSampler::output_netcdf_field ( const std::vector< double > & output_buffer,
ncutils::NCGroup & grp,
const size_t nt )
override

◆ periodic_time()

double amr_wind::sampling::RadarSampler::periodic_time ( )

◆ populate_netcdf_metadata()

void amr_wind::sampling::RadarSampler::populate_netcdf_metadata ( const ncutils::NCGroup & ) const
override

◆ post_sample_actions()

void amr_wind::sampling::RadarSampler::post_sample_actions ( )
override

◆ sampletype()

std::string amr_wind::sampling::RadarSampler::sampletype ( ) const
inlineoverride

Type of this sampling object.

◆ sampling_locations() [1/2]

void amr_wind::sampling::RadarSampler::sampling_locations ( SampleLocType & sample_locs) const
override

Populate and return a vector of probe locations to be sampled.

◆ sampling_locations() [2/2]

void amr_wind::sampling::RadarSampler::sampling_locations ( SampleLocType & sample_locs,
const amrex::Box & box ) const
override

Populate the vector with coordinates of the sampling locations inside a box

◆ sweep_count()

int amr_wind::sampling::RadarSampler::sweep_count ( ) const

◆ total_sweep_time()

double amr_wind::sampling::RadarSampler::total_sweep_time ( ) const

◆ update_sampling_locations()

bool amr_wind::sampling::RadarSampler::update_sampling_locations ( )
override

Member Data Documentation

◆ m_angular_speed

amrex::Real amr_wind::sampling::RadarSampler::m_angular_speed
protected

◆ m_axis

amrex::Vector<amrex::Real> amr_wind::sampling::RadarSampler::m_axis
protected

◆ m_beam_length

amrex::Real amr_wind::sampling::RadarSampler::m_beam_length
protected

◆ m_cone_angle

amrex::Real amr_wind::sampling::RadarSampler::m_cone_angle
protected

◆ m_cone_size

long amr_wind::sampling::RadarSampler::m_cone_size
protected

◆ m_current_cones

SampleLocType::LocType amr_wind::sampling::RadarSampler::m_current_cones
protected

◆ m_current_phase

phase amr_wind::sampling::RadarSampler::m_current_phase
protected

◆ m_debug_print

bool amr_wind::sampling::RadarSampler::m_debug_print {false}
protected

◆ m_elevation_angles

amrex::Vector<amrex::Real> amr_wind::sampling::RadarSampler::m_elevation_angles
protected

◆ m_end

amrex::Vector<amrex::Real> amr_wind::sampling::RadarSampler::m_end
protected

◆ m_fill_val

amrex::Real amr_wind::sampling::RadarSampler::m_fill_val {-99999.99}
protected

◆ m_id

int amr_wind::sampling::RadarSampler::m_id {-1}
protected

◆ m_initial_cone

SampleLocType::LocType amr_wind::sampling::RadarSampler::m_initial_cone
protected

◆ m_interp_steps

long amr_wind::sampling::RadarSampler::m_interp_steps {2}
protected

◆ m_label

std::string amr_wind::sampling::RadarSampler::m_label
protected

◆ m_los_proj

LosRotType amr_wind::sampling::RadarSampler::m_los_proj
protected

◆ m_los_unit

LosUnitType amr_wind::sampling::RadarSampler::m_los_unit
protected

◆ m_los_velocity

std::vector<double> amr_wind::sampling::RadarSampler::m_los_velocity
protected

◆ m_los_velocity_interp

std::vector<double> amr_wind::sampling::RadarSampler::m_los_velocity_interp
protected

◆ m_los_velocity_next

std::vector<double> amr_wind::sampling::RadarSampler::m_los_velocity_next
protected

◆ m_los_velocity_prior

std::vector<double> amr_wind::sampling::RadarSampler::m_los_velocity_prior
protected

◆ m_nphi

int amr_wind::sampling::RadarSampler::m_nphi {5}
protected

◆ m_npts

int amr_wind::sampling::RadarSampler::m_npts {0}
protected

◆ m_npts_azimuth

int amr_wind::sampling::RadarSampler::m_npts_azimuth {0}
protected

◆ m_ns

int amr_wind::sampling::RadarSampler::m_ns
protected

◆ m_ns_prior

int amr_wind::sampling::RadarSampler::m_ns_prior
protected

◆ m_ntheta

int amr_wind::sampling::RadarSampler::m_ntheta {5}
protected

◆ m_ntotal

long amr_wind::sampling::RadarSampler::m_ntotal
protected

◆ m_ntotal_prior

long amr_wind::sampling::RadarSampler::m_ntotal_prior
protected

◆ m_num_output_points_prior

long amr_wind::sampling::RadarSampler::m_num_output_points_prior
protected

◆ m_num_points_prior

long amr_wind::sampling::RadarSampler::m_num_points_prior
protected

◆ m_output_cone_points

bool amr_wind::sampling::RadarSampler::m_output_cone_points {false}
protected

◆ m_periodic_time

amrex::Real amr_wind::sampling::RadarSampler::m_periodic_time
protected

◆ m_prior_cones

SampleLocType::LocType amr_wind::sampling::RadarSampler::m_prior_cones
protected

◆ m_radar_iter

long amr_wind::sampling::RadarSampler::m_radar_iter {0}
protected

◆ m_radar_quad_type

std::string amr_wind::sampling::RadarSampler::m_radar_quad_type
protected

◆ m_radar_rotation_axis

vs::Vector amr_wind::sampling::RadarSampler::m_radar_rotation_axis
protected

◆ m_radar_sample_freq

amrex::Real amr_wind::sampling::RadarSampler::m_radar_sample_freq
protected

◆ m_radar_time

amrex::Real amr_wind::sampling::RadarSampler::m_radar_time
protected

◆ m_radtodeg

amrex::Real amr_wind::sampling::RadarSampler::m_radtodeg {180.0 / M_PI}
protected

◆ m_rays

std::vector<vs::Vector> amr_wind::sampling::RadarSampler::m_rays
protected

◆ m_reset_time

amrex::Real amr_wind::sampling::RadarSampler::m_reset_time
protected

◆ m_sample_cones

SampleLocType::LocType amr_wind::sampling::RadarSampler::m_sample_cones
protected

◆ m_sample_freq

amrex::Real amr_wind::sampling::RadarSampler::m_sample_freq
protected

◆ m_sim

const CFDSim& amr_wind::sampling::RadarSampler::m_sim
protected

◆ m_start

amrex::Vector<amrex::Real> amr_wind::sampling::RadarSampler::m_start
protected

◆ m_sweep_angle

amrex::Real amr_wind::sampling::RadarSampler::m_sweep_angle
protected

◆ m_vertical

amrex::Vector<amrex::Real> amr_wind::sampling::RadarSampler::m_vertical
protected

◆ m_weights

std::vector<double> amr_wind::sampling::RadarSampler::m_weights
protected

The documentation for this class was generated from the following files:
  • /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/RadarSampler.H
  • /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/RadarSampler.cpp