Skip to content

Commit

Permalink
allow point sources to use initial elements
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Apr 30, 2019
1 parent cbdcb1e commit a2dda44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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
2 changes: 1 addition & 1 deletion src/tettracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,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 a2dda44

Please sign in to comment.