Skip to content

Commit c5bbf80

Browse files
committed
[oneD] Prevent compiler warning
1 parent fa864d1 commit c5bbf80

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

include/cantera/oneD/Flow1D.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,12 @@ class Flow1D : public Domain1D
480480
virtual void evalElectricField(double* x, double* rsd, int* diag,
481481
double rdt, size_t jmin, size_t jmax);
482482

483+
//! Alternate version of evalContinuity with legacy signature.
484+
//! Implemented by StFlow; included here to prevent compiler warnings about shadowed
485+
//! virtual functions.
486+
//! @deprecated To be removed after Cantera 3.0.
487+
virtual void evalContinuity(size_t j, double* x, double* r, int* diag, double rdt);
488+
483489
/**
484490
* Update the thermodynamic properties from point j0 to point j1
485491
* (inclusive), based on solution x.

include/cantera/oneD/StFlow.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ class StFlow : public Flow1D
4343
//! Evaluate all residual components at the right boundary.
4444
virtual void evalRightBoundary(double* x, double* res, int* diag, double rdt);
4545

46-
//! Evaluate the residual corresponding to the continuity equation at all
47-
//! interior grid points.
48-
virtual void evalContinuity(size_t j, double* x, double* r, int* diag, double rdt);
46+
void evalContinuity(size_t j, double* x, double* r, int* diag, double rdt) override;
4947

5048
protected:
5149
double wdot(size_t k, size_t j) const {

src/oneD/Flow1D.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,12 @@ void Flow1D::evalElectricField(double* x, double* rsd, int* diag,
616616
}
617617
}
618618

619+
void Flow1D::evalContinuity(size_t j, double* x, double* rsd, int* diag, double rdt)
620+
{
621+
throw CanteraError("Flow1D::evalContinuity",
622+
"Overloaded by StFlow; to be removed after Cantera 3.0");
623+
}
624+
619625
void Flow1D::updateTransport(double* x, size_t j0, size_t j1)
620626
{
621627
if (m_do_multicomponent) {

0 commit comments

Comments
 (0)