annotate spzeros.m @ 1012:1e437c9e5132
feature/advectionRV
Create residual viscosity package +rv and generalize the ResidualViscosity class
- Generalize residual viscosity, by passing user-defined flux and calculating the time derivative outside of the update.
- Create separate RungekuttaRV specifically using interior RV updates
- Separate the artifical dissipation operator from the scheme AdvectionRV1D so that the same scheme can be reused for creating the diff op used by the ResidualViscosity class
author |
Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
date |
Wed, 05 Dec 2018 13:44:10 +0100 |
parents |
13d2f20c0c0d |
children |
|
rev |
line source |
488
|
1 function S = spzeros(varargin)
|
|
2 switch length(varargin)
|
|
3 case 2
|
|
4 S = sparse(varargin{1}, varargin{2});
|
|
5 case 1
|
|
6 v = varargin{1};
|
|
7 switch length(v)
|
|
8 case 1
|
|
9 S = sparse(v,v);
|
|
10 case 2
|
|
11 S = sparse(v(1), v(2));
|
|
12 otherwise
|
|
13 error('Input must be either one integer, two integers or a vector with two integers');
|
|
14 end
|
|
15 otherwise
|
|
16 error('Too many input arguments.');
|
|
17 end
|
|
18 end
|