SamplingContainer Class Reference

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

#include <SamplingContainer.H>

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

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()

amr_wind::sampling::SamplingContainer::SamplingContainer ( amrex::AmrCore & mesh)
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 >
void amr_wind::sampling::SamplingContainer::interpolate ( const ParIterType & pti,
const FType & farr,
const int lev,
const FieldLoc floc,
const int ncomp,
const int scomp )
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 >
void amr_wind::sampling::SamplingContainer::interpolate_fields ( const amrex::Vector< FType > & fields,
const int scomp )
inline

Perform field interpolation to sampling locations.

◆ num_sampling_particles() [1/2]

long & amr_wind::sampling::SamplingContainer::num_sampling_particles ( )
inline

◆ num_sampling_particles() [2/2]

long amr_wind::sampling::SamplingContainer::num_sampling_particles ( ) const
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 >
void amr_wind::sampling::SamplingContainer::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 )
inline

Interpolate a field to the sampling locations

Parameters
npNumber of particles in the container
icComponent of the field to be interpolated
pvecVector containing particle info
pavecArray information for the real component data
farrArray of field data for this multifab
probloProblem low values
dxiInverse cell size array
dxCell size array
offsetOffsets 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

const amrex::AmrCore& amr_wind::sampling::SamplingContainer::m_mesh
private

◆ m_total_particles

long amr_wind::sampling::SamplingContainer::m_total_particles {0}
private

The documentation for this class was generated from the following files: