rk4_ls; % definition of coefficients for low-storage variant of Runge-Kutta method

% lokalni reprezentace reseni
N_p = N + 1; % pocet uzlu na 1 elementu = pocet neznamych parametru (koeficientu interpol. polynomu na elementu)
N_fp = 1; % pocet uzlu na 1 hrane (v 1D je hrana bod)
N_faces = 2; % 2 hrany pro kazdy element v 1D (v 1D je element usecka a hranice jsou 2 koncove body)
NODETOL = 1e-12;

N_v = size(P,2); % pocet uzlu v siti
K = size(E,2); % pocet elementu v siti

r = GaussLobattoNodes(N_p); % uzly Gauss-Lobattovovy integracni formule

V = VandermondeMatrix1D(N,r); invV = inv(V);
M = invV' * invV; invM = V * V';
D_r = DiffMatrix1D(N,r,V);
LIFT = Lift1D();

v_1 = E(1,:); v_2 = E(2,:);
x = ones(N_p,1) * P(v_1) + 0.5 * (r + 1)' * (P(v_2) - P(v_1)); % matice N_p x K obsahujici souradnice uzlu

[r_x,J] = GeometricFactors1D(x,D_r);

Fmask = [1 N_p];
Fx = x(Fmask,:); % matice K x 2 obsahujici koncove body elementu

n_x = Normals1D();
Fscale = r_x(Fmask,:);

[EtoE,EtoF] = Connectivity1D(E);

[vmapM,vmapP,mapB,vmapB] = BuildMaps1D();
