I have a 4D grid
l=50; Ω = Table[{(i1 - 9/10)/(2*l), (i2 - 9/10)/(2*l), (i3 - 9/10)/(2*l), (i4 - 9/10)/(2*l),
1 - (i1 - 9/10)/(2*l) - (i2 - 9/10)/(2*l) - (i3 - 9/10)/(2*l) - (i4 - 9/10)/(2*l)}, {i1, 1, 2l}, {i2, 1, 2l - i1 + 1}, {i3, 1, 2l - (i1 + i2)+2}, {i4, 1, 2l - (i1 + i2 + i3)+3}];
and I need to find an interpolating function over this grid. If I use the standard Interpolation function, I get "unstructured grid" error. To work around this problem, I've been using the following code (which I found at Interpolation on a regular square grid spanning a triangular domain) for a 3D grid
Needs["NDSolve`FEM`"]; Needs["TetGenLink`"]; tmpF2T={}; l=50; Ω = Flatten[ Table[{(i1 - 9/10)/(2*l), (i2 - 9/10)/(2*l), (i3 - 9/10)/(2*l), 1 - (i1 - 9/10)/(2*l) - (i2 - 9/10)/(2*l) - (i3 - 9/10)/(2*l)}, {i1, 1, 2l}, {i2, 1, 2l - i1 + 1}, {i3, 1, 2l - (i1 + i2)+2}], 0]; ΩSubset = DelaunayMesh[Flatten[Ω[[All, All, All, {1, 2, 3}]], 2]]; emesh = ToElementMesh[ "Coordinates" -> MeshCoordinates[ΩSubset], "MeshElements" -> {TetrahedronElement@
Pick[First@
Thread[MeshCells[ΩSubset, 3], Tetrahedron],
Unitize[Chop@
Flatten@PropertyValue[{ΩSubset, 3},
MeshCellMeasure]], 1]}]; AppendTo[tmpF2T,ElementMeshInterpolation[{emesh}, loc[[All, 1]]]];
where loc[[All, 1]] is a list of function values defined over the Ω grid. These function values are largely irrelevant for this question, and can be replaced with, say, Table[50, {i,1,Length[ΩSubset]}]. The code has been working great for 3D. It removes the problematic points that cause issues in interpolation, and then interpolation works just fine.
Now I need to do the same thing for my four dimensional grid. But, DelaunayMesh does not seem to be producing a grid in this case. So my question is, what is the right way to extend this code to four and possibly five dimensions? And should I be using "Tetrahedron" and "TetrahedronElement" for more than 3 dimensions?
Thank you.
Flatten[..., 0]in your definitions of Omega? That level specification is equivalent to no flattening at all. – MarcoB Feb 08 '16 at 05:15i2minis not defined, so the Iterator{i1,1,101-i2min}fails. In the second code section there are syntax problems. Please [edit] your question. – rhermans Feb 08 '16 at 10:03{x, y, z}x{t}interpolation; see "Transient PDEs" in http://reference.wolfram.com/language/FEMDocumentation/tutorial/FiniteElementProgramming.html – Michael E2 Feb 08 '16 at 13:47