view +parametrization/old/triang_map.m @ 1039:a8ee5eca0e6c feature/burgers1d

Allow for the residual normalization function to return a vector. Also change the default normalization from normalizing on norm(u-mean(u),inf) to norm(u/2), since this proved to be better for 1d burgers
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 18 Jan 2019 09:06:20 +0100
parents 3a3cf386bb7e
children
line wrap: on
line source

% Creates a grid [X,Y] from the mapping function S at points in vectors u,v
function [X, Y] = traing_map(S,u,v)
    error('not done')
    if nargin == 2
        v = u;
    end

    if isscalar(u)
        u = linspace(0,1,u);
    end

    if isscalar(v)
        v = linspace(0,1,v);
    end

    nu = length(u);
    nv = length(v);

    X = zeros(nu,nv);
    Y = zeros(nu,nv);

    for i = 1:nu
        for j = 1:nv
            [x,y] = S(u(i),v(j));
            X(i,j) = x;
            Y(i,j) = y;
        end
    end
end