Debian Codegraph @

packages/rol/example/PDE-OPT/0ld/elasticitySIMP_topologyOptimization/plotstate.m

raw
1 adj = load('cell_to_node_quad.txt') + 1; %% load node adjacency table, increment by 1 for 1-based indexing
2 nodes = load('nodes.txt'); %% load node coordinates
3
4 data_obj = importdata('state.txt', ' ', 2); %% we need to skip the first two lines
5 stateX = data_obj.data(1:2:end);
6 stateY = data_obj.data(2:2:end);
7 subplot(1,2,1)
8 trisurf(adj, nodes(:,1), nodes(:,2), stateX);
9 shading interp;
10 view(2);
11 axis square;
12 xlabel('x');
13 ylabel('y');
14 title('Computed displacement X');
15 subplot(1,2,2)
16 trisurf(adj, nodes(:,1), nodes(:,2), stateY);
17 shading interp;
18 view(2);
19 axis square;
20 xlabel('x');
21 ylabel('y');
22 title('Computed displacement Y');