SamplingContainer Class Reference
|
Kynema-SGF API v0.1.0
CFD solver for wind plant simulations
|
#include <SamplingContainer.H>
Public Member Functions | |
| SamplingContainer (amrex::AmrCore &mesh) | |
| void | setup_container (int num_real_components, int num_int_components=0) |
| void | initialize_particles (const amrex::Vector< std::unique_ptr< SamplerBase > > &) |
| void | set_interpolation_order (const int order) |
| Interpolation order for sampling: 0 = nearest-neighbor, 1 = linear. | |
| 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, int scomp) |
| Perform derived field interpolation to sampling locations. | |
| void | populate_buffer (std::vector< amrex::Real > &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_nearest (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) |
| 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, const bool use_nearest=false) |
| Interpolate from an array4 onto particles. | |
Private Attributes | |
| const amrex::AmrCore & | m_mesh |
| long | m_total_particles {0} |
| int | m_interpolation_order {1} |
| Interpolation order for sampling: 0 = nearest-neighbor, 1 = linear. | |
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 kynema_sgf::sampling::SamplingContainer::initialize_particles | ( | const amrex::Vector< std::unique_ptr< SamplerBase > > & | samplers | ) |
Create particle information for all the sampling locations
◆ interpolate()
|
inlineprivate |
Interpolate from an array4 onto particles.
◆ interpolate_derived_fields()
| void kynema_sgf::sampling::SamplingContainer::interpolate_derived_fields | ( | const DerivedQtyMgr & | derived_mgr, |
| const FieldRepo & | repo, | ||
| int | scomp ) |
Perform derived field interpolation to sampling locations.
◆ interpolate_fields()
|
inline |
Perform field interpolation to sampling locations.
◆ num_sampling_particles() [1/2]
|
inline |
◆ num_sampling_particles() [2/2]
|
inline |
◆ populate_buffer()
| void kynema_sgf::sampling::SamplingContainer::populate_buffer | ( | std::vector< amrex::Real > & | buf | ) |
Populate the buffer with data for all the particles.
◆ sample_field()
|
inline |
◆ sample_field_nearest()
|
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 Nearest-neighbor sampling: no interpolation, picks the closest data point in the field (cell/face center or node, depending on field location) for each particle.
◆ set_interpolation_order()
|
inline |
Interpolation order for sampling: 0 = nearest-neighbor, 1 = linear.
◆ setup_container()
| void kynema_sgf::sampling::SamplingContainer::setup_container | ( | int | num_real_components, |
| int | num_int_components = 0 ) |
Define the container and allocate memory for runtime components
Member Data Documentation
◆ m_interpolation_order
|
private |
Interpolation order for sampling: 0 = nearest-neighbor, 1 = linear.
◆ m_mesh
|
private |
◆ m_total_particles
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/kynema-sgf/kynema-sgf/src/utilities/sampling/SamplingContainer.H
- /home/runner/work/kynema-sgf/kynema-sgf/src/utilities/sampling/SamplingContainer.cpp
Generated by