Hi,
I would like to share a code, which produce a perfect (to my opinion) mesh of a multilayered sphere (or cylinder), which I am going to use for solving Mie scattering problem. It works fine for 2D and 3D, see the attached screenshots for initial mesh and two global refinements. It takes radii of boundaries (the last one is the outer radius of the mash) as a vector of doubles, e.g. std::vector<double> radii = {0.2, 0.3, 0.9, 1.0} used for screenshots. The produced grid is coarse, however, layers boundaries are formed exactly with mesh faces. This code can also be used to produce a nice mesh for step-6 with radii = {0.3, 0.5, 1.0}
The code uses anisotropic mesh refinement to produce as coarse mesh as possible (I was not able to deal with creation of a good mesh from a set of points, vertices numbering is too complicated for me). It can be useful both for beginners as an example of grid creation with scaling and manifold and for advanced users as a common code ready to go. It will be nice if this code can be distributed along with Deal II examples, e.g. as a recipe in Deal II cookbook (at the moment the only type of example is a step from tutorial, my source looks to be too simple to for a full tutorial step. However, this can save some time for a person, who need to create a mesh for parametric model in deal.ii). I should note that multilayer spherical particles have various applications in cancer treatment, medical diagnostics, cloaking and plasmonic devices, in the study of thermal properties of insulating materials, as well as for improving solar cells performance, etc. This way the code can be useful for a quite large community.
Best regards,
Kostya