From fc70f6666d3703ef8ac0257747d3cbab241abe7f Mon Sep 17 00:00:00 2001 From: CINTROINI Date: Tue, 23 Jun 2026 02:03:14 +0200 Subject: [PATCH 1/6] Transfer time-step from time loop to integrators --- kernel/include/Couplings/Coupling.hpp | 2 +- kernel/include/Couplings/Coupling.tpp | 7 ++- .../Integrators/AllenCahnNLFormIntegrator.hpp | 3 +- .../Integrators/AllenCahnNLFormIntegrator.tpp | 5 +- .../BlockAllenCahnNLFormIntegrator.hpp | 3 +- .../BlockAllenCahnNLFormIntegrator.tpp | 5 +- .../CahnHilliardNLFormIntegrator.hpp | 3 +- .../CahnHilliardNLFormIntegrator.tpp | 5 +- .../DiffusionFluxNLFormIntegrator.hpp | 3 +- .../DiffusionFluxNLFormIntegrator.tpp | 5 +- .../Integrators/DiffusionNLFormIntegrator.hpp | 3 +- .../Integrators/DiffusionNLFormIntegrator.tpp | 5 +- .../Integrators/FickNLFormIntegrator.hpp | 3 +- .../Integrators/FickNLFormIntegrator.tpp | 5 +- .../Integrators/FourierNLFormIntegrator.hpp | 3 +- .../Integrators/FourierNLFormIntegrator.tpp | 5 +- .../Integrators/HeatTimeNLFormIntegrator.hpp | 3 +- .../Integrators/HeatTimeNLFormIntegrator.tpp | 5 +- .../LatentHeatNLFormIntegrator.hpp | 4 +- .../LatentHeatNLFormIntegrator.tpp | 8 +-- .../MassDiffusionFluxNLFormIntegrator.hpp | 2 +- .../MassDiffusionFluxNLFormIntegrator.tpp | 5 +- .../MeltingBaseNLFormIntegrator.hpp | 3 +- .../MeltingBaseNLFormIntegrator.tpp | 5 +- .../MeltingCalphadNLFormIntegrator.hpp | 3 +- .../MeltingCalphadNLFormIntegrator.tpp | 5 +- .../MeltingConstantNLFormIntegrator.hpp | 2 +- .../MeltingConstantNLFormIntegrator.tpp | 5 +- .../MeltingTemperatureNLFormIntegrator.hpp | 2 +- .../MeltingTemperatureNLFormIntegrator.tpp | 5 +- .../Integrators/NeumannNLFormIntegrator.hpp | 3 +- .../Integrators/NeumannNLFormIntegrator.tpp | 6 +- .../Integrators/RobinNLFormIntegrator.hpp | 3 +- .../Integrators/RobinNLFormIntegrator.tpp | 5 +- .../Integrators/SlothNLFormIntegrator.hpp | 5 +- .../Integrators/SlothNLFormIntegrator.tpp | 3 +- .../ThermalDiffusionFluxNLFormIntegrator.hpp | 2 +- .../ThermalDiffusionFluxNLFormIntegrator.tpp | 8 ++- .../Integrators/TimeCHNLFormIntegrator.hpp | 3 +- .../Integrators/TimeCHNLFormIntegrator.tpp | 5 +- .../Integrators/TimeNLFormIntegrator.hpp | 3 +- .../Integrators/TimeNLFormIntegrator.tpp | 5 +- kernel/include/Operators/OperatorBase.hpp | 17 +++--- kernel/include/Operators/OperatorBase.tpp | 59 ++++++++++--------- kernel/include/Operators/SteadyOperator.hpp | 4 +- kernel/include/Operators/SteadyOperator.tpp | 12 ++-- .../include/Operators/TransientOperator.hpp | 14 +++-- .../include/Operators/TransientOperator.tpp | 42 +++++++------ kernel/include/Problems/Calphad_problem.hpp | 2 +- kernel/include/Problems/Calphad_problem.tpp | 3 +- kernel/include/Problems/Problem.hpp | 2 +- kernel/include/Problems/Problem.tpp | 4 +- kernel/include/Problems/ProblemBase.hpp | 3 +- kernel/include/Time/Time.tpp | 4 +- 54 files changed, 194 insertions(+), 145 deletions(-) diff --git a/kernel/include/Couplings/Coupling.hpp b/kernel/include/Couplings/Coupling.hpp index d8b7c041..bdbaa1e7 100644 --- a/kernel/include/Couplings/Coupling.hpp +++ b/kernel/include/Couplings/Coupling.hpp @@ -48,7 +48,7 @@ class Coupling { std::string get_name(); void get_tree(); - void initialize(const int& iter, const double& initial_time); + void initialize(const int& iter, const double& initial_time, const double time_step); void execute(const int& iter, double& next_time, const double& current_time, const double& current_time_step); void update(); diff --git a/kernel/include/Couplings/Coupling.tpp b/kernel/include/Couplings/Coupling.tpp index a52ed343..cb9d85f9 100644 --- a/kernel/include/Couplings/Coupling.tpp +++ b/kernel/include/Couplings/Coupling.tpp @@ -75,10 +75,11 @@ void Coupling::get_tree() { * @param initial_time */ template -void Coupling::initialize(const int& iter, const double& initial_time) { +void Coupling::initialize(const int& iter, const double& initial_time, + const double time_step) { std::apply( - [iter, initial_time](auto&... problem) { - (problem.initialize(initial_time), ...); + [iter, initial_time, time_step](auto&... problem) { + (problem.initialize(initial_time, time_step), ...); (void([&problem, iter, initial_time] { problem.save(iter, initial_time); }()), ...); }, problems_); diff --git a/kernel/include/Integrators/AllenCahnNLFormIntegrator.hpp b/kernel/include/Integrators/AllenCahnNLFormIntegrator.hpp index d97dc869..a11d7052 100644 --- a/kernel/include/Integrators/AllenCahnNLFormIntegrator.hpp +++ b/kernel/include/Integrators/AllenCahnNLFormIntegrator.hpp @@ -72,7 +72,8 @@ class AllenCahnNLFormIntegrator : public SlothNLFormIntegrator { public: void init() override; - AllenCahnNLFormIntegrator(Geometry geometry, const std::vector& u_old, + AllenCahnNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/AllenCahnNLFormIntegrator.tpp b/kernel/include/Integrators/AllenCahnNLFormIntegrator.tpp index ee9286d3..db20f908 100644 --- a/kernel/include/Integrators/AllenCahnNLFormIntegrator.tpp +++ b/kernel/include/Integrators/AllenCahnNLFormIntegrator.tpp @@ -61,10 +61,11 @@ */ template AllenCahnNLFormIntegrator::AllenCahnNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "AllenCahn"; this->check_variables_consistency(); diff --git a/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.hpp b/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.hpp index 5015ed7a..7d40cb87 100644 --- a/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.hpp +++ b/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.hpp @@ -65,7 +65,8 @@ class BlockAllenCahnNLFormIntegrator : public SlothNLFormIntegrator { public: void init() override; - BlockAllenCahnNLFormIntegrator(Geometry geometry, const std::vector& u_old, + BlockAllenCahnNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp b/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp index d7464ca8..880e4343 100644 --- a/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp +++ b/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp @@ -60,10 +60,11 @@ */ template BlockAllenCahnNLFormIntegrator::BlockAllenCahnNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->check_variables_consistency(); } diff --git a/kernel/include/Integrators/CahnHilliardNLFormIntegrator.hpp b/kernel/include/Integrators/CahnHilliardNLFormIntegrator.hpp index 1265d7a3..cd230a32 100644 --- a/kernel/include/Integrators/CahnHilliardNLFormIntegrator.hpp +++ b/kernel/include/Integrators/CahnHilliardNLFormIntegrator.hpp @@ -66,7 +66,8 @@ class CahnHilliardNLFormIntegrator : public SlothNLFormIntegrator { public: void init() override; - CahnHilliardNLFormIntegrator(Geometry geometry, const std::vector& u_old, + CahnHilliardNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp b/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp index 85bab459..101e3917 100644 --- a/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp +++ b/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp @@ -58,10 +58,11 @@ */ template CahnHilliardNLFormIntegrator::CahnHilliardNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "CahnHilliard"; this->check_variables_consistency(); } diff --git a/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.hpp b/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.hpp index 0b3065e0..b6de4b25 100644 --- a/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.hpp +++ b/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.hpp @@ -72,7 +72,8 @@ class DiffusionFluxNLFormIntegrator : public SlothNLFormIntegrator { void init() override; public: - DiffusionFluxNLFormIntegrator(Geometry geometry, const std::vector& u_old, + DiffusionFluxNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp b/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp index b21f80a3..5190d131 100644 --- a/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp +++ b/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp @@ -81,10 +81,11 @@ void DiffusionFluxNLFormIntegrator::get_coefficients() { */ template DiffusionFluxNLFormIntegrator::DiffusionFluxNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->expected_list_.push_back(GlossaryType::Diffusivity); } diff --git a/kernel/include/Integrators/DiffusionNLFormIntegrator.hpp b/kernel/include/Integrators/DiffusionNLFormIntegrator.hpp index 1adbcd3c..bec5470c 100644 --- a/kernel/include/Integrators/DiffusionNLFormIntegrator.hpp +++ b/kernel/include/Integrators/DiffusionNLFormIntegrator.hpp @@ -59,7 +59,8 @@ class DiffusionNLFormIntegrator : public SlothNLFormIntegrator { void init() override; public: - DiffusionNLFormIntegrator(Geometry geometry, const std::vector u_old, + DiffusionNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector u_old, const std::vector aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/DiffusionNLFormIntegrator.tpp b/kernel/include/Integrators/DiffusionNLFormIntegrator.tpp index 8601ee8e..e85a8982 100644 --- a/kernel/include/Integrators/DiffusionNLFormIntegrator.tpp +++ b/kernel/include/Integrators/DiffusionNLFormIntegrator.tpp @@ -61,10 +61,11 @@ */ template DiffusionNLFormIntegrator::DiffusionNLFormIntegrator( - Geometry geometry, const std::vector u_old, + Geometry geometry, const double time_step, const std::vector u_old, const std::vector aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) {} + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) {} /** * @brief Initialize the diffusion integrator. diff --git a/kernel/include/Integrators/FickNLFormIntegrator.hpp b/kernel/include/Integrators/FickNLFormIntegrator.hpp index 299346e5..8b156921 100644 --- a/kernel/include/Integrators/FickNLFormIntegrator.hpp +++ b/kernel/include/Integrators/FickNLFormIntegrator.hpp @@ -56,7 +56,8 @@ class FickNLFormIntegrator : public DiffusionNLFormIntegrator { void get_coefficients() override; public: - FickNLFormIntegrator(Geometry geometry, const std::vector u_old, + FickNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); virtual ~FickNLFormIntegrator() = default; diff --git a/kernel/include/Integrators/FickNLFormIntegrator.tpp b/kernel/include/Integrators/FickNLFormIntegrator.tpp index f91120de..043bac5d 100644 --- a/kernel/include/Integrators/FickNLFormIntegrator.tpp +++ b/kernel/include/Integrators/FickNLFormIntegrator.tpp @@ -58,13 +58,14 @@ * */ template -FickNLFormIntegrator::FickNLFormIntegrator(Geometry geometry, +FickNLFormIntegrator::FickNLFormIntegrator(Geometry geometry, const double time_step, const std::vector u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : DiffusionNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : DiffusionNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "Fick"; this->expected_list_.push_back(GlossaryType::Diffusivity); diff --git a/kernel/include/Integrators/FourierNLFormIntegrator.hpp b/kernel/include/Integrators/FourierNLFormIntegrator.hpp index 17a7ecad..9aa001ff 100644 --- a/kernel/include/Integrators/FourierNLFormIntegrator.hpp +++ b/kernel/include/Integrators/FourierNLFormIntegrator.hpp @@ -56,7 +56,8 @@ class FourierNLFormIntegrator : public DiffusionNLFormIntegrator { void get_coefficients() override; public: - FourierNLFormIntegrator(Geometry geometry, const std::vector& u_old, + FourierNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/FourierNLFormIntegrator.tpp b/kernel/include/Integrators/FourierNLFormIntegrator.tpp index cf4c386e..3a9e78d2 100644 --- a/kernel/include/Integrators/FourierNLFormIntegrator.tpp +++ b/kernel/include/Integrators/FourierNLFormIntegrator.tpp @@ -59,10 +59,11 @@ */ template FourierNLFormIntegrator::FourierNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : DiffusionNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : DiffusionNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "Fourier"; this->expected_list_.push_back(GlossaryType::Conductivity); } diff --git a/kernel/include/Integrators/HeatTimeNLFormIntegrator.hpp b/kernel/include/Integrators/HeatTimeNLFormIntegrator.hpp index 55eea2c0..e4e2f70a 100644 --- a/kernel/include/Integrators/HeatTimeNLFormIntegrator.hpp +++ b/kernel/include/Integrators/HeatTimeNLFormIntegrator.hpp @@ -48,7 +48,8 @@ class HeatTimeNLFormIntegrator : public TimeNLFormIntegrator { void get_coefficients() override; public: - HeatTimeNLFormIntegrator(Geometry geometry, const std::vector u_old, + HeatTimeNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/HeatTimeNLFormIntegrator.tpp b/kernel/include/Integrators/HeatTimeNLFormIntegrator.tpp index c365ca1c..b4b5c679 100644 --- a/kernel/include/Integrators/HeatTimeNLFormIntegrator.tpp +++ b/kernel/include/Integrators/HeatTimeNLFormIntegrator.tpp @@ -56,10 +56,11 @@ */ template HeatTimeNLFormIntegrator::HeatTimeNLFormIntegrator( - Geometry geometry, const std::vector u_old, + Geometry geometry, const double time_step, const std::vector u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : TimeNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : TimeNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "HeatTime"; this->expected_list_.push_back(GlossaryType::Concentration); diff --git a/kernel/include/Integrators/LatentHeatNLFormIntegrator.hpp b/kernel/include/Integrators/LatentHeatNLFormIntegrator.hpp index f3ea1e6f..957fcbec 100644 --- a/kernel/include/Integrators/LatentHeatNLFormIntegrator.hpp +++ b/kernel/include/Integrators/LatentHeatNLFormIntegrator.hpp @@ -52,7 +52,6 @@ template class LatentHeatNLFormIntegrator : public SlothNLFormIntegrator { private: int phase_field_index_; - double latent_time_step_; std::list expected_list_{GlossaryType::Mobility}; mfem::DenseMatrix gradPsi; @@ -74,7 +73,8 @@ class LatentHeatNLFormIntegrator : public SlothNLFormIntegrator { virtual void check_variables_consistency(); public: - LatentHeatNLFormIntegrator(Geometry geometry, const std::vector& u_old, + LatentHeatNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/LatentHeatNLFormIntegrator.tpp b/kernel/include/Integrators/LatentHeatNLFormIntegrator.tpp index a2ee98ab..8550e519 100644 --- a/kernel/include/Integrators/LatentHeatNLFormIntegrator.tpp +++ b/kernel/include/Integrators/LatentHeatNLFormIntegrator.tpp @@ -59,12 +59,12 @@ */ template LatentHeatNLFormIntegrator::LatentHeatNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "LatentHeat"; - this->latent_time_step_ = this->params_.template get_param_value("latent_time_step"); this->check_variables_consistency(); } @@ -273,7 +273,7 @@ double LatentHeatNLFormIntegrator::get_latent_heat_at_ip( const double phi = local_auxvalues[this->phase_field_index_]; const double phin = local_auxvalues_n[this->phase_field_index_]; - double square_time_derivative = (phi - phin) / this->latent_time_step_; + double square_time_derivative = (phi - phin) / this->time_step_; square_time_derivative *= square_time_derivative; const double epsilon = 1.e-10; const double latent_heat = -square_time_derivative / std::max(epsilon, mobility_value); diff --git a/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.hpp b/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.hpp index 1f616f7d..bd5be827 100644 --- a/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.hpp +++ b/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.hpp @@ -82,7 +82,7 @@ class MassDiffusionFluxNLFormIntegrator : public DiffusionFluxNLFormIntegrator& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, diff --git a/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.tpp b/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.tpp index aa788499..f625b72b 100644 --- a/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.tpp +++ b/kernel/include/Integrators/MassDiffusionFluxNLFormIntegrator.tpp @@ -91,10 +91,11 @@ void MassDiffusionFluxNLFormIntegrator::get_parameters() { */ template MassDiffusionFluxNLFormIntegrator::MassDiffusionFluxNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : DiffusionFluxNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : DiffusionFluxNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->get_parameters(); this->check_variables_consistency(); } diff --git a/kernel/include/Integrators/MeltingBaseNLFormIntegrator.hpp b/kernel/include/Integrators/MeltingBaseNLFormIntegrator.hpp index 77406ca6..0f511bd3 100644 --- a/kernel/include/Integrators/MeltingBaseNLFormIntegrator.hpp +++ b/kernel/include/Integrators/MeltingBaseNLFormIntegrator.hpp @@ -73,7 +73,8 @@ class MeltingBaseNLFormIntegrator : public SlothNLFormIntegrator { virtual void check_variables_consistency(); public: - MeltingBaseNLFormIntegrator(Geometry geometry, const std::vector& u_old, + MeltingBaseNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/MeltingBaseNLFormIntegrator.tpp b/kernel/include/Integrators/MeltingBaseNLFormIntegrator.tpp index 0274c1a9..83ea1a24 100644 --- a/kernel/include/Integrators/MeltingBaseNLFormIntegrator.tpp +++ b/kernel/include/Integrators/MeltingBaseNLFormIntegrator.tpp @@ -59,10 +59,11 @@ */ template MeltingBaseNLFormIntegrator::MeltingBaseNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) {} + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) {} /** * @brief Initialize the integrator. diff --git a/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.hpp b/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.hpp index 1a80dde8..2563f411 100644 --- a/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.hpp +++ b/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.hpp @@ -73,7 +73,8 @@ class MeltingCalphadNLFormIntegrator : public MeltingBaseNLFormIntegrator const std::span& aux_values) override; public: - MeltingCalphadNLFormIntegrator(Geometry geometry, const std::vector& u_old, + MeltingCalphadNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp b/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp index f3b7e856..2b88c88b 100644 --- a/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp +++ b/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp @@ -58,10 +58,11 @@ */ template MeltingCalphadNLFormIntegrator::MeltingCalphadNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : MeltingBaseNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : MeltingBaseNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "MeltingCalphad"; this->get_parameters(); diff --git a/kernel/include/Integrators/MeltingConstantNLFormIntegrator.hpp b/kernel/include/Integrators/MeltingConstantNLFormIntegrator.hpp index 0b558c0e..d0445b78 100644 --- a/kernel/include/Integrators/MeltingConstantNLFormIntegrator.hpp +++ b/kernel/include/Integrators/MeltingConstantNLFormIntegrator.hpp @@ -59,7 +59,7 @@ class MeltingConstantNLFormIntegrator : public MeltingBaseNLFormIntegrator const std::span& aux_values) override; public: - MeltingConstantNLFormIntegrator(Geometry geometry, + MeltingConstantNLFormIntegrator(Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, diff --git a/kernel/include/Integrators/MeltingConstantNLFormIntegrator.tpp b/kernel/include/Integrators/MeltingConstantNLFormIntegrator.tpp index f2f2fab8..0f5076e7 100644 --- a/kernel/include/Integrators/MeltingConstantNLFormIntegrator.tpp +++ b/kernel/include/Integrators/MeltingConstantNLFormIntegrator.tpp @@ -58,10 +58,11 @@ */ template MeltingConstantNLFormIntegrator::MeltingConstantNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : MeltingBaseNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : MeltingBaseNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "MeltingConstant"; this->get_parameters(); diff --git a/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.hpp b/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.hpp index 97ff8b0d..7ecadd54 100644 --- a/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.hpp +++ b/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.hpp @@ -61,7 +61,7 @@ class MeltingTemperatureNLFormIntegrator : public MeltingBaseNLFormIntegrator& aux_values) override; public: - MeltingTemperatureNLFormIntegrator(Geometry geometry, + MeltingTemperatureNLFormIntegrator(Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, diff --git a/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.tpp b/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.tpp index fcae7344..e3758664 100644 --- a/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.tpp +++ b/kernel/include/Integrators/MeltingTemperatureNLFormIntegrator.tpp @@ -57,10 +57,11 @@ */ template MeltingTemperatureNLFormIntegrator::MeltingTemperatureNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : MeltingBaseNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : MeltingBaseNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "MeltingTemperature"; this->get_parameters(); this->check_variables_consistency(); diff --git a/kernel/include/Integrators/NeumannNLFormIntegrator.hpp b/kernel/include/Integrators/NeumannNLFormIntegrator.hpp index 1e3a96e1..84b8434b 100644 --- a/kernel/include/Integrators/NeumannNLFormIntegrator.hpp +++ b/kernel/include/Integrators/NeumannNLFormIntegrator.hpp @@ -48,7 +48,8 @@ class NeumannNLFormIntegrator : public RobinNLFormIntegrator { void get_coefficients() override; public: - NeumannNLFormIntegrator(Geometry geometry, const std::vector& u_old, + NeumannNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients, const unsigned int block, diff --git a/kernel/include/Integrators/NeumannNLFormIntegrator.tpp b/kernel/include/Integrators/NeumannNLFormIntegrator.tpp index 790a1209..5d1c9817 100644 --- a/kernel/include/Integrators/NeumannNLFormIntegrator.tpp +++ b/kernel/include/Integrators/NeumannNLFormIntegrator.tpp @@ -79,11 +79,11 @@ void NeumannNLFormIntegrator::get_coefficients() { */ template NeumannNLFormIntegrator::NeumannNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients, const unsigned int block, const unsigned int bdr_id) - : RobinNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients, block, - bdr_id) { + : RobinNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients, block, bdr_id) { this->integrator_name_ = "Neumann"; } diff --git a/kernel/include/Integrators/RobinNLFormIntegrator.hpp b/kernel/include/Integrators/RobinNLFormIntegrator.hpp index 367290d1..0a8f1d3f 100644 --- a/kernel/include/Integrators/RobinNLFormIntegrator.hpp +++ b/kernel/include/Integrators/RobinNLFormIntegrator.hpp @@ -61,7 +61,8 @@ class RobinNLFormIntegrator : public SlothNLFormIntegrator { void init() override; public: - RobinNLFormIntegrator(Geometry geometry, const std::vector& u_old, + RobinNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients, const unsigned int block, const unsigned int bdr_id); diff --git a/kernel/include/Integrators/RobinNLFormIntegrator.tpp b/kernel/include/Integrators/RobinNLFormIntegrator.tpp index 3b21c756..8bcc1bd4 100644 --- a/kernel/include/Integrators/RobinNLFormIntegrator.tpp +++ b/kernel/include/Integrators/RobinNLFormIntegrator.tpp @@ -98,11 +98,12 @@ void RobinNLFormIntegrator::get_coefficients() { */ template RobinNLFormIntegrator::RobinNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients, const unsigned int block, const unsigned int bdr_id) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients), + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients), blk_(block), bdr_id_(bdr_id), robin_a(Coefficient(Glossary::Default, 0.0)), diff --git a/kernel/include/Integrators/SlothNLFormIntegrator.hpp b/kernel/include/Integrators/SlothNLFormIntegrator.hpp index 36bde61f..aeab1ff9 100644 --- a/kernel/include/Integrators/SlothNLFormIntegrator.hpp +++ b/kernel/include/Integrators/SlothNLFormIntegrator.hpp @@ -58,7 +58,7 @@ class SlothNLFormIntegrator : public mfem::BlockNonlinearFormIntegrator { protected: Geometry geometry_ = Geometry::Cartesian; - + double time_step_; std::string integrator_name_ = ""; virtual void AssembleElementVector(const mfem::Array& el, mfem::ElementTransformation& Tr, @@ -106,7 +106,8 @@ class SlothNLFormIntegrator : public mfem::BlockNonlinearFormIntegrator { public: virtual void init() = 0; - SlothNLFormIntegrator(Geometry geometry, const std::vector u_old, + SlothNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector u_old, const std::vector aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); virtual ~SlothNLFormIntegrator() = default; diff --git a/kernel/include/Integrators/SlothNLFormIntegrator.tpp b/kernel/include/Integrators/SlothNLFormIntegrator.tpp index 74551875..525d5af2 100644 --- a/kernel/include/Integrators/SlothNLFormIntegrator.tpp +++ b/kernel/include/Integrators/SlothNLFormIntegrator.tpp @@ -52,13 +52,14 @@ * @param auxvars */ template -SlothNLFormIntegrator::SlothNLFormIntegrator(Geometry geometry, +SlothNLFormIntegrator::SlothNLFormIntegrator(Geometry geometry, const double time_step, const std::vector u_old, const std::vector aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) : geometry_(geometry), + time_step_(time_step), u_old_(u_old), aux_old_gf_(aux_old), params_(params), diff --git a/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.hpp b/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.hpp index 062bf95d..ae48fa65 100644 --- a/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.hpp +++ b/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.hpp @@ -58,7 +58,7 @@ class ThermalDiffusionFluxNLFormIntegrator : public DiffusionFluxNLFormIntegrato const mfem::IntegrationPoint& ip) override; public: - ThermalDiffusionFluxNLFormIntegrator(Geometry geometry, + ThermalDiffusionFluxNLFormIntegrator(Geometry geometry, const double time_step, const std::vector& u_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.tpp b/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.tpp index 69aa8aec..033fb8a5 100644 --- a/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.tpp +++ b/kernel/include/Integrators/ThermalDiffusionFluxNLFormIntegrator.tpp @@ -63,9 +63,11 @@ void ThermalDiffusionFluxNLFormIntegrator::get_parameters() { */ template ThermalDiffusionFluxNLFormIntegrator::ThermalDiffusionFluxNLFormIntegrator( - Geometry geometry, const std::vector& u_old, const Parameters& params, - std::vector auxvars, const std::vector& coefficients) - : DiffusionFluxNLFormIntegrator(geometry, u_old, params, auxvars, coefficients) { + Geometry geometry, const double time_step, const std::vector& u_old, + const Parameters& params, std::vector auxvars, + const std::vector& coefficients) + : DiffusionFluxNLFormIntegrator(geometry, time_step, u_old, params, auxvars, + coefficients) { this->check_variables_consistency(); } diff --git a/kernel/include/Integrators/TimeCHNLFormIntegrator.hpp b/kernel/include/Integrators/TimeCHNLFormIntegrator.hpp index a73f442c..c58cb01d 100644 --- a/kernel/include/Integrators/TimeCHNLFormIntegrator.hpp +++ b/kernel/include/Integrators/TimeCHNLFormIntegrator.hpp @@ -61,7 +61,8 @@ class TimeCHNLFormIntegrator : public SlothNLFormIntegrator { public: void init() override; - TimeCHNLFormIntegrator(Geometry geometry, const std::vector& u_old, + TimeCHNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp b/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp index 51e93ee7..fcfc4572 100644 --- a/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp +++ b/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp @@ -58,10 +58,11 @@ */ template TimeCHNLFormIntegrator::TimeCHNLFormIntegrator( - Geometry geometry, const std::vector& u_old, + Geometry geometry, const double time_step, const std::vector& u_old, const std::vector& aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "SplitTimeDerivative"; this->check_variables_consistency(); diff --git a/kernel/include/Integrators/TimeNLFormIntegrator.hpp b/kernel/include/Integrators/TimeNLFormIntegrator.hpp index 72d97734..f7315098 100644 --- a/kernel/include/Integrators/TimeNLFormIntegrator.hpp +++ b/kernel/include/Integrators/TimeNLFormIntegrator.hpp @@ -62,7 +62,8 @@ class TimeNLFormIntegrator : public SlothNLFormIntegrator { public: void init() override; - TimeNLFormIntegrator(Geometry geometry, const std::vector u_old, + TimeNLFormIntegrator(Geometry geometry, const double time_step, + const std::vector u_old, const std::vector aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients); diff --git a/kernel/include/Integrators/TimeNLFormIntegrator.tpp b/kernel/include/Integrators/TimeNLFormIntegrator.tpp index 05210569..8f258218 100644 --- a/kernel/include/Integrators/TimeNLFormIntegrator.tpp +++ b/kernel/include/Integrators/TimeNLFormIntegrator.tpp @@ -56,13 +56,14 @@ * */ template -TimeNLFormIntegrator::TimeNLFormIntegrator(Geometry geometry, +TimeNLFormIntegrator::TimeNLFormIntegrator(Geometry geometry, const double time_step, const std::vector u_old, const std::vector aux_old, const Parameters& params, std::vector auxvars, const std::vector& coefficients) - : SlothNLFormIntegrator(geometry, u_old, aux_old, params, auxvars, coefficients) { + : SlothNLFormIntegrator(geometry, time_step, u_old, aux_old, params, auxvars, + coefficients) { this->integrator_name_ = "TimeDerivative"; this->check_variables_consistency(); diff --git a/kernel/include/Operators/OperatorBase.hpp b/kernel/include/Operators/OperatorBase.hpp index 36cbd8d0..9c599740 100644 --- a/kernel/include/Operators/OperatorBase.hpp +++ b/kernel/include/Operators/OperatorBase.hpp @@ -106,16 +106,16 @@ class OperatorBase : public mfem::Operator { std::vector rhs_integrators_; - void build_rhs_nonlinear_form(const std::vector& u); + void build_rhs_nonlinear_form(const double dt, const std::vector& u); void SetNewtonAlgorithm(mfem::Operator* oper); int compute_total_height(const std::vector*>& spatials); int compute_total_width(const std::vector*>& spatials); SlothNLFormIntegrator>* get_rhs_integrator( - const std::string integrator, const std::vector& vun, + const double dt, const std::string integrator, const std::vector& vun, const std::vector& vauxn, const Parameters& all_params); SlothNLFormIntegrator>* get_bdr_integrator( - const std::string integrator, const std::vector& vun, + const double dt, const std::string integrator, const std::vector& vun, const std::vector& vauxn, const Parameters& all_params, const unsigned int block, const unsigned int bdr_id); @@ -176,16 +176,17 @@ class OperatorBase : public mfem::Operator { void setGeometry(Geometry geometry); // Virtual methods - virtual void initialize(const double& initial_time, Variables& vars, - std::vector*> auxvars); + virtual void initialize(const double& initial_time, const double time_step, + Variables& vars, std::vector*> auxvars); // Pure virtual methods - virtual void SetTransientParameters(const std::vector& u_vect) = 0; + virtual void SetTransientParameters(const double dt, const std::vector& u_vect) = 0; virtual void solve(std::vector>& vect_unk, double& next_time, const double& current_time, double current_time_step, const int iter) = 0; - SlothNLFormIntegrator>* set_nlfi_ptr(const std::string nlfi, + SlothNLFormIntegrator>* set_nlfi_ptr(const double dt, const std::string nlfi, const std::vector& u); - SlothNLFormIntegrator>* set_bdr_nlfi_ptr(const std::string nlfi, + SlothNLFormIntegrator>* set_bdr_nlfi_ptr(const double dt, + const std::string nlfi, const std::vector& u, const unsigned int block, const unsigned int bdr_id); diff --git a/kernel/include/Operators/OperatorBase.tpp b/kernel/include/Operators/OperatorBase.tpp index db5f6a8d..45a4450d 100644 --- a/kernel/include/Operators/OperatorBase.tpp +++ b/kernel/include/Operators/OperatorBase.tpp @@ -61,7 +61,7 @@ */ template SlothNLFormIntegrator>* OperatorBase::set_nlfi_ptr( - const std::string nlfi, const std::vector& u) { + const double dt, const std::string nlfi, const std::vector& u) { Catch_Time_Section("OperatorBase::set_nlfi_ptr"); std::vector vun; std::vector vauxn; @@ -81,7 +81,7 @@ SlothNLFormIntegrator>* OperatorBase::set_nlfi_ptr( } const Parameters& all_params = this->params_ - this->default_p_; - auto rhs_nlfi = this->get_rhs_integrator(nlfi, vun, vauxn, all_params); + auto rhs_nlfi = this->get_rhs_integrator(dt, nlfi, vun, vauxn, all_params); rhs_nlfi->init(); return rhs_nlfi; } @@ -100,8 +100,8 @@ SlothNLFormIntegrator>* OperatorBase::set_nlfi_ptr( */ template SlothNLFormIntegrator>* OperatorBase::set_bdr_nlfi_ptr( - const std::string nlfi, const std::vector& u, const unsigned int block, - const unsigned int bdr_id) { + const double dt, const std::string nlfi, const std::vector& u, + const unsigned int block, const unsigned int bdr_id) { Catch_Time_Section("OperatorBase::set_bdr_nlfi_ptr"); std::vector vun; @@ -122,7 +122,7 @@ SlothNLFormIntegrator>* OperatorBase::set_bdr_nlfi_ptr } const Parameters& all_params = this->params_ - this->default_p_; - auto bdr_nlfi = this->get_bdr_integrator(nlfi, vun, vauxn, all_params, block, bdr_id); + auto bdr_nlfi = this->get_bdr_integrator(dt, nlfi, vun, vauxn, all_params, block, bdr_id); bdr_nlfi->init(); return bdr_nlfi; } @@ -357,7 +357,7 @@ OperatorBase::OperatorBase(const std::vector& integrators, * @param vars */ template -void OperatorBase::initialize([[maybe_unused]] const double& initial_time, +void OperatorBase::initialize([[maybe_unused]] const double& initial_time, const double dt, Variables& vars, std::vector*> auxvars) { Catch_Time_Section("OperatorBase::initialize"); @@ -376,7 +376,7 @@ void OperatorBase::initialize([[maybe_unused]] const double& initial_tim vv.update(u); u_vect.emplace_back(u); } - this->SetTransientParameters(u_vect); + this->SetTransientParameters(dt, u_vect); } ////////////////////////////////////////////////////////////////////////////// @@ -392,13 +392,14 @@ void OperatorBase::initialize([[maybe_unused]] const double& initial_tim * @param u */ template -void OperatorBase::build_rhs_nonlinear_form(const std::vector& u_vect) { +void OperatorBase::build_rhs_nonlinear_form(const double dt, + const std::vector& u_vect) { if (this->RHS != nullptr) { delete this->RHS; } this->RHS = new mfem::ParBlockNonlinearForm(this->fes_); for (const std::string& s_integrator : this->rhs_integrators_) { - auto integrator_ptr = this->set_nlfi_ptr(s_integrator, u_vect); + auto integrator_ptr = this->set_nlfi_ptr(dt, s_integrator, u_vect); this->RHS->AddDomainIntegrator(integrator_ptr); } @@ -451,14 +452,14 @@ void OperatorBase::build_rhs_nonlinear_form(const std::vectorarray_bdr_[j] = make_boundary_marker(nb_bdr, j); - auto integrator_ptr = this->set_bdr_nlfi_ptr("Neumann", u_vect, i, j); + auto integrator_ptr = this->set_bdr_nlfi_ptr(dt, "Neumann", u_vect, i, j); this->RHS->AddBoundaryIntegrator(integrator_ptr, this->array_bdr_[j]); } } // Add Robin integrator if (Robin_bdr[j] > 0) { this->array_bdr_[j] = make_boundary_marker(nb_bdr, j); - auto integrator_ptr = this->set_bdr_nlfi_ptr("Robin", u_vect, i, j); + auto integrator_ptr = this->set_bdr_nlfi_ptr(dt, "Robin", u_vect, i, j); this->RHS->AddBoundaryIntegrator(integrator_ptr, this->array_bdr_[j]); } } @@ -918,48 +919,48 @@ void OperatorBase::set_default_solver() { */ template SlothNLFormIntegrator>* OperatorBase::get_rhs_integrator( - const std::string integrator, const std::vector& vun, + const double dt, const std::string integrator, const std::vector& vun, const std::vector& vauxn, const Parameters& all_params) { switch (Integrators::from(integrator)) { case Integrators::MassFlux: { return new MassDiffusionFluxNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::Fick: { - return new FickNLFormIntegrator>(this->geometry_, vun, vauxn, all_params, - this->auxvariables_, this->coefficients_); + return new FickNLFormIntegrator>( + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::Fourier: { return new FourierNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::CahnHilliard: { return new CahnHilliardNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::AllenCahn: { return new AllenCahnNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::SplitAllenCahn: { return new BlockAllenCahnNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::MeltingTemperature: { return new MeltingTemperatureNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::MeltingCalphad: { return new MeltingCalphadNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::MeltingConstant: { return new MeltingConstantNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } case Integrators::LatentHeat: { return new LatentHeatNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); } default: mfem::mfem_error("RHS Integrators not found. Please check your data."); @@ -981,20 +982,20 @@ SlothNLFormIntegrator>* OperatorBase::get_rhs_integrat */ template SlothNLFormIntegrator>* OperatorBase::get_bdr_integrator( - const std::string integrator, const std::vector& vun, + const double dt, const std::string integrator, const std::vector& vun, const std::vector& vauxn, const Parameters& all_params, const unsigned int block, const unsigned int bdr_id) { switch (Integrators::from(integrator)) { case Integrators::Neumann: { - return new NeumannNLFormIntegrator>(this->geometry_, vun, vauxn, all_params, - this->auxvariables_, + return new NeumannNLFormIntegrator>(this->geometry_, dt, vun, vauxn, + all_params, this->auxvariables_, this->coefficients_, block, bdr_id); break; } case Integrators::Robin: { - return new RobinNLFormIntegrator>(this->geometry_, vun, vauxn, all_params, - this->auxvariables_, this->coefficients_, - block, bdr_id); + return new RobinNLFormIntegrator>(this->geometry_, dt, vun, vauxn, + all_params, this->auxvariables_, + this->coefficients_, block, bdr_id); break; } default: diff --git a/kernel/include/Operators/SteadyOperator.hpp b/kernel/include/Operators/SteadyOperator.hpp index f1494190..88170066 100644 --- a/kernel/include/Operators/SteadyOperator.hpp +++ b/kernel/include/Operators/SteadyOperator.hpp @@ -72,9 +72,9 @@ class SteadyOperator : public OperatorBase { } // Virtual methods - void initialize(const double& initial_time, Variables& vars, + void initialize(const double& initial_time, const double time_step, Variables& vars, std::vector*> auxvars) override; - void SetTransientParameters(const std::vector& u_vet) override; + void SetTransientParameters(const double dt, const std::vector& u_vet) override; void solve(std::vector>& vect_unk, double& next_time, const double& current_time, double dt, const int iter) override; }; diff --git a/kernel/include/Operators/SteadyOperator.tpp b/kernel/include/Operators/SteadyOperator.tpp index e378c31e..990ed9b0 100644 --- a/kernel/include/Operators/SteadyOperator.tpp +++ b/kernel/include/Operators/SteadyOperator.tpp @@ -124,11 +124,12 @@ SteadyOperator::SteadyOperator(std::vector * @param vars */ template -void SteadyOperator::initialize(const double& initial_time, Variables& vars, +void SteadyOperator::initialize(const double& initial_time, const double time_step, + Variables& vars, std::vector*> auxvars) { Catch_Time_Section("SteadyOperator::initialize"); - OperatorBase::initialize(initial_time, vars, auxvars); + OperatorBase::initialize(initial_time, time_step, vars, auxvars); } /** @@ -164,7 +165,7 @@ void SteadyOperator::solve(std::vector>& v u_vect.emplace_back(unk_i); } - this->SetTransientParameters(u_vect); + this->SetTransientParameters(dt, u_vect); /// Apply BCs: check if need to be uncomment // for (size_t i = 0; i < unk_size; i++) { @@ -211,13 +212,14 @@ void SteadyOperator::solve(std::vector>& v * @param u_vect unknown vector */ template -void SteadyOperator::SetTransientParameters(const std::vector& u_vect) { +void SteadyOperator::SetTransientParameters(const double dt, + const std::vector& u_vect) { Catch_Time_Section("SteadyOperator::SetTransientParameters"); //////////////////////////////////////////// // Build the RHS of the PDEs //////////////////////////////////////////// - this->build_rhs_nonlinear_form(u_vect); + this->build_rhs_nonlinear_form(dt, u_vect); //////////////////////////////////////////// // Build Newton Linear system diff --git a/kernel/include/Operators/TransientOperator.hpp b/kernel/include/Operators/TransientOperator.hpp index baac61ad..9876a31c 100644 --- a/kernel/include/Operators/TransientOperator.hpp +++ b/kernel/include/Operators/TransientOperator.hpp @@ -49,6 +49,7 @@ template class TransientOperator : public OperatorBase, public mfem::TimeDependentOperator { private: + double solve_time_step_{std::numeric_limits::quiet_NaN()}; std::shared_ptr ode_solver_; bool is_explicit_; @@ -60,10 +61,11 @@ class TransientOperator : public OperatorBase, public mfem::TimeDependen Parameters mass_precond_params_; void set_default_mass_solver(); - SlothNLFormIntegrator>* set_lhs_nlfi_ptr(const std::vector& u); + SlothNLFormIntegrator>* set_lhs_nlfi_ptr(const double dt, + const std::vector& u); SlothNLFormIntegrator>* get_lhs_integrator( - const std::string integrator, const std::vector& vun, + const double dt, const std::string integrator, const std::vector& vun, const std::vector& vauxn, const Parameters& all_params); std::string lhs_integrator_; @@ -86,7 +88,7 @@ class TransientOperator : public OperatorBase, public mfem::TimeDependen mfem::HypreParMatrix* Mmat; // CCI void build_mass_matrix(const std::vector& u_vect); - void build_lhs_nonlinear_form(const std::vector& u); + void build_lhs_nonlinear_form(const double dt, const std::vector& u); bool constant_mass_matrix_{true}; // Reduced Operator @@ -120,12 +122,12 @@ class TransientOperator : public OperatorBase, public mfem::TimeDependen void overload_mass_preconditioner(VSolverType PRECOND); void overload_mass_preconditioner(VSolverType PRECOND, const Parameters& p_params); - void SetExplicitTransientParameters(const std::vector& un_vect); + void SetExplicitTransientParameters(const double dt, const std::vector& un_vect); // Virtual methods - void initialize(const double& initial_time, Variables& vars, + void initialize(const double& initial_time, const double time_step, Variables& vars, std::vector*> auxvars) override; - void SetTransientParameters(const std::vector& u_vect) override; + void SetTransientParameters(const double dt, const std::vector& u_vect) override; void solve(std::vector>& vect_unk, double& next_time, const double& current_time, double current_time_step, const int iter) override; }; diff --git a/kernel/include/Operators/TransientOperator.tpp b/kernel/include/Operators/TransientOperator.tpp index 213e2e1e..797bb3b5 100644 --- a/kernel/include/Operators/TransientOperator.tpp +++ b/kernel/include/Operators/TransientOperator.tpp @@ -207,13 +207,14 @@ void TransientOperator::set_ODE_solver(const TimeScheme::value& ode_solv * @param vars */ template -void TransientOperator::initialize(const double& initial_time, Variables& vars, +void TransientOperator::initialize(const double& initial_time, const double time_step, + Variables& vars, std::vector*> auxvars) { Catch_Time_Section("TransientOperator::initialize"); this->SetTime(initial_time); - OperatorBase::initialize(initial_time, vars, auxvars); + OperatorBase::initialize(initial_time, time_step, vars, auxvars); this->ode_solver_->Init(*this); @@ -238,7 +239,7 @@ void TransientOperator::solve(std::vector> double current_time_step, [[maybe_unused]] const int iter) { //// Constructing array of offsets const size_t unk_size = vect_unk.size(); - + this->solve_time_step_ = current_time_step; //// Constructing BlockVector mfem::BlockVector block_unk(this->block_trueOffsets_); for (size_t i = 0; i < unk_size; i++) { @@ -324,12 +325,13 @@ void TransientOperator::build_mass_matrix(const std::vector -void TransientOperator::build_lhs_nonlinear_form(const std::vector& u_vect) { +void TransientOperator::build_lhs_nonlinear_form(const double dt, + const std::vector& u_vect) { if (LHS != nullptr) { delete LHS; } LHS = new mfem::ParBlockNonlinearForm(this->fes_); - auto integrator_ptr = this->set_lhs_nlfi_ptr(u_vect); + auto integrator_ptr = this->set_lhs_nlfi_ptr(dt, u_vect); this->LHS->AddDomainIntegrator(integrator_ptr); } @@ -343,7 +345,7 @@ void TransientOperator::build_lhs_nonlinear_form(const std::vector SlothNLFormIntegrator>* TransientOperator::set_lhs_nlfi_ptr( - const std::vector& u) { + const double dt, const std::vector& u) { Catch_Time_Section("TransientOperator::set_lhs_nlfi_ptr"); std::vector vun; @@ -364,7 +366,7 @@ SlothNLFormIntegrator>* TransientOperator::set_lhs_nlf } const Parameters& all_params = this->params_ - this->default_p_; - auto lhs = this->get_lhs_integrator(this->lhs_integrator_, vun, vauxn, all_params); + auto lhs = this->get_lhs_integrator(dt, this->lhs_integrator_, vun, vauxn, all_params); lhs->init(); return lhs; } @@ -376,18 +378,19 @@ SlothNLFormIntegrator>* TransientOperator::set_lhs_nlf * @param u unknown vector */ template -void TransientOperator::SetTransientParameters(const std::vector& u_vect) { +void TransientOperator::SetTransientParameters(const double dt, + const std::vector& u_vect) { Catch_Time_Section("TransientOperator::SetTransientParameters"); //////////////////////////////////////////// // Build the LHS of the PDEs //////////////////////////////////////////// - this->build_lhs_nonlinear_form(u_vect); + this->build_lhs_nonlinear_form(dt, u_vect); //////////////////////////////////////////// // Build the RHS of the PDEs //////////////////////////////////////////// - this->build_rhs_nonlinear_form(u_vect); + this->build_rhs_nonlinear_form(dt, u_vect); //////////////////////////////////////////// // Build Newton Linear system //////////////////////////////////////////// @@ -409,7 +412,7 @@ void TransientOperator::SetTransientParameters(const std::vector void TransientOperator::SetExplicitTransientParameters( - const std::vector& un_vect) { + const double dt, const std::vector& un_vect) { Catch_Time_Section("TransientOperator::SetExplicitTransientParameters"); //////////////////////////////////////////// // Variable mass matrix @@ -419,7 +422,7 @@ void TransientOperator::SetExplicitTransientParameters( //////////////////////////////////////////// // PhaseField non linear form //////////////////////////////////////////// - this->build_rhs_nonlinear_form(un_vect); + this->build_rhs_nonlinear_form(dt, un_vect); } ////////////////////////////////////////////////////////////////////////////// @@ -444,7 +447,8 @@ void TransientOperator::Mult(const mfem::Vector& u, mfem::Vector& du_dt) v_vect.emplace_back(v); // Todo(cci) : try to do different because of not satisfying - const_cast*>(this)->SetExplicitTransientParameters(v_vect); + const_cast*>(this)->SetExplicitTransientParameters( + this->solve_time_step_, v_vect); const int fes_size = this->block_trueOffsets_.Size() - 1; mfem::BlockVector bb(this->block_trueOffsets_); @@ -518,7 +522,7 @@ void TransientOperator::ImplicitSolve(const double dt, const mfem::Vecto sc_1 += sc_2; v_vect.emplace_back(v_i); } - this->SetTransientParameters(v_vect); + this->SetTransientParameters(dt, v_vect); } MATools::MATrace::stop("SetTransientParams"); @@ -656,22 +660,22 @@ void TransientOperator::set_default_mass_solver() { */ template SlothNLFormIntegrator>* TransientOperator::get_lhs_integrator( - const std::string integrator, const std::vector& vun, + const double dt, const std::string integrator, const std::vector& vun, const std::vector& vauxn, const Parameters& all_params) { switch (Integrators::from(integrator)) { case Integrators::TimeDerivative: { - return new TimeNLFormIntegrator>(this->geometry_, vun, vauxn, all_params, - this->auxvariables_, this->coefficients_); + return new TimeNLFormIntegrator>( + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); break; } case Integrators::HeatTimeDerivative: { return new HeatTimeNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); break; } case Integrators::SplitTimeDerivative: { return new TimeCHNLFormIntegrator>( - this->geometry_, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); + this->geometry_, dt, vun, vauxn, all_params, this->auxvariables_, this->coefficients_); break; } default: diff --git a/kernel/include/Problems/Calphad_problem.hpp b/kernel/include/Problems/Calphad_problem.hpp index 0b7f21f4..571fcc60 100644 --- a/kernel/include/Problems/Calphad_problem.hpp +++ b/kernel/include/Problems/Calphad_problem.hpp @@ -107,7 +107,7 @@ class Calphad_Problem : public ProblemBase { Args&&... auxvariable); ///////////////////////////////////////////////////// - void initialize(const double& initial_time) override; + void initialize(const double& initial_time, const double time_step) override; ///////////////////////////////////////////////////// diff --git a/kernel/include/Problems/Calphad_problem.tpp b/kernel/include/Problems/Calphad_problem.tpp index bbe6aa4d..9ed49a66 100644 --- a/kernel/include/Problems/Calphad_problem.tpp +++ b/kernel/include/Problems/Calphad_problem.tpp @@ -455,7 +455,8 @@ void Calphad_Problem::check_variables_consistency() { * @param initial_time */ template -void Calphad_Problem::initialize([[maybe_unused]] const double& initial_time) { +void Calphad_Problem::initialize([[maybe_unused]] const double& initial_time, + [[maybe_unused]] const double time_step) { this->CC_->initialize(this->sorted_chemical_system_); } diff --git a/kernel/include/Problems/Problem.hpp b/kernel/include/Problems/Problem.hpp index 2313b649..577f398c 100644 --- a/kernel/include/Problems/Problem.hpp +++ b/kernel/include/Problems/Problem.hpp @@ -81,7 +81,7 @@ class Problem : public ProblemBase { const std::vector& Coeff, PST& pst, Args&&... auxvariable); ///////////////////////////////////////////////////// - void initialize(const double& initial_time) override; + void initialize(const double& initial_time, const double time_step) override; void do_time_step(double& next_time, const double& current_time, double current_time_step, const int iter, std::vector>& unks, diff --git a/kernel/include/Problems/Problem.tpp b/kernel/include/Problems/Problem.tpp index 2afca411..99f53eb0 100644 --- a/kernel/include/Problems/Problem.tpp +++ b/kernel/include/Problems/Problem.tpp @@ -242,8 +242,8 @@ Problem::Problem(const std::string& name, const OPE& oper, VAR& v * Initial time */ template -void Problem::initialize(const double& initial_time) { - this->oper_.initialize(initial_time, this->variables_, this->auxvariables_); +void Problem::initialize(const double& initial_time, const double time_step) { + this->oper_.initialize(initial_time, time_step, this->variables_, this->auxvariables_); } /** diff --git a/kernel/include/Problems/ProblemBase.hpp b/kernel/include/Problems/ProblemBase.hpp index 4f4b3e36..239bc351 100644 --- a/kernel/include/Problems/ProblemBase.hpp +++ b/kernel/include/Problems/ProblemBase.hpp @@ -103,7 +103,8 @@ class ProblemBase { void setGeometry(Geometry geometry); ///////////////////////////////////////////////////// - virtual void initialize([[maybe_unused]] const double& initial_time) {} + virtual void initialize([[maybe_unused]] const double& initial_time, + [[maybe_unused]] const double time_step) {} void execute(const int& iter, double& next_time, const double& current_time, const double& current_time_step); diff --git a/kernel/include/Time/Time.tpp b/kernel/include/Time/Time.tpp index f56bbb2f..ad47b004 100644 --- a/kernel/include/Time/Time.tpp +++ b/kernel/include/Time/Time.tpp @@ -124,9 +124,11 @@ void TimeDiscretization::initialize() { } const auto& tt = this->initial_time_; + const double dt = this->time_step_; this->current_time_ = tt; const auto& iter = 0; - std::apply([iter, tt](auto&... coupling) { (coupling.initialize(iter, tt), ...); }, couplings_); + std::apply([iter, tt, dt](auto&... coupling) { (coupling.initialize(iter, tt, dt), ...); }, + couplings_); } /** From e6b10e8a10984bbf64101b980c4c200fc6e81436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Intro=C3=AFni?= <32884037+CINTROINI@users.noreply.github.com> Date: Tue, 23 Jun 2026 15:33:15 +0200 Subject: [PATCH 2/6] Update MeltingCalphadNLFormIntegrator.tpp --- kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp b/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp index 2b88c88b..22e285a7 100644 --- a/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp +++ b/kernel/include/Integrators/MeltingCalphadNLFormIntegrator.tpp @@ -233,5 +233,5 @@ double MeltingCalphadNLFormIntegrator::get_seed_at_ip( const double seed = -aux_values[this->secondary_nucleus_index_] - aux_values[this->primary_nucleus_index_]; - return seed; + return seed / this->time_step_; } From f2712066097415654d604a0a7f852e54e2bc5627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Intro=C3=AFni?= <32884037+CINTROINI@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:34:56 +0200 Subject: [PATCH 3/6] Transfer current time and time-step to Property --- kernel/include/Problems/Problem.tpp | 2 ++ kernel/include/Problems/PropertyProblem.hpp | 3 +++ kernel/include/Problems/PropertyProblem.tpp | 26 +++++++++++++++++++++ kernel/include/Property/PropertyBase.hpp | 5 ++++ 4 files changed, 36 insertions(+) diff --git a/kernel/include/Problems/Problem.tpp b/kernel/include/Problems/Problem.tpp index 99f53eb0..7a12667d 100644 --- a/kernel/include/Problems/Problem.tpp +++ b/kernel/include/Problems/Problem.tpp @@ -240,6 +240,8 @@ Problem::Problem(const std::string& name, const OPE& oper, VAR& v * PostProcessing. * @param initial_time * Initial time + * @param time_step + * current time_step */ template void Problem::initialize(const double& initial_time, const double time_step) { diff --git a/kernel/include/Problems/PropertyProblem.hpp b/kernel/include/Problems/PropertyProblem.hpp index e8879fcb..7cb6f23f 100644 --- a/kernel/include/Problems/PropertyProblem.hpp +++ b/kernel/include/Problems/PropertyProblem.hpp @@ -84,6 +84,9 @@ class Property_problem : public ProblemBase { template ... Args> Property_problem(const Parameters& params, VAR& variables, PST& pst, Args&&... auxvariable); + ///////////////////////////////////////////////////// + void initialize(const double& initial_time, const double time_step) override; + void do_time_step(double& next_time, const double& current_time, double current_time_step, const int iter, std::vector>& unks, const std::vector>& unks_info) override; diff --git a/kernel/include/Problems/PropertyProblem.tpp b/kernel/include/Problems/PropertyProblem.tpp index fb15b510..d9dce304 100644 --- a/kernel/include/Problems/PropertyProblem.tpp +++ b/kernel/include/Problems/PropertyProblem.tpp @@ -206,7 +206,9 @@ Property_problem::Property_problem(const std::string& name, * * @tparam PROPERTY * @tparam VAR + * Primary variable container type. * @tparam PST + * PostProcessing. * @tparam Args * @param name User-defined name of the property problem * @param params Parameters of the problem @@ -223,6 +225,27 @@ Property_problem::Property_problem(const std::string& name, this->PP_ = new PROPERTY(params); } +/** + * @brief Initialize the Problem + * + * @tparam PROPERTY + * @tparam VAR + * Primary variable container type. + * @tparam PST + * PostProcessing. + * @param initial_time + * Initial time + * @param time_step + * current time_step + */ +template +template ... Args> +void Property_problem::initialize(const double& initial_time, + const double time_step) { + // Initialize the time and time-step for the property + this->PP_->set_times(initial_time, time_step); +} + /** * @brief Do a time-step by calling the compute method of the property @@ -250,6 +273,9 @@ void Property_problem::do_time_step( std::vector, mfem::Vector>> input_system = this->get_input_system(); + // Update the current time and time-step for the property + this->PP_->set_times(current_time, current_time_step); + // Apply the compute method of the property this->PP_->compute(output_system, input_system); diff --git a/kernel/include/Property/PropertyBase.hpp b/kernel/include/Property/PropertyBase.hpp index 521a6514..c9dd2a21 100644 --- a/kernel/include/Property/PropertyBase.hpp +++ b/kernel/include/Property/PropertyBase.hpp @@ -50,6 +50,9 @@ class PropertyBase { // Flag used to avoid verification at each time-step bool is_checked_{false}; + double time_step_{std::numeric_limits::quiet_NaN()}; + double current_time_{std::numeric_limits::quiet_NaN()}; + /** * @brief Check the consistency of the inputs and outputs of the property problem. * @@ -82,5 +85,7 @@ class PropertyBase { output_system, std::vector, mfem::Vector>> input_system); + void set_times(const double time, const double dt); + virtual ~PropertyBase() = default; }; From 015f0f77d214dd32f5e10d676782723c5da985a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Intro=C3=AFni?= <32884037+CINTROINI@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:39:25 +0200 Subject: [PATCH 4/6] Update PropertyProblem.tpp --- kernel/include/Problems/PropertyProblem.tpp | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/include/Problems/PropertyProblem.tpp b/kernel/include/Problems/PropertyProblem.tpp index d9dce304..08f520be 100644 --- a/kernel/include/Problems/PropertyProblem.tpp +++ b/kernel/include/Problems/PropertyProblem.tpp @@ -239,7 +239,6 @@ Property_problem::Property_problem(const std::string& name, * current time_step */ template -template ... Args> void Property_problem::initialize(const double& initial_time, const double time_step) { // Initialize the time and time-step for the property From 220a8ba8d871c6114f952cf6a519d2bc79477b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Intro=C3=AFni?= <32884037+CINTROINI@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:07:52 +0200 Subject: [PATCH 5/6] Update PropertyBase.cpp --- kernel/src/Property/PropertyBase.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/src/Property/PropertyBase.cpp b/kernel/src/Property/PropertyBase.cpp index d2abec7d..eb2c13a0 100644 --- a/kernel/src/Property/PropertyBase.cpp +++ b/kernel/src/Property/PropertyBase.cpp @@ -64,3 +64,14 @@ void PropertyBase::compute( this->get_property(output_system, input_system); } + +/** + * @brief Set the current time and time-step for property used in transient simulations + * + * @param time current time + * @param dt current time-step + */ +void PropertyBase::set_times(const double time, const double dt) { + this->current_time_ = time; + this->time_step_ = dt; +} From 297bd6f221614f04637c4bcb7bdfdb05fc0d538e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Intro=C3=AFni?= <32884037+CINTROINI@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:54:15 +0200 Subject: [PATCH 6/6] Minor Update of reference results (change of final time) --- tests/HeatTransfer/2D/test3/main.cpp | 2 +- .../HeatTransfer/2D/test3/ref/convergence_output_ref.csv | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/HeatTransfer/2D/test3/main.cpp b/tests/HeatTransfer/2D/test3/main.cpp index 3a25129b..36c2b254 100644 --- a/tests/HeatTransfer/2D/test3/main.cpp +++ b/tests/HeatTransfer/2D/test3/main.cpp @@ -165,7 +165,7 @@ int main(int argc, char* argv[]) { // ########################################### // ########################################### const auto& t_initial = 0.0; - const auto& t_final = 0.005; + const auto& t_final = 0.01; const auto& dt = 0.001; auto time_params = Parameters(Parameter("initial_time", t_initial), Parameter("final_time", t_final), Parameter("time_step", dt)); diff --git a/tests/HeatTransfer/2D/test3/ref/convergence_output_ref.csv b/tests/HeatTransfer/2D/test3/ref/convergence_output_ref.csv index 8616df0d..f1cc90b6 100644 --- a/tests/HeatTransfer/2D/test3/ref/convergence_output_ref.csv +++ b/tests/HeatTransfer/2D/test3/ref/convergence_output_ref.csv @@ -1,4 +1,4 @@ -order 1,0.004166666666666667,3.9514e-06 -order 1,0.008333333333333333,1.85752e-05 -order 1,0.016666666666666666,7.73116e-05 -order 1,0.03333333333333333,0.000312207 +order 1,0.004166666666666667,3.2037e-06 +order 1,0.008333333333333333,1.68338e-05 +order 1,0.016666666666666666,7.26958e-05 +order 1,0.03333333333333333,0.000296269