Conical Source

14 views
Skip to first unread message

Mahasweta Bhattacharya

unread,
Jun 17, 2018, 2:50:07 PM6/17/18
to iso2mes...@googlegroups.com
Dear Dr. Fang,

I want to run a simple simulation of 3 layers of skin,fat and muscle with a cone shaped source. I am adding my code snippet:
[muscle_node muscle_face muscle_elem]=meshabox([0 0 0],[60 60 30],6);
[fat_node fat_face fat_elem]=meshabox([0 0 30],[60 60 40.6],6);
[skin_node skin_face skin_elem]=meshabox([0 0 40.6],[60 60 42.1],6);
skin_elem(:,5)=1;
fat_elem(:,5)=2;
muscle_elem(:,5)=3;
[comb_node,comb_elem]=mergemesh(skin_node,skin_elem,fat_node,fat_elem,muscle_node,muscle_elem);
cfg.nphoton=1e6;
cfg.node=comb_node;
cfg.elem=comb_elem;
cfg.elemprop=cfg.elem(:,5);
cfg.elem=cfg.elem(:,1:4);
cfg.srcpos=[30 30 42.1];
cfg.srctype='cone';
cfg.srcparam1=[0.5236 0 0 0];
cfg.srcdir=[0 0 -1];
cfg.prop=[0 0 1 1;0.1875 21.8187 0 1.31;0.0918 11.9796 0 1.44;0.2039 9.7968 0 1.37]; %wavelength=680nm
cfg.tstart=0;
cfg.tend=5e-9;
cfg.tstep=5e-9;
cfg.debuglevel='TP';
newcfg=mmclab(cfg, 'prep');
flux=mmclab(newcfg);

I am getting this error: MMCLAB ERROR (1): initial element does not enclose the source! in unit tettracing.c:1257
all tetrahedra (0) labeled with -1 do not enclose the source!
Error from thread (1): initial element does not enclose the source!
all tetrahedra (0) labeled with -1 do not enclose the source!
MMCLAB ERROR (1): initial element does not enclose the source! in unit tettracing.c:1257
MMCLAB ERROR (1): initial element does not enclose the source! in unit tettracing.c:1257
Error from thread (2): initial element does not enclose the source!
Error from thread (3): initial element does not enclose the source!

My code works perfectly fine for an isotropic source. What is the parameter for the cone type source I am missing here? Any help would be greatly appreciated.
Reply all
Reply to author
Forward
0 new messages