-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop a new NodesArray for general polytopes #37
Comments
More than a typo, it is a missing development. The |
Ok! Then we need a not implemented error. Gridap.jl/src/RefFEs/Polytopes.jl Line 105 in 785eb61
|
I remove also the bug flag since now it is only a functionality to be added |
I'll push into master some changes that allow one to construct a grid from a polytope. From the grid one can build a triangulation as always, and from this a CellGeomap. With this CellGeomap one can map nodes from a low dim polytope to a higher dim one: t = HEX_AXIS
polytope = Polytope((t,t,t))
grid = Grid(polytope,2) # A grid formed by the faces of the hexahedron (requires a NodesArray of order 1, which should be easy to construct in general)
trian = Triangulation(grid)
quad = CellQuadrature(trian,order=2)
q = coordinates(quad) # if you replace this with the nodes on the reference face, you will be almost done for the NodesArray
phi = CellGeomap(trian)
x = evaluate(phi,q)
writevtk(grid,"grid")
writevtk(x,"x") With this, implementing a high order NodesArray for a general polytope should be easy. |
@fverdugo I have created a new method I think that with this method we can close the issue, since I could readily generate all the nodes easily. The boundary nodes will be computed with lower dimension n-faces using the previous method plus |
Great! Now, we need another method Then, we can combine the I would close the issue when everything is implemented. Makes sense, right? |
I also forgot to mention that we also need to rescale the coordinates given by Just a question @santiagobadia , the argument |
|
I have added new methods in polytope, Next, in the All these methods are being used in the Now, we can simply write
to get a P3 FE on a tet. I don't know why, but For the moment I do not have a |
In the way to eliminate NodesArrays I did some simple changes in GeometryWrappers.jl, but after them, some integration on faces tests do not work. Thus, the new version is in GeometryWrappersNew.jl and I have kept the old one with NodesArray. Is it probably related to the [-1,1] to [0,1] change? |
Yes, we have to rescale the 1d quadrature if we have not done yet so. |
Done, also in old NodesArray |
With regard to the normals, I have created a method that provides the outward normals (checked for 2 to 4D and hex and tets). |
In fact, I only need (at least for the moment) the one that provides +1/-1. So, it would be nice to have this in a separate function. Is it possible? |
Ok, added this info, now
|
@fverdugo, Nice picture ;-) I am not sure about the orientation I provide. In a first approach I used the cross product for 3D, which naturally provides the orientation I think you need. However, the cross product only works in 3D and 7D. I think we needed something more general. Instead, I decided to compute the normal vector as the However, now the concept of orientation I provide does not have much sense (I think). In DG methods you can compute everything by transforming your outward normal in the reference space to the physical one. In many situations the normal is needed (think about DG methods for Darcy or Maxwell, etc). And it can also be used for any DG methods. No additional information is needed. We can probably mathematically define the orientation you need for a general polytope and dimension and I can try to implement it. In the meantime, I think I will eliminate the orientation. |
Hi @santiagobadia, I am sitting in the train returning from valencia. I think, what we are looking for is the definition of outward normal in the sense of the divergence therorem. Do you know any statement of this theorem in arbitrary dimensions? This paper is for the stokes theorem in higher dims: |
@fverdugo there is only one outwards normal, and it is the one I provide. I think what you want is to stick a normal on a reference polytope for a face, e.g., the [1,0]x{0} segment for the faces of a square and n=[0,1]. Next map the reference face to any face and put 1 if the resulting normal points outwards and -1 if not. Is this what you need? I think we can talk next week because with the orientation array (for gluing DOFs, GPs) and the outwards normal, I believe we should be able to implement any DG method. We can probably talk to clarify it. |
@santiagobadia I have fixed the conversion of Now the following code should work p = Polytope(TET_AXIS,TET_AXIS,TET_AXIS) # Note that the first axis is TET_AXIS aswell, not HEX_AXIS as in your example
grid = Grid(p,2)
writevtk(grid,"grid") It is important to note that we need that all axis are On the other hand, I have seen that you have rescaled all domains from [-1,1] to [0,1] as we wanted. This is an important change that needs to be reflected in I close the issue. For the discussion on the normals, I have created a new issue (see issue #51), where we can continue the discussion. |
@santiagobadia
It seems that there is a problem in
NodesArray
for simplices polytopes:The length of
na.coordinates
seems to be wrong. Could you confirm that this is a bug?The text was updated successfully, but these errors were encountered: