diff +scheme/+bc/forcingSetup.m @ 1331:60c875c18de3 feature/D2_boundary_opt

Merge with feature/poroelastic for Elastic schemes
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 10 Mar 2022 16:54:26 +0100
parents a52033540dd9
children
line wrap: on
line diff
--- a/+scheme/+bc/forcingSetup.m	Thu Feb 17 18:55:11 2022 +0100
+++ b/+scheme/+bc/forcingSetup.m	Thu Mar 10 16:54:26 2022 +0100
@@ -22,8 +22,14 @@
 
     [gridData, symbolicData] = parseAndSortData(bcs, penalties, diffOp);
 
-    % Setup penalty function
-    O = spzeros(size(diffOp),1);
+    if length(gridData) + length(symbolicData) == 0
+        S = [];
+    else
+        % Setup penalty function
+        O = spzeros(size(diffOp),1);
+        S = @S_fun;
+    end
+
     function v = S_fun(t)
         v = O;
         for i = 1:length(gridData)
@@ -36,7 +42,6 @@
 
         v = S_sign * v;
     end
-    S = @S_fun;
 end
 
 % Go through a cell array of boundary condition specifications and return cell arrays