Commit a3c594dd authored by Pierre Cazenave's avatar Pierre Cazenave

Change the way the open boundary nodes are obtained to match that which is in...

Change the way the open boundary nodes are obtained to match that which is in the code which generates Casename_obc.dat. This should stop problems with ordering values in the input arrays where the manner in which the list of open boundary nodes are generated in different ways resulting in different output orders
parent c1e071a9
......@@ -96,11 +96,17 @@ if f < 0
error('Problem writing to _tide_node.dat file. Check permissions and try again.')
end
% Boundary node IDs
fprintf(f, '%8d\n', numel(Mobj.obc_nodes(Mobj.obc_nodes ~= 0)));
for j = 1:length(Mobj.read_obc_nodes); % number of boundaries
for i = 1:numel(Mobj.read_obc_nodes{j})
fprintf(f, '%8i\n', Mobj.read_obc_nodes{j}(i));
end
% Get a list of the open boundary nodes. Transpose Mobj.obc_nodes so the
% order of the boundary nodes is preserved.
tmpObcNodes = Mobj.obc_nodes';
% Flip it back so it's the same shape as it would have been using the old
% code.
ObcNodes = tmpObcNodes(tmpObcNodes ~= 0)';
fprintf(f, '%8d\n', numel(ObcNodes));
for i = 1:numel(ObcNodes(i))
fprintf(f, '%8i\n', ObcNodes(i));
end
fclose(f);
......@@ -116,7 +122,7 @@ end
% Boundary element IDs
ne = Mobj.nObcElements;
fprintf(f, '%8d\n', ne);
for j = 1:length(Mobj.read_obc_nodes); % number of boundaries
for j = 1:Mobj.nObs; % number of open boundaries
for i = 1:numel(Mobj.read_obc_elements{j})
fprintf(f, '%8i\n', Mobj.read_obc_elements{j}(i));
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment