| 1 |
function [Ux, Uy, P, adj, nodes] = parseData(name) |
| 2 |
|
| 3 |
adj = load('cell_to_node_quad.txt') + 1; %% load node adjacency, increment by 1 for 1-based indexing |
| 4 |
nodes = load('nodes.txt'); %% load node coordinates |
| 5 |
N = 3*length(nodes); %% determine number of nodes |
| 6 |
|
| 7 |
%% Read in state |
| 8 |
state = importdata([name,'.txt']); |
| 9 |
[M,nt] = size(state); |
| 10 |
map = importdata(['map_',name,'.txt']); |
| 11 |
map = map(1:2:end)+1; |
| 12 |
[tmp, perm] = sort(map); |
| 13 |
state = state(perm,:); %% we need to permute the state according to parallel maps |
| 14 |
|
| 15 |
Ux = state(1:3:N,:); |
| 16 |
Uy = state(2:3:N,:); |
| 17 |
P = state(3:3:N,:); |