pde geometryFromEdges using geometry function no longer works in R2019b

3 次查看(过去 30 天)
I have been a PDE toolbox user of R2017a and generate geometries using geometry functions in geometryFromEdges (e.g. geometryFromEdges(model,@myGeomFun)). Upon upgrading to R2019b, code that worked well in R2017a now errors in R2019b at the generateMesh function with: Meshing failed due to invalid geometry. Each face must have a unique face ID.
My question is similar to https://www.mathworks.com/matlabcentral/answers/434745-error-meshing-2d-geometry-in-matlab-r2018a. However, that answer did not address the fundamental question, but rather provided a work-around for that specific case (when the 2nd argument is a decomposed geometry matrix generated with decsg). I am encountering the same error, but when using a geometry function. So, I cannot follow the suggestion in that answer.
When I pdegplot(model,'EdgeLabels','on','FaceLabels','on') in 2019b, all looks well with the faces labeled as normal: F1, F2, ...
In the documetation for using geometry functions, I do not see a way to explicitly alter or specify the inherent face labeling if I wanted to (and pdegplot indicates each face does have a unique ID). As far as I can tell, the face IDs are internally generated within the PDE toolbox by prepending a "F" to the region label (subdomain number). All works well in 2017b and the 2019b pdegplot shows properly constructed regions with unique face IDs, so why isn't the 2019b version of generateMesh happy?
My geometry functions are pretty complex using globals from a variety of other lengthy functions. So, I'm not inclined to try to paste it all in as sample code. I could try to fabricate a simpler case as an example if I must, but I'm hoping someone can simply provide a little insight as to the fundamental nature of the problem just based on the general description. I feel like I am missing something obvious, but keep coming up empty.
Thanks.
  2 个评论
Konstantin Kovalev
Konstantin Kovalev 2019-11-4
Hello Jeff,
Taking a look at a simplified case that results in the same error would be great. If you think you are missing something obvious, I would suggest the following:
  1. Refer to the doc page "Parametrized Function for 2-D Geometry Creation". At the top of the page, there is a table that defines rules your function handle must follow.
  2. In the row for 1 input argument, pay attention to items 3 and 4 in the return value column. When left and right regions are switched by mistake, MATLAB will throw the error message as i your question. From my experience this is the most popular mistake.
  3. If the asbove does not help, please consider providing a simplified example of your code.
Thanks,
Konstantin
Jeff A
Jeff A 2019-11-6
Yes. That is what was found to be the problem. Left and Right regions were reversed. For what ever reason R2017a and earlier still worked with them reversed, so I had never noticed I had them backwards.
Thanks,
Jeff

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geometry and Mesh 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by