Skip to content

Commit

Permalink
Merge pull request #2 from fangq/master
Browse files Browse the repository at this point in the history
Update MMC
  • Loading branch information
yuanyaos authored May 9, 2019
2 parents 015acd0 + a2dda44 commit d8a5744
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/simpmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,10 @@ void mesh_srcdetelem(tetmesh *mesh,mcconfig *cfg){
mesh->srcelemlen=0;
mesh->detelemlen=0;
for(i=0;i<mesh->ne;i++){
if(mesh->type[i]==-1) /*number of elements in the initial candidate list*/
if(mesh->type[i]==-1){ /*number of elements in the initial candidate list*/
mesh->srcelemlen++;
cfg->e0=(cfg->e0==0) ? i+1 : cfg->e0;
}
if(mesh->type[i]==-2){ /*number of elements in the initial candidate list*/
mesh->detelemlen++;
cfg->isextdet=1;
Expand Down Expand Up @@ -598,7 +600,7 @@ void tracer_prep(raytracer *tracer,mcconfig *cfg){
tracer_build(tracer);
else
MESH_ERROR("tracer is not associated with a mesh");
}else if(cfg->srctype==stPencil && cfg->e0>0){
}else if( (cfg->srctype==stPencil || cfg->srctype==stIsotropic || cfg->srctype==stCone || cfg->srctype==stArcSin) && cfg->e0>0){
int eid=cfg->e0-1;
float3 vecS={0.f}, *nodes=tracer->mesh->node, vecAB, vecAC, vecN;
int ea,eb,ec;
Expand Down
7 changes: 3 additions & 4 deletions src/tettracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,9 +1540,8 @@ void launchphoton(mcconfig *cfg, ray *r, tetmesh *mesh, RandType *ran, RandType
r->vec.y=stheta*sphi;
r->vec.z=ctheta;
canfocus=0;
if(cfg->srctype==stIsotropic)
if(r->eid>0)
return;
if(r->eid>0)
return;
}else if(cfg->srctype==stZGaussian){
float ang,stheta,ctheta,sphi,cphi;
ang=TWO_PI*rand_uniform01(ran); //next arimuth angle
Expand Down Expand Up @@ -1598,7 +1597,7 @@ void launchphoton(mcconfig *cfg, ray *r, tetmesh *mesh, RandType *ran, RandType

vec_mult_add(&(r->p0),&(r->vec),1.f,EPS,&(r->p0));

/*Caluclate intial element id and bary-centric coordinates*/
/*Caluclate intial element id and bary-centric coordinates for area sources - position changes everytime*/
float3 vecS={0.f}, *nodes=mesh->node, vecAB, vecAC, vecN;
int is,i,ea,eb,ec;
float bary[4]={0.f};
Expand Down

0 comments on commit d8a5744

Please sign in to comment.