COSNOV_1D : Constructs the 1D (local mesh ---> global mesh) map [nov]=cosnov_1d(npdx,ne,nov) computes the 2-indeces array nov: nov(i,ie) = is the index, with respect to global numbering, associated to node i of element ie. Input: npdx = number of nodes in one element (the same in every element) ne = number of elements nov = zeros(max(npdx),ne) Output: nov = 2-indeces array of local to global map. Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, "Spectral Methods. Fundamentals in Single Domains" Springer Verlag, Berlin Heidelberg New York, 2006.
0001 function [nov]=cosnov_1d(npdx,ne,nov); 0002 % COSNOV_1D : Constructs the 1D (local mesh ---> global mesh) map 0003 % 0004 % [nov]=cosnov_1d(npdx,ne,nov) computes the 2-indeces array nov: 0005 % nov(i,ie) = is the index, with respect to global numbering, 0006 % associated to node i of element ie. 0007 % 0008 % Input: npdx = number of nodes in one element (the same in every element) 0009 % ne = number of elements 0010 % nov = zeros(max(npdx),ne) 0011 % Output: nov = 2-indeces array of local to global map. 0012 % 0013 % 0014 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, 0015 % "Spectral Methods. Fundamentals in Single Domains" 0016 % Springer Verlag, Berlin Heidelberg New York, 2006. 0017 0018 % Written by Paola Gervasio 0019 % $Date: 2007/04/01$ 0020 0021 nov(1:npdx,1)=(1:npdx)'; 0022 k=npdx(1); 0023 for ie=2:ne 0024 k1=npdx-1; 0025 nov(1:npdx,ie)=(k:k+k1)'; k=k+k1; 0026 end