comparison +scheme/bcSetupStaggered.m @ 1280:c7f5b480e455 feature/poroelastic

Add bcSetup for staggered, where displacement and traction data must be evaluated on different grids.
author Martin Almquist <malmquist@stanford.edu>
date Sun, 07 Jun 2020 11:32:19 -0700
parents
children
comparison
equal deleted inserted replaced
1279:546ee16760d5 1280:c7f5b480e455
1 % Takes a diffOp and a cell array of boundary condition definitions.
2 % Each bc is a struct with the fields
3 % * type -- Type of boundary condition
4 % * boundary -- Boundary identifier
5 % * data -- A function_handle for a function which provides boundary data.(see below)
6 % Also takes S_sign which modifies the sign of the penalty function, [-1,1]
7 % Returns a closure matrix and a forcing function S.
8 %
9 % The boundary data function can either be a function of time or a function of time and space coordinates.
10 % In the case where it only depends on time it should return the data as grid function for the boundary.
11 % In the case where it also takes space coordinates the number of space coordinates should match the number of dimensions of the problem domain.
12 % For example in the 2D case: f(t,x,y).
13 function [closure, S] = bcSetupStaggered(diffOp, bcs, S_sign)
14 default_arg('S_sign', 1);
15 assertType(bcs, 'cell');
16 assert(S_sign == 1 || S_sign == -1, 'S_sign must be either 1 or -1');
17
18 [closure, penalties] = scheme.bc.closureSetup(diffOp, bcs);
19 S = scheme.bc.forcingSetupStaggered(diffOp, penalties, bcs, S_sign);
20 end