decsg function input ns (name-space matrix) is unclear
12 views (last 30 days)
Show older comments
I read the documentation on the descg function https://www.mathworks.com/help/pde/ug/decsg.html and it is still unclear for me how to manually input the 3rd variable, named ns (name-space matrix).
From the description:
Name-space matrix, specified as a matrix of double-precision numbers. The number of columns corresponds to the number of shapes used to construct the geometry. Each column in ns contains a sequence of characters padded with spaces. Each character column assigns a name to the corresponding geometric object in gd, so you can refer to a specific object in gd in the set formula sf.
So my first confusion is that it is a matrix of double-precision numers, but later describes that each column contains sequences of characters. So I'm completely lost on what the input should be here.
The explanation by example that is given on the documentations suggests to use the PDE Modeler app and then export the drawn geometry. I did it just to check what the matrix ns is in a particular example, and I couldn't understand what it's values represent and how to define it directly for any other example.
This is the particular example I considered:
pderect([0,1,0,1])
pdecirc(1,1,0.5)
pdecirc(0.75,0.25,0.125)
pdecirc(0.25,0.75,0.125)
In which I manually substracted the circles to the square, (i.e. it is a square with two perforations and a corner chopped away).
Then, when observing the exported variables, I see that
ns =
83 67 67 67
81 49 50 51
49 0 0 0
From which I cannot draw a conclusion about ns.
0 Comments
Answers (1)
Matthew Haynes
on 9 Oct 2020
I am sure you have found the solution by now, but for those who stumble upon this and need a solution a worked example can be found at:
https://uk.mathworks.com/help/pde/ug/pde.pdemodel.geometryfromedges.html
0 Comments
See Also
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!