PlaneSampler Class Reference

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

#include <PlaneSampler.H>

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

Public Member Functions

 PlaneSampler (const CFDSim &)
 
 ~PlaneSampler () 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 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
 
void output_locations (SampleLocType &sample_locs) const override
 
void define_netcdf_metadata (const ncutils::NCGroup &) const override
 
void populate_netcdf_metadata (const ncutils::NCGroup &) const 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 probe locations along the line.
 
long num_output_points () const override
 Number of output probe locations (after data reduction etc.)
 

Static Public Member Functions

static std::string identifier ()
 

Private Attributes

const CFDSimm_sim
 
amrex::Vector< amrex::Real > m_axis1
 
amrex::Vector< amrex::Real > m_axis2
 
amrex::Vector< amrex::Real > m_origin
 
amrex::Vector< amrex::Real > m_offset_vector {0.0, 0.0, 0.0}
 
amrex::Vector< amrex::Real > m_poffsets
 
amrex::Vector< int > m_npts_dir
 
std::string m_label
 
int m_id {-1}
 
int m_npts {0}
 

Detailed Description

Sample data on uniform grids

Defines probe locations on a two-dimensional plane defined by two vectors axis1 and axis2 that originate from the point origin. The length of the vectors determine the extents of the parallelogram on which the probes are defined. The grid points are uniformly spaced along each axis as determined by the number of points defined in num_points (a list of two integers, one for each axis).

With no additional inputs, the implementation creates one plane of grid points such that origin lines on the plane defined by the points. User can choose to create additional parallel planes by providing an offset (a list of translation distances) from origin along a normal vector. Note that if offset is specified, then the implementation will not create a default plane at origin, the user must include a zero translation offset if sampling on the plane at origin is desired.

Constructor & Destructor Documentation

◆ PlaneSampler()

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

◆ ~PlaneSampler()

amr_wind::sampling::PlaneSampler::~PlaneSampler ( )
overridedefault

Member Function Documentation

◆ check_bounds()

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

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

◆ define_netcdf_metadata()

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

◆ id() [1/2]

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

Unique identifier for this set of probe locations.

◆ id() [2/2]

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

◆ identifier()

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

◆ initialize()

void amr_wind::sampling::PlaneSampler::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::PlaneSampler::label ( ) const
inlineoverride

Name of this sampling object.

◆ label() [2/2]

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

◆ num_output_points()

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

Number of output probe locations (after data reduction etc.)

◆ num_points()

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

Number of probe locations along the line.

◆ output_locations()

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

◆ populate_netcdf_metadata()

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

◆ sampletype()

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

Type of this sampling object.

◆ sampling_locations() [1/2]

void amr_wind::sampling::PlaneSampler::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::PlaneSampler::sampling_locations ( SampleLocType & sample_locs,
const amrex::Box & box ) const
override

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

Member Data Documentation

◆ m_axis1

amrex::Vector<amrex::Real> amr_wind::sampling::PlaneSampler::m_axis1
private

◆ m_axis2

amrex::Vector<amrex::Real> amr_wind::sampling::PlaneSampler::m_axis2
private

◆ m_id

int amr_wind::sampling::PlaneSampler::m_id {-1}
private

◆ m_label

std::string amr_wind::sampling::PlaneSampler::m_label
private

◆ m_npts

int amr_wind::sampling::PlaneSampler::m_npts {0}
private

◆ m_npts_dir

amrex::Vector<int> amr_wind::sampling::PlaneSampler::m_npts_dir
private

◆ m_offset_vector

amrex::Vector<amrex::Real> amr_wind::sampling::PlaneSampler::m_offset_vector {0.0, 0.0, 0.0}
private

◆ m_origin

amrex::Vector<amrex::Real> amr_wind::sampling::PlaneSampler::m_origin
private

◆ m_poffsets

amrex::Vector<amrex::Real> amr_wind::sampling::PlaneSampler::m_poffsets
private

◆ m_sim

const CFDSim& amr_wind::sampling::PlaneSampler::m_sim
private

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