Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
rafavzqz committed Jul 16, 2024
1 parent 6a62077 commit 455f6d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions geopdes/inst/multipatch/mp_solve_cahn_hilliard_C1.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@
% Generalized alpha parameters
a_m = .5*((3-rho_inf_gen_alpha)/(1+rho_inf_gen_alpha));
a_f = 1/(1+rho_inf_gen_alpha);
gamma = .5 + a_m - a_f;
gamma = .5 + a_m - a_f;

%%-------------------------------------------------------------------------
% No flux b.c. (essential boundary condition)
% Set Neumann boundary conditions for every side
nmnn_bou = 1:numel(boundaries);
nmnn_bou = 1:numel(boundaries);

%%-------------------------------------------------------------------------
% Precompute matrices
Expand Down Expand Up @@ -173,7 +173,7 @@
[u_n1, udot_n1] = generalized_alpha_step(u_n, udot_n, dt, a_m, a_f, gamma, mu, dmu, ...
mass_mat, lapl_mat, bnd_mat, Pen, pen_rhs, space, msh);

% check flux through the boundary
% check flux through the boundary
% flux = check_flux_phase_field(space, msh, u_n1, zeros(size(u_n1)));
% disp(strcat('flux norm =',num2str(flux)))

Expand Down Expand Up @@ -246,23 +246,22 @@
u_a, udot_a, mu, dmu);

% Convergence check
if iter == 0
if (iter == 0)
norm_res_0 = norm(Res_gl);
end
norm_res = norm(Res_gl);


if norm_res/norm_res_0 < tol_rel_res
if (norm_res/norm_res_0 < tol_rel_res)
disp(strcat('iteration n°=',num2str(iter)))
disp(strcat('norm (abs) residual=',num2str(norm_res)))
break
end
if norm_res<tol_abs_res
if (norm_res<tol_abs_res)
disp(strcat('iteration n°=',num2str(iter)))
disp(strcat('norm absolute residual=',num2str(norm_res)))
break
end
if iter == n_max_iter
if (iter == n_max_iter)
disp(strcat('Newton reached the maximum number of iterations'))
disp(strcat('norm residual=',num2str(norm_res)))
end
Expand Down
8 changes: 4 additions & 4 deletions geopdes/inst/solve/solve_cahn_hilliard.m
Original file line number Diff line number Diff line change
Expand Up @@ -254,23 +254,23 @@
u_a, udot_a, mu, dmu);

% Convergence check
if iter == 0
if (iter == 0)
norm_res_0 = norm(Res_gl);
end
norm_res = norm(Res_gl);


if norm_res/norm_res_0 < tol_rel_res
if (norm_res/norm_res_0 < tol_rel_res)
disp(strcat('iteration n°=',num2str(iter)))
disp(strcat('norm (abs) residual=',num2str(norm_res)))
break
end
if norm_res<tol_abs_res
if (norm_res<tol_abs_res)
disp(strcat('iteration n°=',num2str(iter)))
disp(strcat('norm absolute residual=',num2str(norm_res)))
break
end
if iter == n_max_iter
if (iter == n_max_iter)
disp(strcat('Newton reached the maximum number of iterations'))
disp(strcat('norm residual=',num2str(norm_res)))
end
Expand Down

0 comments on commit 455f6d9

Please sign in to comment.