OpenImpala
Image-based parallel transport property solver
Loading...
Searching...
No Matches
VolumeFraction.H
Go to the documentation of this file.
1
4#ifndef OPENIMPALA_VOLUME_FRACTION_H // Using project-specific guard
5#define OPENIMPALA_VOLUME_FRACTION_H
6
7#include <AMReX_iMultiFab.H>
8#include <AMReX.H>
9#include <AMReX_REAL.H> // Include for amrex::Real
10
11namespace OpenImpala // Add appropriate namespace
12{
25public:
37 explicit VolumeFraction(const amrex::iMultiFab& fm, const int phase = 0, int comp = 0);
38
39 // --- Rule of Five/Six: Prevent copying, allow default move/destruction ---
40
43
46
49
52
54 virtual ~VolumeFraction() = default;
55
56 // --- Computation Method ---
57
73 void value(long long& phase_count, long long& total_count, bool local = false) const;
74
75 // --- Optional: Convenience method to get VF directly ---
76 amrex::Real value_vf(bool local = false) const {
77 long long pc, tc;
78 value(pc, tc, local); // Call the method that returns counts
79 return (tc > 0) ? static_cast<amrex::Real>(pc) / static_cast<amrex::Real>(tc) : 0.0;
80 }
81
82private:
84 const amrex::iMultiFab& m_mf;
85
87 const int m_phase;
88
90 const int m_comp;
91
92 // Note: Constructor implementation (in .cpp or inline if desired) MUST use
93 // an initializer list:
94 // VolumeFraction::VolumeFraction(...) : m_mf(fm), m_phase(phase), m_comp(comp) {}
95};
96
97} // namespace OpenImpala
98
99#endif // OPENIMPALA_VOLUME_FRACTION_H
VolumeFraction(const amrex::iMultiFab &fm, const int phase=0, int comp=0)
Constructs a new VolumeFraction property calculator.
Definition VolumeFraction.cpp:12
virtual ~VolumeFraction()=default
Default virtual destructor (safer if inherited from).
VolumeFraction(VolumeFraction &&)=delete
Deleted move constructor.
amrex::Real value_vf(bool local=false) const
Definition VolumeFraction.H:76
VolumeFraction & operator=(const VolumeFraction &)=delete
Deleted copy assignment operator (due to reference member).
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.
Definition VolumeFraction.cpp:18
VolumeFraction(const VolumeFraction &)=delete
Deleted copy constructor (due to reference member).
VolumeFraction & operator=(VolumeFraction &&)=delete
Deleted move assignment operator.
Definition CathodeWrite.cpp:12