STYLE: noexcept for nullObject functions

STYLE: use nullObject for return values of NotImplemented

STYLE: shallowCopy(nullptr) shortcut
This commit is contained in:
Mark Olesen
2024-01-25 10:02:52 +01:00
parent 0bf39691ff
commit 182afc27ba
54 changed files with 170 additions and 224 deletions

View File

@ -135,14 +135,14 @@ public:
virtual volScalarField& he()
{
NotImplemented;
return thermo1_->he();
return const_cast<volScalarField&>(volScalarField::null());
}
//- Enthalpy/Internal energy [J/kg]
virtual const volScalarField& he() const
{
NotImplemented;
return thermo1_->he();
return volScalarField::null();
}
//- Enthalpy/Internal energy
@ -213,7 +213,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
return nullptr;
}
//- Heat capacity at constant volume [J/kg/K]
@ -236,7 +236,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
return nullptr;
}
//- Gamma = Cp/Cv []

View File

@ -243,14 +243,14 @@ public:
virtual volScalarField& he()
{
NotImplemented;
return phases_[0].thermo().he();
return const_cast<volScalarField&>(volScalarField::null());
}
//- Enthalpy/Internal energy [J/kg]
virtual const volScalarField& he() const
{
NotImplemented;
return phases_[0].thermo().he();
return volScalarField::null();
}
//- Enthalpy/Internal energy
@ -327,7 +327,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
return nullptr;
}
//- Heat capacity at constant volume [J/kg/K]
@ -350,7 +350,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
return nullptr;
}
//- Gamma = Cp/Cv []

View File

@ -86,14 +86,14 @@ public:
virtual volScalarField& he()
{
NotImplemented;
return p();
return const_cast<volScalarField&>(volScalarField::null());
}
//- Return access to the internal energy field [J/Kg]
virtual const volScalarField& he() const
{
NotImplemented;
return p();
return volScalarField::null();
}
//- Enthalpy/Internal energy
@ -182,7 +182,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
return nullptr;
}
//- Return Cv of the mixture
@ -205,7 +205,7 @@ public:
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
return nullptr;
}
//- Gamma = Cp/Cv []