Skip to content
Snippets Groups Projects
Commit e1dad8c5 authored by wenqing's avatar wenqing
Browse files

[Coupling] Made CoupledSolutionsOfPreviousTimeStep be local accessible (for PETSc)

 and added a OGS_FATAL checking for the global vector of the solution of
 the previous time step
parent e910a895
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,6 @@
*
*/
#include <bits/stl_vector.h>
#include "Process.h"
#include "BaseLib/Functional.h"
......@@ -351,8 +349,19 @@ void Process::setCoupledSolutionsOfPreviousTimeStep()
_coupled_solutions->coupled_xs_t0.reserve(number_of_coupled_solutions);
for (std::size_t i = 0; i < number_of_coupled_solutions; i++)
{
_coupled_solutions->coupled_xs_t0.emplace_back(
getPreviousTimeStepSolution(i));
const auto x_t0 = getPreviousTimeStepSolution(i);
if (!x_t0)
{
OGS_FATAL(
"Memory is not allocated for the global vector "
"of the solution of the previous time step for the ."
"staggered scheme.\n It can be done by overloading "
"Process::preTimestepConcreteProcess"
"(ref. HTProcess::preTimestepConcreteProcess) ");
}
MathLib::LinAlg::setLocalAccessibleVector(*x_t0);
_coupled_solutions->coupled_xs_t0.emplace_back(x_t0);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment