|
a |
|
b/Cobiveco/functions/mmg.m |
|
|
1 |
function [mesh,status,cmdout] = mmg(mesh, sol, paramString) |
|
|
2 |
|
|
|
3 |
[tmpdir,name] = fileparts(tempname); |
|
|
4 |
meshfile = sprintf('%s/%s.mesh', tmpdir, name); |
|
|
5 |
solfile = sprintf('%s/%s.sol', tmpdir, name); |
|
|
6 |
|
|
|
7 |
mmgWriteMesh(mesh, meshfile); |
|
|
8 |
mmgWriteSol(sol, solfile); |
|
|
9 |
|
|
|
10 |
mpath = fileparts(mfilename('fullpath')); |
|
|
11 |
[status,cmdout] = system(sprintf('%s/../dependencies/mmg/build/bin/mmg3d %s %s -sol %s %s', mpath, meshfile, meshfile, solfile, paramString)); |
|
|
12 |
|
|
|
13 |
mesh = struct(); |
|
|
14 |
if status==0 |
|
|
15 |
mesh = mmgReadMesh(meshfile); |
|
|
16 |
end |
|
|
17 |
|
|
|
18 |
end |