diff +scheme/Beam.m @ 220:5df8d20281fe feature/beams

Made scheme boundary_condition return a cell array of penalties if there are several of them.
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 28 Jun 2016 13:11:14 +0200
parents d095b5396103
children 96dedf892910
line wrap: on
line diff
--- a/+scheme/Beam.m	Mon Jun 27 13:26:02 2016 +0200
+++ b/+scheme/Beam.m	Tue Jun 28 13:11:14 2016 +0200
@@ -62,7 +62,7 @@
         %       type                is a string specifying the type of boundary condition if there are several.
         %       neighbour_scheme    is an instance of Scheme that should be interfaced to.
         %       neighbour_boundary  is a string specifying which boundary to interface to.
-        function [closure, penalty_e, penalty_d] = boundary_condition(obj,boundary,type)
+        function [closure, penalty] = boundary_condition(obj,boundary,type)
             default_arg('type','dn');
 
             [e, d1, d2, d3, s] = obj.get_boundary_ops(boundary);
@@ -74,6 +74,7 @@
                     alpha = obj.alpha;
 
                     % tau1 < -alpha^2/gamma
+                    % tuning = 2;
                     tuning = 1.1;
 
                     tau1 = tuning * alpha/delt;
@@ -87,8 +88,8 @@
 
                     closure = obj.Hi*(tau*e' + sig*d1');
 
-                    penalty_e = obj.Hi*tau;
-                    penalty_d = obj.Hi*sig;
+                    penalty{1} = obj.Hi*tau;
+                    penalty{2} = obj.Hi*sig;
                 otherwise % Unknown, boundary condition
                     error('No such boundary condition: type = %s',type);
             end
@@ -106,7 +107,8 @@
             gamm_v = neighbour_scheme.gamm;
             delt_v = neighbour_scheme.delt;
 
-            tuning = 2;
+            % tuning = 2;
+            tuning = 1.1;
 
             alpha_u = obj.alpha;
             alpha_v = neighbour_scheme.alpha;