Skip to content
Snippets Groups Projects
Commit 065ff4f2 authored by Matteo Cicuttin's avatar Matteo Cicuttin
Browse files

Fixed RK4.

parent 7ebfa626
No related branches found
No related tags found
No related merge requests found
...@@ -191,7 +191,7 @@ compute_euler_update(solver_state& state, const field& y, const field& k, double ...@@ -191,7 +191,7 @@ compute_euler_update(solver_state& state, const field& y, const field& k, double
} }
void void
compute_rk4_weighted_sum(solver_state& state, const field& in, double dt, field out) compute_rk4_weighted_sum(solver_state& state, const field& in, double dt, field& out)
{ {
for (size_t i = 0; i < out.num_dofs; i++) for (size_t i = 0; i < out.num_dofs; i++)
{ {
...@@ -224,10 +224,11 @@ timestep(solver_state& state) ...@@ -224,10 +224,11 @@ timestep(solver_state& state)
timecounter tc; timecounter tc;
tc.tic(); tc.tic();
/*
apply_operator(state, state.emf_curr, state.tmp); apply_operator(state, state.emf_curr, state.tmp);
compute_euler_update(state, state.emf_curr, state.tmp, state.delta_t, state.emf_next); compute_euler_update(state, state.emf_curr, state.tmp, state.delta_t, state.emf_next);
*/
/*
apply_operator(state, state.emf_curr, state.k1); apply_operator(state, state.emf_curr, state.k1);
compute_euler_update(state, state.emf_curr, state.k1, 0.5*state.delta_t, state.tmp); compute_euler_update(state, state.emf_curr, state.k1, 0.5*state.delta_t, state.tmp);
...@@ -240,7 +241,7 @@ timestep(solver_state& state) ...@@ -240,7 +241,7 @@ timestep(solver_state& state)
apply_operator(state, state.tmp, state.k4); apply_operator(state, state.tmp, state.k4);
compute_rk4_weighted_sum(state, state.emf_curr, state.delta_t, state.emf_next); compute_rk4_weighted_sum(state, state.emf_curr, state.delta_t, state.emf_next);
*/
state.curr_time += state.delta_t; state.curr_time += state.delta_t;
state.curr_timestep += 1; state.curr_timestep += 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment