Skip to content

Commit

Permalink
Merge pull request #3 from frodal/develop
Browse files Browse the repository at this point in the history
Fixed distribute elements in grains for rod like structures
  • Loading branch information
frodal authored Oct 1, 2022
2 parents 32867fe + 08d1282 commit f38794e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/distributeElementsInGrains.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@

if id<=length(element)
for el=element{id}
i=ceil((elementCenter{id,el}(1)-partMinCoordinate{id}(1))/grainSize(1));
j=ceil((elementCenter{id,el}(2)-partMinCoordinate{id}(2))/grainSize(2));
if N(1)>1
i=ceil((elementCenter{id,el}(1)-partMinCoordinate{id}(1))/grainSize(1));
else
i=1;
end
if N(2)>1
j=ceil((elementCenter{id,el}(2)-partMinCoordinate{id}(2))/grainSize(2));
else
j=1;
end
if N(3)>1
k=ceil((elementCenter{id,el}(3)-partMinCoordinate{id}(3))/grainSize(3));
else
Expand Down

0 comments on commit f38794e

Please sign in to comment.