Mercurial > repos > public > sbplib
diff +scheme/+bc/bcClosureSetup.m @ 869:d356f1a22d4f bcSetupExperiment
Start organizing the code
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 07 Sep 2018 09:19:03 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+scheme/+bc/bcClosureSetup.m Fri Sep 07 09:19:03 2018 +0200 @@ -0,0 +1,13 @@ +function [closure, penalties] = bcClosureSetup(diffOp, bcs) + assertType(bcs, 'cell'); + + % Setup storage arrays + closure = spzeros(size(diffOp)); + penalties = cell(1, length(bcs)); + + % Collect closures and penalties + for i = 1:length(bcs) + [localClosure, penalties{i}] = diffOp.boundary_condition(bcs{i}.boundary, bcs{i}.type); + closure = closure + localClosure; + end +end