Skip to content
Snippets Groups Projects
Commit 76f1ac2c authored by renchao.lu's avatar renchao.lu
Browse files

[PL/BC] Tackle boundary condition in the postTimeStep.

parent 86e72910
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,13 @@ public: ...@@ -62,6 +62,13 @@ public:
// A hook added for solution dependent dirichlet // A hook added for solution dependent dirichlet
} }
virtual void postTimestep(const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
int const /*process_id*/)
{
// A hook added for solution dependent dirichlet
}
virtual ~BoundaryCondition() = default; virtual ~BoundaryCondition() = default;
}; };
......
...@@ -63,6 +63,15 @@ public: ...@@ -63,6 +63,15 @@ public:
} }
} }
void postTimestep(const double t, std::vector<GlobalVector*> const& x,
int const process_id)
{
for (auto const& bc_ptr : _boundary_conditions)
{
bc_ptr->postTimestep(t, x, process_id);
}
}
private: private:
mutable std::vector<NumLib::IndexValueVector<GlobalIndexType>> _dirichlet_bcs; mutable std::vector<NumLib::IndexValueVector<GlobalIndexType>> _dirichlet_bcs;
std::vector<std::unique_ptr<BoundaryCondition>> _boundary_conditions; std::vector<std::unique_ptr<BoundaryCondition>> _boundary_conditions;
......
...@@ -384,6 +384,8 @@ void Process::postTimestep(std::vector<GlobalVector*> const& x, const double t, ...@@ -384,6 +384,8 @@ void Process::postTimestep(std::vector<GlobalVector*> const& x, const double t,
for (auto* const solution : x) for (auto* const solution : x)
MathLib::LinAlg::setLocalAccessibleVector(*solution); MathLib::LinAlg::setLocalAccessibleVector(*solution);
postTimestepConcreteProcess(x, t, delta_t, process_id); postTimestepConcreteProcess(x, t, delta_t, process_id);
_boundary_conditions[process_id].postTimestep(t, x, process_id);
} }
void Process::postNonLinearSolver(GlobalVector const& x, const double t, void Process::postNonLinearSolver(GlobalVector const& x, const double t,
......
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