only allocate trans_ for globalTrans_

others are not needed for globalTrans_ for now. It will help to flatten
the peak memory usage for rank 0 during a parallel running.
This commit is contained in:
Kai Bao
2024-06-04 11:25:24 +02:00
parent 4cf8a50b26
commit 303a677a81
5 changed files with 31 additions and 17 deletions

View File

@@ -128,7 +128,7 @@ public:
*/
void finishInit(const std::function<unsigned int(unsigned int)>& map = {})
{
this->update(true, map, /*applyNncMultRegT = */ true);
this->update(true, false, map, /*applyNncMultRegT = */ true);
}
/*!
@@ -138,6 +138,11 @@ public:
* processes. Also, this updates the "thermal half
* transmissibilities" if energy is enabled.
*
* \param[in] onlyTrans Whether we only allocate and upate trans_ without considering
* thermalHalfTrans_, diffusivity_, dispersivity_. For many usage, we only need trans_,
* e.g. weights for domain decomposition, INIT file output. It might change following
* further development.
*
* \param[in] map Undocumented.
*
* \param[in] applyNncMultRegT Whether or not to apply regional
@@ -147,7 +152,7 @@ public:
* numerical aquifers. Default value: \c false, meaning do not apply
* regional multipliers to explicit NNCs.
*/
void update(bool global, const std::function<unsigned int(unsigned int)>& map = {}, bool applyNncMultRegT = false);
void update(bool global, bool onlyTrans = false, const std::function<unsigned int(unsigned int)>& map = {}, bool applyNncMultRegT = false);
protected:
void updateFromEclState_(bool global);