mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
FlowExp: spring cleaning
This commit is contained in:
@@ -1,32 +1,38 @@
|
||||
#ifndef OPM_FI_BLACK_OIL_MODEL_NOCACHE_HPP
|
||||
#define OPM_FI_BLACK_OIL_MODEL_NOCACHE_HPP
|
||||
|
||||
#include <opm/simulators/flow/FIBlackoilModel.hpp>
|
||||
namespace Opm{
|
||||
template<typename TypeTag>
|
||||
class FIBlackOilModelNoCache: public FIBlackOilModel<TypeTag>{
|
||||
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
||||
using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>;
|
||||
public:
|
||||
explicit FIBlackOilModelNoCache(Simulator& simulator)
|
||||
:FIBlackOilModel<TypeTag>(simulator)
|
||||
{ }
|
||||
|
||||
IntensiveQuantities intensiveQuantities(unsigned globalIdx, unsigned timeIdx) const{
|
||||
OPM_TIMEBLOCK_LOCAL(intensiveQuantitiesNoCache);
|
||||
const auto& primaryVar = this->solution(timeIdx)[globalIdx];
|
||||
const auto& problem = this->simulator_.problem();
|
||||
if (!(this->enableIntensiveQuantityCache_) ||
|
||||
!(this->intensiveQuantityCacheUpToDate_[timeIdx][globalIdx])){
|
||||
IntensiveQuantities intQuants;
|
||||
intQuants.update(problem,primaryVar, globalIdx, timeIdx);
|
||||
return intQuants;// reqiored for updating extrution factor
|
||||
}else{
|
||||
IntensiveQuantities intQuants = (this->intensiveQuantityCache_[timeIdx][globalIdx]);
|
||||
return intQuants;
|
||||
}
|
||||
namespace Opm {
|
||||
|
||||
template<typename TypeTag>
|
||||
class FIBlackOilModelNoCache: public FIBlackOilModel<TypeTag>
|
||||
{
|
||||
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
||||
using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>;
|
||||
|
||||
public:
|
||||
explicit FIBlackOilModelNoCache(Simulator& simulator)
|
||||
: FIBlackOilModel<TypeTag>(simulator)
|
||||
{}
|
||||
|
||||
IntensiveQuantities intensiveQuantities(unsigned globalIdx, unsigned timeIdx) const
|
||||
{
|
||||
OPM_TIMEBLOCK_LOCAL(intensiveQuantitiesNoCache);
|
||||
const auto& primaryVar = this->solution(timeIdx)[globalIdx];
|
||||
const auto& problem = this->simulator_.problem();
|
||||
if (!(this->enableIntensiveQuantityCache_) ||
|
||||
!(this->intensiveQuantityCacheUpToDate_[timeIdx][globalIdx])) {
|
||||
IntensiveQuantities intQuants;
|
||||
intQuants.update(problem,primaryVar, globalIdx, timeIdx);
|
||||
return intQuants;// reqiored for updating extrution factor
|
||||
} else {
|
||||
IntensiveQuantities intQuants = (this->intensiveQuantityCache_[timeIdx][globalIdx]);
|
||||
return intQuants;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user