Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fvcom-toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
fvcom-toolbox
Commits
a803c047
Commit
a803c047
authored
Jan 27, 2017
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Require a depth value when writing to SMS format.
parent
fad83e23
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
utilities/write_SMS_2dm.m
utilities/write_SMS_2dm.m
+6
-4
No files found.
utilities/write_SMS_2dm.m
View file @
a803c047
function
write_SMS_2dm
(
file
,
tri
,
x
,
y
,
bnd
)
function
write_SMS_2dm
(
file
,
tri
,
x
,
y
,
z
,
bnd
)
% Output an SMS 2dm ASCII file from the triangulation given by tri, x and
% y.
%
...
...
@@ -12,6 +12,7 @@ function write_SMS_2dm(file, tri, x, y, bnd)
% file - file name to save to.
% tri - triangulation matrix of the nodes in x and y.
% x, y - coordinate pairs for the unstructured grid.
% z - array of matching length with x and y of depth values.
% bnd - [optional] cell array of open boundary node ids to create node
% strings in SMS.
%
...
...
@@ -26,6 +27,7 @@ function write_SMS_2dm(file, tri, x, y, bnd)
%
% Revision history:
% 2013-03-11 First version.
% 2017-01-27 Change the arguments to use a z value too.
%
%==========================================================================
...
...
@@ -59,12 +61,12 @@ end
% Add the list of nodes
for
n
=
1
:
nn
fprintf
(
f
,
'ND %i %.8e %.8e %.8e\n'
,
n
,
x
(
n
),
y
(
n
),
0
);
fprintf
(
f
,
'ND %i %.8e %.8e %.8e\n'
,
n
,
x
(
n
),
y
(
n
),
z
(
n
)
);
end
% Check we've got some open boundaries and create the relevant node string
% output.
if
nargin
==
5
if
nargin
==
6
for
b
=
1
:
length
(
bnd
)
c
=
0
;
% counter for the weird nodestring format.
...
...
@@ -85,7 +87,7 @@ if nargin == 5
fprintf
(
f
,
'NS %i '
,
node_id
);
elseif
c
>
0
&&
c
<
10
fprintf
(
f
,
'%i '
,
node_id
);
elseif
c
>=
10
||
ns
==
length
(
nodestring
)
;
elseif
c
>=
10
||
ns
==
length
(
nodestring
)
fprintf
(
f
,
'%i\n'
,
node_id
);
c
=
0
;
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment