Opm::Valgrind Namespace Reference

Functions

bool IsRunning ()
 Returns whether the program is running under Valgrind or not. More...
 
template<class T >
bool CheckDefined (const T &value)
 Make valgrind complain if any of the memory occupied by an object is undefined. More...
 
template<class T >
bool CheckAddressable (const T &value)
 Make valgrind complain if any of the memory occupied by an object is not addressable. More...
 
template<class T >
bool CheckDefined (const T *value, int size)
 Make valgrind complain if any of the the memory occupied by a C-style array objects is undefined. More...
 
template<class T >
void SetUndefined (const T &value)
 Make the memory on which an object resides undefined in valgrind runs. More...
 
template<class T >
void SetUndefined (const T *value, int size)
 Make the memory on which an array of object resides undefined in valgrind runs. More...
 
template<class T >
void SetDefined (const T &value)
 Make the memory on which an object resides defined. More...
 
template<class T >
void SetDefined (const T *value, int n)
 Make the memory on which a C-style array of objects resides defined. More...
 
template<class T >
void SetNoAccess (const T &value)
 Make valgrind complain if an object's memory is accessed. More...
 
template<class T >
void SetNoAccess (const T *value, int size)
 Make valgrind complain if the memory of a C-style array of objects is accessed. More...
 

Function Documentation

◆ CheckAddressable()

template<class T >
bool Opm::Valgrind::CheckAddressable ( const T &  value)
inline

Make valgrind complain if any of the memory occupied by an object is not addressable.

Example:

int* i = NULL;
Valgrind::CheckAddressable(*i); // Valgrind complains!
bool CheckAddressable(const T &value)
Make valgrind complain if any of the memory occupied by an object is not addressable.
Definition: Valgrind.hpp:106
Template Parameters
TThe type of the object which ought to be checked
Parameters
valuethe object which valgrind should check
Returns
true iff there are no unadressable bytes in the memory occupied by the object.

◆ CheckDefined() [1/2]

template<class T >
bool Opm::Valgrind::CheckDefined ( const T &  value)
inline

Make valgrind complain if any of the memory occupied by an object is undefined.

Please note that this does not check whether the destinations of an object's pointers or references are defined. Also, for performance reasons the compiler might insert "padding bytes" between within the objects which leads to false positives.

Example:

int i;
Valgrind::CheckDefined(i); // Valgrind complains!
bool CheckDefined(const T &value)
Make valgrind complain if any of the memory occupied by an object is undefined.
Definition: Valgrind.hpp:74
Template Parameters
TThe type of the object which ought to be checked
Parameters
valuethe object which valgrind should check
Returns
true iff there are no undefined bytes in the memory occupied by the object.

