Skip to content

Commit

Permalink
[Coupling] Added calling of setLocalAccessibleVector for coupled solu…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
wenqing committed Jun 9, 2017
1 parent a8d7c71 commit 7a87285
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
1 change: 0 additions & 1 deletion ProcessLib/HeatConduction/HeatConductionProcess.cpp
Expand Up @@ -49,7 +49,6 @@ void HeatConductionProcess::preTimestepConcreteProcess(GlobalVector const& x,
}

auto& x0 = *_x_previous_timestep;
MathLib::LinAlg::setLocalAccessibleVector(x0);
}

void HeatConductionProcess::initializeConcreteProcess(
Expand Down
30 changes: 30 additions & 0 deletions ProcessLib/StaggeredCouplingTerm.cpp
Expand Up @@ -11,10 +11,40 @@
*/

#include "StaggeredCouplingTerm.h"

#include "MathLib/LinAlg/LinAlg.h"
#include "Process.h"

namespace ProcessLib
{

StaggeredCouplingTerm::StaggeredCouplingTerm(
std::unordered_map<std::type_index, Process const&> const&
coupled_processes_,
std::unordered_map<std::type_index, GlobalVector const&> const& coupled_xs_,
const double dt_, const bool empty_)
: coupled_processes(coupled_processes_),
coupled_xs(coupled_xs_),
dt(dt_),
empty(empty_)
{
for (auto const& coupled_x_pair : coupled_xs)
{
auto const& coupled_x = coupled_x_pair.second;
MathLib::LinAlg::setLocalAccessibleVector(coupled_x);
}

for (auto const& coupled_process_pair : coupled_processes)
{
auto const& coupled_pcs = coupled_process_pair.second;
auto const prevous_time_x = coupled_pcs.getPreviousTimeStepSolution();
if (prevous_time_x)
{
MathLib::LinAlg::setLocalAccessibleVector(*prevous_time_x);
}
}
}

const StaggeredCouplingTerm createVoidStaggeredCouplingTerm()
{
std::unordered_map<std::type_index, Process const&> coupled_processes;
Expand Down
8 changes: 1 addition & 7 deletions ProcessLib/StaggeredCouplingTerm.h
Expand Up @@ -36,13 +36,7 @@ struct StaggeredCouplingTerm
coupled_processes_,
std::unordered_map<std::type_index, GlobalVector const&> const&
coupled_xs_,
const double dt_, const bool empty_ = false)
: coupled_processes(coupled_processes_),
coupled_xs(coupled_xs_),
dt(dt_),
empty(empty_)
{
}
const double dt_, const bool empty_ = false);

/// References to the coupled processes are distinguished by the keys of
/// process types.
Expand Down

0 comments on commit 7a87285

Please sign in to comment.