Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Implementing signed-distance function code directly inside Comsol
Posted 28 lug 2018, 16:36 GMT-4 Version 5.2 1 Reply
Please login with a confirmed email address before reporting spam
Good day,
Please, I need help:
I have this signed-distance function code and I need to implement it directly inside Comsol (please, note that I do not want to couple Comsol with Matlab), but I am having difficulty. How can I go about it? Thank you so much.
W=2;
H=1;
cx2 = W / 200 * [ 40 160 1 0 1 0 200 29 57.5 86 114.5 143 171.5 199 29 57.5 86 114.5 143 171.5 199 200 200 0 200 40 160];
cy2 = H / 100 * [ 0 0 25 50 75 100 25 25 25 25 25 25 25 25 75 75 75 75 75 75 75 50 100 80 80 100 100];
for i = 1 : length( cx2 )
tp( :, i ) = - sqrt ( ( x - cx2 ( i ) ) .^2 + ( y - cy2 ( i ) ) .^2 ) +H/7.6;
end;
Phi2 = -(max(tp.')).';