I am trying to use Mathematica's FEM capabilities, but I want to generate my own QuadElement mesh. (The key word in here is trying.)
Needs["NDSolve`FEM`"]
nx = ny = 5;
coordinates =
Flatten[ Table[{-Cos[(π/nx) i], -Cos[(π/ny) j]}, {i, 0, nx, 1}, {j, 0, ny, 1}], 1];
ToElementMesh[Rectangle[{-1, -1}, {1, 1}],
"Coordinates" -> coordinates,
"MeshElementType" -> QuadElement]["Wireframe"]
I am getting the error messages:
Unknown option Coordinates for ToElementMesh
Unknown option MeshElementsType for ToElementMesh
But both options are described in the Mathematica documentation.
Where is my mistake? Or worse, where are my mistakes? :)
Edit
While changing the code from "MeshElements"
to "MeshElementType"
, I forget the "s" at the end and wrote "MeshElementsType"
.
ToElementMesh
carefully. You are mixing function syntax with region (Rectangle
) and syntax with rules ("Coordinates"->...
and"MeshElements"->...
). $\endgroup$ – Pinti Jan 30 at 15:13"MeshElementType"
not"MeshElementsType"
. Mind the"s"
. $\endgroup$ – Henrik Schumacher Jan 30 at 15:14