Computes the volume fraction of a specific phase within an amrex::iMultiFab.
More...
#include <VolumeFraction.H>
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.
◆ 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
-
| fm | The amrex::iMultiFab containing the phase information. Must remain valid for the lifetime of this object. |
| phase | The integer ID of the phase to calculate the volume fraction for. |
| comp | The 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).
◆ operator=() [1/2]
Deleted copy assignment operator (due to reference member).
◆ operator=() [2/2]
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_count | The number of cells belonging to the specified phase (local or global). |
| [out] | total_count | The total number of cells considered (local or global). |
| [in] | local | If 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: