psn_2d_mex.m

来自「Finite Volume Poisson PDE Solver」· M 代码 · 共 47 行

M
47
字号
% C MEX-DLL for Matlab.Provides a solution for 2D Poisson equation in matter
%
% SYNTAX:
%   [U,<OUTPARAM>]=psn_2d_mex(INPPARAM, V,<E>)
%
% INPUT ARGUMENTS:
%   INPPARAM - vector of parameters
%   V - matrix of sharge density.
%     Internal Nx*Ny elements contains density,
%      Boudary rows & columns - values of vectors Gamma
%      for mixed boundary conditions
%   E - optional matrix of permittivity valuse e(i,j)
%
% OUTPUT PARAMETERS:
%   U matrix of result potential
%   OUTPARAM - optional output parameters
%
% INPPARAM LIST (indexes in INPPARAM vector follow position in enum):
% enum INPPARAM {
%    INP_NX,        //Number of INTERIOR points in X-dirextion
%    INP_NY,        //Number of INTERIOR points in Y-dirextion
%    INP_LX,        //X-size
%    INP_LY,        //Y-size
%    INP_GRID,      //Grid: 0-standard, 1 - centered
%    INP_METHOD,    //Solving method from PSN_METHODS
%    INP_TOL,       //Tolerance
%    INP_MAXSTEP,   //Max steps
%    INP_CRD,       //Coord type: 0-cartesian, 1-cylindrical
%
%    //Boundary conditions
%    INP_ALPHAX0,
%    INP_ALPHAX1,
%    INP_BETAX0,
%    INP_BETAX1,
%    INP_ALPHAY0,
%    INP_ALPHAY1,
%    INP_BETAY0,
%    INP_BETAY1
% };
%
% OUTPARAM LIST:
% enum OUTPARAM {
%    OUT_ERROR,       //resulting error
%    OUT_NUMSTEP,     //Number of iteration steps
% };
[U,OUTPARAM]=function psn_2d_mex(INPPARAM, V,E)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?