-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Japan inputs and mat2msh.m conversion utility
- Loading branch information
1 parent
94bda44
commit 942b5de
Showing
8 changed files
with
11,706 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function mat2msh(matfile) | ||
% Writes a Gmsh 2.0.8 .msh file from a .mat file | ||
|
||
% Load mesh geometry | ||
p = ReadPatches(matfile); | ||
|
||
% Initialize msh file | ||
[~, fname] = fileparts(matfile); | ||
fid = fopen([fname '.msh'], 'w'); | ||
fprintf(fid, '$MeshFormat\n2 0 8\n$EndMeshFormat\n$Nodes\n'); | ||
% Write nodes | ||
fprintf(fid, '%g\n', p.nc); | ||
fprintf(fid, '%g %g %g %g\n', [1:p.nc; p.c']); | ||
fprintf(fid, '$EndNodes\n$Elements\n'); | ||
% Write elements (triangles only) | ||
fprintf(fid, '%g\n', p.nEl); | ||
fprintf(fid, '%g %g %g %g %g %g %g %g %g\n', [1:p.nEl; repmat([2 3 0 1 0]', 1, p.nEl); p.v']); | ||
fprintf(fid, '$EndElements'); | ||
fclose(fid); | ||
fprintf(1, 'Wrote %s\n', [fname '.msh']) |
2,178 changes: 2,178 additions & 0 deletions
2,178
data/japan/All_in_Apel2006_RF_trim_Tog_Tog_sta_data.csv
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.