Debian Codegraph @

packages/rol/example/PDE-OPT/nonlinear-elliptic/plotresults.m

raw
1 adj = load('cell_to_node_quad.txt') + 1; %% load node adjacency table, increment by 1 for 1-based indexing
2
3 nodes = load('nodes.txt'); %% load node coordinates
4
5 data_obj = importdata('state.txt', ' ', 2); %% we need to skip the first two lines
6 state = data_obj.data;
7 subplot(1,2,1)
8 trisurf(adj, nodes(:,1), nodes(:,2), state);
9 shading interp;
10 view(0,90)
11 axis square
12
13 data_obj = importdata('control.txt', ' ', 2); %% we need to skip the first two lines
14 control = data_obj.data;
15 subplot(1,2,2)
16 trisurf(adj, nodes(:,1), nodes(:,2), control);
17 shading interp;
18 view(0,90)
19 axis square