SamplingContainer Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
|
Loading...
Searching...
No Matches
amr_wind::sampling::SamplingContainer Class Reference
#include <SamplingContainer.H>
Inheritance diagram for amr_wind::sampling::SamplingContainer:
Collaboration diagram for amr_wind::sampling::SamplingContainer:
Public Member Functions | |
SamplingContainer (amrex::AmrCore &mesh) | |
void | setup_container (const int num_real_components, const int num_int_components=0) |
void | initialize_particles (const amrex::Vector< std::unique_ptr< SamplerBase > > &) |
template<typename FType > | |
void | interpolate_fields (const amrex::Vector< FType > &fields, const int scomp) |
Perform field interpolation to sampling locations. | |
void | interpolate_derived_fields (const DerivedQtyMgr &derived_mgr, const FieldRepo &repo, const int scomp) |
Perform derived field interpolation to sampling locations. | |
void | populate_buffer (std::vector< double > &buf) |
Populate the buffer with data for all the particles. | |
long | num_sampling_particles () const |
long & | num_sampling_particles () |
template<typename FType > | |
void | sample_field (const int np, const int ic, SamplingContainer::ParticleVector &pvec, SamplingContainer::RealVector &pavec, const FType &farr, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &problo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxi, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &offset) |
Private Member Functions | |
template<typename FType > | |
void | interpolate (const ParIterType &pti, const FType &farr, const int lev, const FieldLoc floc, const int ncomp, const int scomp) |
Interpolate from an array4 onto particles. | |
Private Attributes | |
const amrex::AmrCore & | m_mesh |
long | m_total_particles {0} |
Detailed Description
Specialization of the AMReX ParticleContainer object for sampling data
Represents the data probes as a collection of particles that are uniquely identified by three integer identifiers:
- a universal identifier (UID) that is unique to each particle,
- a set identifier that represents a group (e.g., line, plane) of particles
- a node identifier that represents indexing of this particle within the group
The quantities of interest are themselves stored as runtime components based on user-defined inputs.
Notes:
- The implementation uses linear interpolation in three directions to determine the data at a given probe location
- For non-nodal fields, the current implementation requires at-least one ghost cell to allow linear interpolation.
- Interpolation near domain boundaries does not currently handle
hoextrap
Constructor & Destructor Documentation
◆ SamplingContainer()
|
inlineexplicit |
Member Function Documentation
◆ initialize_particles()
void amr_wind::sampling::SamplingContainer::initialize_particles | ( | const amrex::Vector< std::unique_ptr< SamplerBase > > & | samplers | ) |
Create particle information for all the sampling locations
◆ interpolate()
template<typename FType >
|
inlineprivate |
Interpolate from an array4 onto particles.
◆ interpolate_derived_fields()
void amr_wind::sampling::SamplingContainer::interpolate_derived_fields | ( | const DerivedQtyMgr & | derived_mgr, |
const FieldRepo & | repo, | ||
const int | scomp ) |
Perform derived field interpolation to sampling locations.
◆ interpolate_fields()
template<typename FType >
|
inline |
Perform field interpolation to sampling locations.
◆ num_sampling_particles() [1/2]
|
inline |
◆ num_sampling_particles() [2/2]
|
inline |
◆ populate_buffer()
void amr_wind::sampling::SamplingContainer::populate_buffer | ( | std::vector< double > & | buf | ) |
Populate the buffer with data for all the particles.
◆ sample_field()
template<typename FType >
|
inline |
Interpolate a field to the sampling locations
- Parameters
-
np Number of particles in the container ic Component of the field to be interpolated pvec Vector containing particle info pavec Array information for the real component data farr Array of field data for this multifab problo Problem low values dxi Inverse cell size array dx Cell size array offset Offsets for cell/node/face fields
◆ setup_container()
void amr_wind::sampling::SamplingContainer::setup_container | ( | const int | num_real_components, |
const int | num_int_components = 0 ) |
Define the container and allocate memory for runtime components
Member Data Documentation
◆ m_mesh
|
private |
◆ m_total_particles
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/SamplingContainer.H
- /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/SamplingContainer.cpp
Generated by 1.12.0