changeset 960:ac566f3dc9b3 feature/poroelastic

Add type to Elastic2dVariable.interface
author Martin Almquist <malmquist@stanford.edu>
date Mon, 17 Dec 2018 20:06:50 -0800
parents c226fb8c2b8a
children 2efeedf8c34f
files +scheme/Elastic2dVariable.m
diffstat 1 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r c226fb8c2b8a -r ac566f3dc9b3 +scheme/Elastic2dVariable.m
--- a/+scheme/Elastic2dVariable.m	Wed Dec 05 19:30:09 2018 -0800
+++ b/+scheme/Elastic2dVariable.m	Mon Dec 17 20:06:50 2018 -0800
@@ -383,11 +383,30 @@
             end
         end
 
-        function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary)
+        % type     Struct that specifies the interface coupling.
+        %          Fields:
+        %          -- tuning:           penalty strength, defaults to 1.2
+        %          -- interpolation:    type of interpolation, default 'none'
+        function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type)
+
+            defaultType.tuning = 1.2;
+            defaultType.interpolation = 'none';
+            default_struct('type', defaultType);
+
+            switch type.interpolation
+            case {'none', ''}
+                [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,type);
+            case {'op','OP'}
+                [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type);
+            otherwise
+                error('Unknown type of interpolation: %s ', type.interpolation);
+            end
+        end
+
+        function [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,type)
             % u denotes the solution in the own domain
             % v denotes the solution in the neighbour domain
             % Operators without subscripts are from the own domain.
-            tuning = 1.2;
 
             % j is the coordinate direction of the boundary
             j = obj.get_boundary_number(boundary);
@@ -461,6 +480,10 @@
             end
         end
 
+        function [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type)
+            error('Non-conforming interfaces not implemented yet.');
+        end
+
         % Returns the coordinate number and outward normal component for the boundary specified by the string boundary.
         function [j, nj] = get_boundary_number(obj, boundary)