Mercurial > repos > public > sbplib
view +rv/+diffops/addClosuresToDiffOp.m @ 1168:af3c4eb0cbbd feature/rv
Add method for constructing diffops to multistage approach of computing the residual viscosity. Differentiate between constructDiffOpsMultiGrid and constructDiffOpsMultiStage
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 28 Jun 2019 13:12:29 +0200 |
parents | 65a577db5ca0 |
children | 79618b58b0a0 |
line wrap: on
line source
function [D, penalties] = addClosuresToDiffOp(diffOp, D, BCs) penalties = cell(size(BCs)); for i = 1:size(BCs,1) for j = 1:size(BCs,2) [closure, penalties{i,j}] = diffOp.boundary_condition(BCs{i,j}.boundary, BCs{i,j}.type); if ~isa(closure, 'function_handle') closure = @(v) closure*v; end D = @(v) D(v) + closure(v); end end end