mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move allocation of MICP data into MICPContainer
This commit is contained in:
parent
012141b281
commit
3f94ace151
@ -1036,11 +1036,7 @@ doAllocBuffers(const unsigned bufferSize,
|
||||
}
|
||||
|
||||
if (enableMICP_) {
|
||||
micpC_.cMicrobes_.resize(bufferSize, 0.0);
|
||||
micpC_.cOxygen_.resize(bufferSize, 0.0);
|
||||
micpC_.cUrea_.resize(bufferSize, 0.0);
|
||||
micpC_.cBiofilm_.resize(bufferSize, 0.0);
|
||||
micpC_.cCalcite_.resize(bufferSize, 0.0);
|
||||
this->micpC_.allocate(bufferSize);
|
||||
}
|
||||
|
||||
if (vapparsActive) {
|
||||
|
@ -25,6 +25,19 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
template<class Scalar>
|
||||
void MICPContainer<Scalar>::
|
||||
allocate(const unsigned bufferSize)
|
||||
{
|
||||
cMicrobes_.resize(bufferSize, 0.0);
|
||||
cOxygen_.resize(bufferSize, 0.0);
|
||||
cUrea_.resize(bufferSize, 0.0);
|
||||
cBiofilm_.resize(bufferSize, 0.0);
|
||||
cCalcite_.resize(bufferSize, 0.0);
|
||||
|
||||
allocated_ = true;
|
||||
}
|
||||
|
||||
template class MICPContainer<double>;
|
||||
|
||||
#if FLOW_INSTANTIATE_FLOAT
|
||||
|
@ -36,6 +36,11 @@ class MICPContainer
|
||||
using ScalarBuffer = std::vector<Scalar>;
|
||||
|
||||
public:
|
||||
void allocate(const unsigned bufferSize);
|
||||
|
||||
bool allocated() const
|
||||
{ return allocated_; }
|
||||
|
||||
Scalar getMicrobialConcentration(unsigned elemIdx) const
|
||||
{
|
||||
if (cMicrobes_.size() > elemIdx)
|
||||
@ -76,6 +81,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool allocated_ = false;
|
||||
ScalarBuffer cMicrobes_;
|
||||
ScalarBuffer cOxygen_;
|
||||
ScalarBuffer cUrea_;
|
||||
|
Loading…
Reference in New Issue
Block a user