OpenImpala
Image-based parallel transport property solver
Loading...
Searching...
No Matches
OpenImpala::VolumeFraction Class Reference

Computes the volume fraction of a specific phase within an amrex::iMultiFab. More...

#include <VolumeFraction.H>

Public Member Functions

VolumeFraction & operator= (const VolumeFraction &)=delete
 Deleted copy assignment operator (due to reference member).
VolumeFraction & operator= (VolumeFraction &&)=delete
 Deleted move assignment operator.
void value (long long &phase_count, long long &total_count, bool local=false) const
 Computes the count of the specified phase and the total cell count.
amrex::Real value_vf (bool local=false) const
 VolumeFraction (const amrex::iMultiFab &fm, const int phase=0, int comp=0)
 Constructs a new VolumeFraction property calculator.
 VolumeFraction (const VolumeFraction &)=delete
 Deleted copy constructor (due to reference member).
 VolumeFraction (VolumeFraction &&)=delete
 Deleted move constructor.
virtual ~VolumeFraction ()=default
 Default virtual destructor (safer if inherited from).

Detailed Description

Computes the volume fraction of a specific phase within an amrex::iMultiFab.

This class takes a reference to an integer MultiFab containing phase information (where phases are indicated by integer values) and provides a method to calculate the volume fraction of a specified phase.

Note
The calculation uses the valid regions of the input iMultiFab; ghost cells are ignored.
Warning
The user must ensure the iMultiFab passed to the constructor remains valid for the entire lifetime of the VolumeFraction object, as only a reference is stored.

Constructor & Destructor Documentation

◆ VolumeFraction() [1/3]

OpenImpala::VolumeFraction::VolumeFraction ( const amrex::iMultiFab & fm,
const int phase = 0,
int comp = 0 )
explicit

Constructs a new VolumeFraction property calculator.

This constructor creates a VolumeFraction object linked to the provided phase data. The constructor itself performs minimal work.

Parameters
fmThe amrex::iMultiFab containing the phase information. Must remain valid for the lifetime of this object.
phaseThe integer ID of the phase to calculate the volume fraction for.
compThe component index within 'fm' containing the phase IDs (default: 0).

◆ VolumeFraction() [2/3]

OpenImpala::VolumeFraction::VolumeFraction ( const VolumeFraction & )
delete

Deleted copy constructor (due to reference member).

◆ VolumeFraction() [3/3]

OpenImpala::VolumeFraction::VolumeFraction ( VolumeFraction && )
delete

Deleted move constructor.

◆ ~VolumeFraction()

virtual OpenImpala::VolumeFraction::~VolumeFraction ( )
virtualdefault

Default virtual destructor (safer if inherited from).

Member Function Documentation

◆ operator=() [1/2]

VolumeFraction & OpenImpala::VolumeFraction::operator= ( const VolumeFraction & )
delete

Deleted copy assignment operator (due to reference member).

◆ operator=() [2/2]

VolumeFraction & OpenImpala::VolumeFraction::operator= ( VolumeFraction && )
delete

Deleted move assignment operator.

◆ value()

void OpenImpala::VolumeFraction::value ( long long & phase_count,
long long & total_count,
bool local = false ) const

Computes the count of the specified phase and the total cell count.

Iterates over the valid cells of the stored iMultiFab, counts cells matching the specified phase ID, and counts the total number of valid cells. Performs parallel reduction across MPI ranks unless 'local' is true. This operation can be costly depending on the grid size.

Parameters
[out]phase_countThe number of cells belonging to the specified phase (local or global).
[out]total_countThe total number of cells considered (local or global).
[in]localIf true, compute counts using only data local to the current MPI rank (skips MPI reduction). If false (default), compute the global counts across all ranks.

◆ value_vf()

amrex::Real OpenImpala::VolumeFraction::value_vf ( bool local = false) const
inline

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