Mercurial > repos > public > sbplib
changeset 899:ba10f24bf476 bcSetupExperiment
Fix the documentation of functions
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 24 Nov 2018 15:48:00 +0100 |
parents | ba037fd21e9f |
children | b45a6dcb61ac |
files | +multiblock/local2globalClosure.m +multiblock/local2globalPenalty.m +scheme/+bc/closureSetup.m +scheme/+bc/forcingSetup.m +scheme/bcSetup.m |
diffstat | 5 files changed, 25 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/+multiblock/local2globalClosure.m Thu Nov 22 07:31:42 2018 +0100 +++ b/+multiblock/local2globalClosure.m Sat Nov 24 15:48:00 2018 +0100 @@ -1,5 +1,4 @@ - -% Takes the local closure for ice or water and turns it into a closure for the whole system +% Takes the block-local closures and turns it into a global closure % local -- The local closure % div -- block matrix division for the diffOp % I -- Index of blockmatrix block
--- a/+multiblock/local2globalPenalty.m Thu Nov 22 07:31:42 2018 +0100 +++ b/+multiblock/local2globalPenalty.m Sat Nov 24 15:48:00 2018 +0100 @@ -1,4 +1,4 @@ -% Takes the local penalty for ice or water and turns it into a penalty for the whole system +% Takes the block-local penalty and turns it into a global penalty % local -- The local penalty % div -- block matrix division for the diffOp % I -- Index of blockmatrix block
--- a/+scheme/+bc/closureSetup.m Thu Nov 22 07:31:42 2018 +0100 +++ b/+scheme/+bc/closureSetup.m Sat Nov 24 15:48:00 2018 +0100 @@ -1,4 +1,15 @@ % Setup closure and penalty matrices for several boundary conditions at once. +% Each bc is a struct with the fields +% * type -- Type of boundary condition +% * boundary -- Boundary identifier +% * data -- A function_handle for a function which provides boundary data.(see below) +% Also takes S_sign which modifies the sign of the penalty function, [-1,1] +% Returns a closure matrix and a penalty matrices for each boundary condition. +% +% The boundary data function can either be a function of time or a function of time and space coordinates. +% In the case where it only depends on time it should return the data as grid function for the boundary. +% In the case where it also takes space coordinates the number of space coordinates should match the number of dimensions of the problem domain. +% For example in the 2D case: f(t,x,y). function [closure, penalties] = closureSetup(diffOp, bcs) scheme.bc.verifyFormat(bcs, diffOp);
--- a/+scheme/+bc/forcingSetup.m Thu Nov 22 07:31:42 2018 +0100 +++ b/+scheme/+bc/forcingSetup.m Sat Nov 24 15:48:00 2018 +0100 @@ -1,6 +1,17 @@ % Setup the forcing function for the given boundary conditions and data. +% Each bc is a struct with the fields +% * type -- Type of boundary condition +% * boundary -- Boundary identifier +% * data -- A function_handle for a function which provides boundary data.(see below) % S_sign allows changing the sign of the function to put on different sides in the system of ODEs. % default is 1, which the same side as the diffOp. +% Returns a forcing function S. +% +% The boundary data function can either be a function of time or a function of time and space coordinates. +% In the case where it only depends on time it should return the data as grid function for the boundary. +% In the case where it also takes space coordinates the number of space coordinates should match the number of dimensions of the problem domain. +% For example in the 2D case: f(t,x,y). + function S = forcingSetup(diffOp, penalties, bcs, S_sign) default_arg('S_sign', 1);
--- a/+scheme/bcSetup.m Thu Nov 22 07:31:42 2018 +0100 +++ b/+scheme/bcSetup.m Sat Nov 24 15:48:00 2018 +0100 @@ -1,10 +1,9 @@ -% function [closure, S] = bcSetup(diffOp, bc) % Takes a diffOp and a cell array of boundary condition definitions. % Each bc is a struct with the fields % * type -- Type of boundary condition % * boundary -- Boundary identifier % * data -- A function_handle for a function which provides boundary data.(see below) -% Also takes S_sign which modifies the sign of S, [-1,1] +% Also takes S_sign which modifies the sign of the penalty function, [-1,1] % Returns a closure matrix and a forcing function S. % % The boundary data function can either be a function of time or a function of time and space coordinates.