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.

Best way to define the characteristic/indicator function of a square?

Please login with a confirmed email address before reporting spam

Hi,

I was wondering if there is not a better way (shorter) to define a characteristic/indicator function of a square/cube than with the function "flc1hs". Indeed, when I use flc1hs (or one of his declination i.e flc2hs) in 2d or 3d and for my specific problem, I got a lot of these functions.

Example in 2d : Let's say that we want to implement the indicator function of , I write flc1hs(x-0.2,0.01)* flc1hs(0.4-x,0.01)* flc1hs(y,0.01)* flc1hs(0.2-y,0.01).

Thanks


1 Reply Last Post 2019/05/08 17:06 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019/05/08 17:06 GMT-4

I have not tested it, but doesn't this achieve the same result?

flc1hs( (x-x_a)*(x_b-x)*(y-y_a)*(y_b-y), d)

for with a smoothing scale

I have not tested it, but doesn't this achieve the same result? flc1hs( (x-x_a)*(x_b-x)*(y-y_a)*(y_b-y), d) for x \in [x_a, x_b] ; y \in [y_a, y_b] with a smoothing scale d

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.