I am trying to solve the one-dimensional wave equation with a frequency dependent source function over three intervals with varying velocity. I need to refine the mesh over the low velocity regions when the wavelength becomes shorter. The documentation for DiscretizeRegion shows how to do this for the left half of a linear region using step functions, but this MeshRefinementFunction does not work for ToElementMesh.
DiscretizeRegion[RegionUnion[Line[{{0}, {1.8}}], Line[{{1.8}, {2.2}}],
Line[{{2.2}, {4}}]], MeshRefinementFunction -> Function[{v, Len}, If[Max[v]
>= 2, Len > 0.003, Len > 0.5]]]
Can you help?
Thanks, Ken