[390c2f]: / Cobiveco / functions / mmg.m

Download this file

19 lines (13 with data), 510 Bytes

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