Home > src > matlab > robinBC2D.m

robinBC2D

PURPOSE ^

Returns a two-dimensional mimetic boundary operator that

SYNOPSIS ^

function BC = robinBC2D(k, m, dx, n, dy, a, b)

DESCRIPTION ^

 Returns a two-dimensional mimetic boundary operator that 
 imposes a boundary condition of Robin's type

 Parameters:
                k : Order of accuracy
                m : Number of cells along x-axis
               dx : Step size along x-axis
                n : Number of cells along y-axis
               dy : Step size along y-axis
                a : Dirichlet Coefficient
                b : Neumann Coefficient
 ----------------------------------------------------------------------------
 SPDX-License-Identifier: GPL-3.0-or-later
 © 2008-2024 San Diego State University Research Foundation (SDSURF).
 See LICENSE file or https://www.gnu.org/licenses/gpl-3.0.html for details.
 ----------------------------------------------------------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function BC = robinBC2D(k, m, dx, n, dy, a, b)
0002 % Returns a two-dimensional mimetic boundary operator that
0003 % imposes a boundary condition of Robin's type
0004 %
0005 % Parameters:
0006 %                k : Order of accuracy
0007 %                m : Number of cells along x-axis
0008 %               dx : Step size along x-axis
0009 %                n : Number of cells along y-axis
0010 %               dy : Step size along y-axis
0011 %                a : Dirichlet Coefficient
0012 %                b : Neumann Coefficient
0013 % ----------------------------------------------------------------------------
0014 % SPDX-License-Identifier: GPL-3.0-or-later
0015 % © 2008-2024 San Diego State University Research Foundation (SDSURF).
0016 % See LICENSE file or https://www.gnu.org/licenses/gpl-3.0.html for details.
0017 % ----------------------------------------------------------------------------
0018 
0019     % 1-D boundary operator
0020     Bm = robinBC(k, m, dx, a, b);
0021     Bn = robinBC(k, n, dy, a, b);
0022     
0023     Im = speye(m+2);
0024     
0025     In = speye(n+2);
0026     In(1, 1) = 0;
0027     In(end, end) = 0;
0028     
0029     BC1 = kron(In, Bm);
0030     BC2 = kron(Bn, Im);
0031     
0032     BC = BC1 + BC2;
0033 end

Generated on Tue 18-Mar-2025 18:53:27 by m2html © 2003-2022