forked from InverseLight/ValoMC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exportMMC.m
37 lines (35 loc) · 948 Bytes
/
exportMMC.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function exportMMC(vmcmesh, mmc_suffix)
%EXPORTMMC Export the mesh for mesh-based Monte Carlo (MMC) software suite
%
% DESCRIPTION:
%
% Exports the mesh for mesh-based Monte Carlo by Fang et
% al.
%
% NOTE:
%
% This is a simple wrapper but could be extended in the future to
% export also the optical coefficients if there is a need for such
% functionality
%
% USAGE:
%
% exportMMC(vmcmesh, vmcmedium, mmc_suffix)
% exportMMC(vmcmesh, vmcmedium, 'mymesh')
%
% INPUT:
%
% vmcmesh - mesh structure for ValoMC
% vmcmedium - medium for ValoMC
% mmc_suffix - prefix to be used in MMC, e.g. node_{prefix}.dat
%
% This function provided with ValoMC
mmcinstalled = exist('savemmcmesh');
if(~mmcinstalled)
error('Could not detect MMC')
end
if(size(vmcmesh.H,2) ~= 4)
error('2d not supported')
end
savemmcmesh(mmc_suffix,vmcmesh.r,vmcmesh.H);
end