Referenced by Opm::EclDefaultMaterial< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::capillaryPressures(), Opm::EclStone1Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::capillaryPressures(), Opm::EclStone2Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::capillaryPressures(), Opm::LinearMaterial< TraitsT, ParamsT >::capillaryPressures(), Opm::PengRobinsonParams< Scalar >::checkDefined(), Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, phaseIdx, useSpe5Relations >::checkDefined(), Opm::ThreePhaseParkerVanGenuchtenParams< TraitsT >::checkDefined(), Opm::BlackOilFluidState< ScalarT, FluidSystem, enableTemperature, enableEnergy, enableDissolution, enableEvaporation, enableBrine, enableSaltPrecipitation, numStoragePhases >::checkDefined(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, Implementation >::checkDefined(), Opm::FluidStateExplicitDensityModule< Scalar, numPhases, Implementation >::checkDefined(), Opm::FluidStateExplicitEnthalpyModule< Scalar, numPhases, Implementation >::checkDefined(), Opm::FluidStateExplicitFugacityModule< Scalar, numPhases, numComponents, Implementation >::checkDefined(), Opm::FluidStateImmiscibleFugacityModule< Scalar, numPhases, numComponents, Implementation >::checkDefined(), Opm::FluidStateExplicitPressureModule< Scalar, numPhases, Implementation >::checkDefined(), Opm::FluidStateExplicitSaturationModule< Scalar, numPhases, Implementation >::checkDefined(), Opm::FluidStateExplicitTemperatureModule< Scalar, numPhases, Implementation >::checkDefined(), Opm::FluidStateEquilibriumTemperatureModule< Scalar, numPhases, Implementation >::checkDefined(), Opm::FluidStateExplicitViscosityModule< Scalar, numPhases, Implementation >::checkDefined(), Opm::PressureOverlayFluidState< FluidState >::checkDefined(), Opm::SaturationOverlayFluidState< FluidState >::checkDefined(), Opm::TemperatureOverlayFluidState< FluidState >::checkDefined(), Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, numDerivs, staticSize >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 1 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 10 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 11 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 12 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 2 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 3 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 4 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 5 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 6 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 7 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 8 >::checkDefined_(), Opm::DenseAd::Evaluation< ValueT, 9 >::checkDefined_(), Opm::PengRobinson< Scalar >::computeMolarVolume(), Opm::BrineCO2FluidSystem< Scalar, CO2Tables >::density(), Opm::BrineCO2FluidSystem< Scalar, CO2Tables >::enthalpy(), Opm::H2OAirFluidSystem< Scalar, H2Otype >::enthalpy(), Opm::H2ON2FluidSystem< Scalar >::enthalpy(), Opm::H2ON2LiquidPhaseFluidSystem< Scalar >::enthalpy(), Opm::IntervalTabulated2DFunction< Scalar >::eval(), Opm::UniformXTabulated2DFunction< Scalar >::eval(), Opm::H2OAirMesityleneFluidSystem< Scalar >::fugacityCoefficient(), Opm::BinaryCoeff::Brine_CO2< Scalar, H2O, CO2, verbose >::fugacityCoefficientCO2(), Opm::EclDefaultMaterial< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::gasOilHysteresisParams(), Opm::EclStone1Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::gasOilHysteresisParams(), Opm::EclStone2Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::gasOilHysteresisParams(), Opm::EclTwoPhaseMaterial< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, GasWaterMaterialLawT, ParamsT >::gasOilHysteresisParams(), Opm::H2O< Scalar >::gasPressure(), Opm::EclDefaultMaterial< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::oilWaterHysteresisParams(), Opm::EclStone1Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::oilWaterHysteresisParams(), Opm::EclStone2Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::oilWaterHysteresisParams(), Opm::EclTwoPhaseMaterial< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, GasWaterMaterialLawT, ParamsT >::oilWaterHysteresisParams(), Opm::LinearMaterial< TraitsT, ParamsT >::pcgn(), Opm::EclStone1Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::pcnw(), Opm::EclStone2Material< TraitsT, GasOilMaterialLawT, OilWaterMaterialLawT, ParamsT >::pcnw(), Opm::LinearMaterial< TraitsT, ParamsT >::pcnw(), Opm::LinearMaterial< TraitsT, ParamsT >::relativePermeabilities(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, Implementation >::setCompressFactor(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, Implementation >::setMoleFraction(), Opm::NcpFlash< Scalar, FluidSystem >::setQuantity_(), Opm::ImmiscibleFlash< Scalar, FluidSystem >::solve(), Opm::NcpFlash< Scalar, FluidSystem >::solve(), Opm::CompositionFromFugacities< Scalar, FluidSystem, Evaluation >::solve(), Opm::CompositionFromFugacities< Scalar, FluidSystem, Evaluation >::solveIdealMix_(), Opm::SomertonThermalConductionLaw< FluidSystem, ScalarT, ParamsT >::thermalConductivity(), Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, phaseIdx, useSpe5Relations >::updateMix(), Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateMix_(), Opm::Spe5ParameterCache< Scalar, FluidSystem >::updateMix_(), Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, phaseIdx, useSpe5Relations >::updatePure(), and Opm::BrineCO2FluidSystem< Scalar, CO2Tables >::viscosity().

◆ CheckDefined() [2/2]

template<class T >
bool Opm::Valgrind::CheckDefined ( const T *  value,
int  size 
)
inline

Make valgrind complain if any of the the memory occupied by a C-style array objects is undefined.

Please note that this does not check whether the destinations of an object's pointers or references are defined. Also, for performance reasons the compiler might insert "padding bytes" between within the objects which leads to false positives.

Example:

int i[2];
Valgrind::CheckDefined(i, 2); // Valgrind complains!
Template Parameters
TThe type of the object which ought to be checked
Parameters
valuePointer to the first object of the array.
sizeThe size of the array in number of objects
Returns
true iff there are no undefined bytes in the memory occupied by the array.

◆ IsRunning()

bool Opm::Valgrind::IsRunning ( )
inline

Returns whether the program is running under Valgrind or not.

◆ SetDefined() [1/2]

template<class T >
void Opm::Valgrind::SetDefined ( const T &  value)
inline

Make the memory on which an object resides defined.

Example:

int i;
Valgrind::CheckDefined(i); // Valgrind does not complain!
void SetDefined(const T &value)
Make the memory on which an object resides defined.
Definition: Valgrind.hpp:222
Template Parameters
TThe type of the object which valgrind should consider as defined
Parameters
valueThe object which's memory valgrind should consider as defined

Referenced by Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, Implementation >::FluidStateExplicitCompositionModule().

◆ SetDefined() [2/2]

template<class T >
void Opm::Valgrind::SetDefined ( const T *  value,
int  n 
)
inline

Make the memory on which a C-style array of objects resides defined.

Example:

int i[3];
Valgrind::CheckDefined(i, 3); // Valgrind does not complain!
Template Parameters
TThe type of the object which valgrind should consider as defined
Parameters
valuePointer to the first object of the array.
nThe size of the array in number of objects

◆ SetNoAccess() [1/2]

template<class T >
void Opm::Valgrind::SetNoAccess ( const T &  value)
inline

Make valgrind complain if an object's memory is accessed.

Example:

int i = 1;
int j = i; // Valgrind complains!
void SetNoAccess(const T &value)
Make valgrind complain if an object's memory is accessed.
Definition: Valgrind.hpp:273
Template Parameters
TThe type of the object which valgrind should complain if accessed
Parameters
valueThe object which's memory valgrind should complain if accessed

◆ SetNoAccess() [2/2]

template<class T >
void Opm::Valgrind::SetNoAccess ( const T *  value,
int  size 
)
inline

Make valgrind complain if the memory of a C-style array of objects is accessed.

Example:

int i[3] = {0, 1, 2};
int j = i[1]; // Valgrind complains!
Parameters
valuePointer to the first object of the array.
sizeThe size of the array in number of objects

◆ SetUndefined() [1/2]

template<class T >
void Opm::Valgrind::SetUndefined ( const T &  value)
inline

Make the memory on which an object resides undefined in valgrind runs.

Example:

int i = 0;
Valgrind::CheckDefined(i); // Valgrind complains!
void SetUndefined(const T &value)
Make the memory on which an object resides undefined in valgrind runs.
Definition: Valgrind.hpp:171
Template Parameters
TThe type of the object which ought to be set to undefined
Parameters
valueThe object which's memory valgrind should be told is undefined

Referenced by Opm::BrooksCoreyParams< TraitsT >::BrooksCoreyParams(), Opm::PengRobinson< Scalar >::computeMolarVolume(), Opm::H2OAirFluidSystem< Scalar, H2Otype >::density(), Opm::FluidStateNullEnthalpyModule< Scalar, numPhases, Implementation >::enthalpy(), Opm::FluidStateEquilibriumTemperatureModule< Scalar, numPhases, Implementation >::FluidStateEquilibriumTemperatureModule(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, Implementation >::FluidStateExplicitCompositionModule(), Opm::FluidStateExplicitDensityModule< Scalar, numPhases, Implementation >::FluidStateExplicitDensityModule(), Opm::FluidStateExplicitEnthalpyModule< Scalar, numPhases, Implementation >::FluidStateExplicitEnthalpyModule(), Opm::FluidStateExplicitFugacityModule< Scalar, numPhases, numComponents, Implementation >::FluidStateExplicitFugacityModule(), Opm::FluidStateExplicitPressureModule< Scalar, numPhases, Implementation >::FluidStateExplicitPressureModule(), Opm::FluidStateExplicitSaturationModule< Scalar, numPhases, Implementation >::FluidStateExplicitSaturationModule(), Opm::FluidStateExplicitTemperatureModule< Scalar, numPhases, Implementation >::FluidStateExplicitTemperatureModule(), Opm::FluidStateExplicitViscosityModule< Scalar, numPhases, Implementation >::FluidStateExplicitViscosityModule(), Opm::FluidStateImmiscibleFugacityModule< Scalar, numPhases, numComponents, Implementation >::FluidStateImmiscibleFugacityModule(), Opm::FluidStateNullEnthalpyModule< Scalar, numPhases, Implementation >::internalEnergy(), Opm::PTFlashParameterCache< Scalar, FluidSystem >::PTFlashParameterCache(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, Implementation >::setMoleFraction(), Opm::ImmiscibleFlash< Scalar, FluidSystem >::solve(), Opm::NcpFlash< Scalar, FluidSystem >::solve(), Opm::Spe5ParameterCache< Scalar, FluidSystem >::Spe5ParameterCache(), and Opm::TwoPhaseLETCurvesParams< TraitsT >::TwoPhaseLETCurvesParams().

◆ SetUndefined() [2/2]

template<class T >
void Opm::Valgrind::SetUndefined ( const T *  value,
int  size 
)
inline

Make the memory on which an array of object resides undefined in valgrind runs.

Example:

int i[3] = {0, 1, 3};
Valgrind::CheckDefined(i, 3); // Valgrind complains!
Template Parameters
TThe type of the object which ought to be set to undefined
Parameters
valuePointer to the first object of the array.
sizeThe size of the array in number of objects