Mercurial > repos > public > sbplib
changeset 708:acb58769610e feature/quantumTriangles
fixed error in diffOp
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Tue, 21 Nov 2017 16:51:51 +0100 |
parents | 0de70ec8bf60 |
children | f004b9e9d17a |
files | +multiblock/DiffOpTimeDep.m +scheme/Schrodinger2dCurve.m |
diffstat | 2 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/+multiblock/DiffOpTimeDep.m Fri Nov 10 14:22:56 2017 +0100 +++ b/+multiblock/DiffOpTimeDep.m Tue Nov 21 16:51:51 2017 +0100 @@ -177,9 +177,11 @@ for i = 1:length(boundary) - [closurePart, penaltyPart] = obj.boundary_condition(boundary{i}, type); - closure{i,i} = @(t)closure{i,i}(t) + closurePart(t); - penalty{i,i} = @(t)penalty{i,i}(t) + penaltyPart(t); + boundaryPart = boundary{i}; + block = boundaryPart{1}; + [closurePart, penaltyPart] = obj.boundary_condition(boundaryPart, type); + closure{block,block} = @(t)closure{block,block}(t) + closurePart(t); + penalty{block,block} = @(t)penalty{block,block}(t) + penaltyPart(t); end otherwise error('Unknown boundary indentifier')
--- a/+scheme/Schrodinger2dCurve.m Fri Nov 10 14:22:56 2017 +0100 +++ b/+scheme/Schrodinger2dCurve.m Tue Nov 21 16:51:51 2017 +0100 @@ -211,10 +211,9 @@ % neighbour_boundary is a string specifying which boundary to interface to. function [closure, penalty,closureHamiltonian,penaltyHamiltonian] = boundary_condition(obj, boundary,~) [e, d_n, d_t, coeff_t, coeff_n s, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t,g] = obj.get_boundary_ops(boundary); - a_t = @(t) spdiag(coeff_t(t)); a_n = @(t) spdiag(coeff_n(t)); - + boundary F = @(t)(s * a_n(t)*d_n' + s * a_t(t) *d_t')'; tau1 = 1; @@ -258,8 +257,10 @@ penalty_parameter_3 = @(t) halfnorm_inv_u_n * e_u * (gamm(t) ); - closure =@(t) sqrt(Ji_u)*obj.c^2 * ( penalty_parameter_1(t)*e_u' + penalty_parameter_2(t)*F_u(t)' + penalty_parameter_3(t)*e_u')*sqrt(Ji_u); - penalty =@(t) sqrt(Ji_u)*obj.c^2 * ( -penalty_parameter_1(t)*e_v' - penalty_parameter_2(t)*F_v(t)' - penalty_parameter_3(t)*e_v')*sqrt(Ji_v); + closure =@(t) sqrt(Ji_u)*obj.c^2 * ( penalty_parameter_1(t)*e_u'... + + penalty_parameter_2(t)*F_u(t)' + penalty_parameter_3(t)*e_u')*sqrt(Ji_u); + penalty =@(t) sqrt(Ji_u)*obj.c^2 * ( -penalty_parameter_1(t)*e_v'... + - penalty_parameter_2(t)*F_v(t)' - penalty_parameter_3(t)*e_v')*sqrt(Ji_v); end