diff --git a/ProcessLib/BoundaryCondition/BoundaryCondition.h b/ProcessLib/BoundaryCondition/BoundaryCondition.h index e68e43a8ea3f9ffcef2dda213e98b4be9e6e34f2..a654c57659168f5c3447bae767c4e3c55e3f0cda 100644 --- a/ProcessLib/BoundaryCondition/BoundaryCondition.h +++ b/ProcessLib/BoundaryCondition/BoundaryCondition.h @@ -62,6 +62,11 @@ public: // Therefore there is nothing to do here. } + virtual void preTimestep(const double /*t*/, GlobalVector const& /*x*/) + { + // A hook added for solution dependent dirichlet + } + virtual ~BoundaryCondition() = default; }; diff --git a/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h b/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h index 42aec640e3fdd9072e9d1216b5a16705586f2d1c..679f76579600208e9c06ea9d56425fb3bfa7ce2d 100644 --- a/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h +++ b/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h @@ -44,6 +44,14 @@ public: NumLib::LocalToGlobalIndexMap const& dof_table, unsigned const integration_order); + void preTimestep(const double t, GlobalVector const& x) + { + for (auto const& bc_ptr : _boundary_conditions) + { + bc_ptr->preTimestep(t, x); + } + } + private: mutable std::vector<NumLib::IndexValueVector<GlobalIndexType>> _dirichlet_bcs; std::vector<std::unique_ptr<BoundaryCondition>> _boundary_conditions; diff --git a/ProcessLib/Process.cpp b/ProcessLib/Process.cpp index 4647714e169eeeb86e119c127b63cbc16e60408a..9e9d9ab2e7e2b2c6edfcfcc10f40f6fadc56c780 100644 --- a/ProcessLib/Process.cpp +++ b/ProcessLib/Process.cpp @@ -346,6 +346,8 @@ void Process::preTimestep(GlobalVector const& x, const double t, MathLib::LinAlg::setLocalAccessibleVector(x); preTimestepConcreteProcess(x, t, delta_t, process_id); + + _boundary_conditions[process_id].preTimestep(t, x); } void Process::postTimestep(GlobalVector const& x, int const process_id)