Reading high-order tet mesh in Swansea format
******************* This email originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list https://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address. ******************* Dear all, I have just started studying Nektar++ for the purpose of adding a new type of element for my research. It is my pleasure to join this great user group. As a first step, I'm exploring the function for reading my mesh in Swansea .plt format, which is virtual void Nektar::NekMesh::InputSwan::Process() within file library/NekMesh/Module/InputModules/InputSwan.cpp. Some improvements have been made to the function so it successfully converts a linear .plt mesh in Swansea format to a Nektar++ .xml session file with boundary faces on each surface fall into an individual COMPOSITE. However, the function seems able to read the 3rd order tetrahedral mesh (at least for the connectivity), but the boundary faces are just linear triangles. Would the subsequent processing convert the linear faces into curved ones? In fact, the NekMesh main function will crash after a successful return from InputSwan::Process(): [InputSwan] Reading Swansea mesh file 'm6.plt' [InputSwan] # tetrahedra : 235377 [InputSwan] # points : 1079083 [InputSwan] mesh order : 3 [InputSwan] ND : 20 [InputSwan] Mesh statistics: [InputSwan] - Mesh dimension : 3 [InputSwan] - Element dimension : 3 [InputSwan] - Has CAD attached : no [InputSwan] - Node count : 41093 [InputSwan] - Edge count : 281235 [InputSwan] - Face count : 475520 [InputSwan] - Elements : 235377 [InputSwan] - Bnd elements : 9532 [InputSwan] - Number of composites : 19 [InputSwan] - Lower mesh extent : -125 0 -125 [InputSwan] - Upper mesh extent : 125 124.901 125 [InputSwan] Element counts (regular/deformed/total): [InputSwan] - Triangle : 0 9532 9532 [InputSwan] - Tetrahedron : 0 235377 235377 [InputSwan] Finished reading mesh. [InputSwan] - Element dimension : 3 [InputSwan] - Space dimension : 3 [InputSwan] - No. of nodes : 41093 [InputSwan] - No. of 3D elements : 235377 [InputSwan] - No. of boundary elements : 9532 [InputSwan] - Elapsed time: 156.314s. [OutputNekpp] Writing Nektar++ file 'm6.xml' Fatal : Level 0 assertion violation Where : /lustre/xi.zou/Documents/work_folder/nektar/nektar-v5.2.0/library/NekMesh/MeshElements/Face.cpp[79] Message : Face nodes of tensor product only supported for quadrilaterals. terminate called after throwing an instance of 'Nektar::ErrorUtil::NekError' what(): Level 0 assertion violation Where : /lustre/xi.zou/Documents/work_folder/nektar/nektar-v5.2.0/library/NekMesh/MeshElements/Face.cpp[79] Message : Face nodes of tensor product only supported for quadrilaterals. I look forward to hearing from the experts on NekMesh and a further discussion. Best regards, Xi Dr. Xi Zou xi.zou@swansea.ac.uk<mailto:xi.zou@swansea.ac.uk> Research Assistant Zienkiewicz Institute for Modelling, Data and AI Faculty of Science and Engineering Swansea University Swansea, UK
Hi Zou, It was great seeing your presentation at the IMR23 and I am glad to see you are progressing towards implementing the NEFEM work to the Nektar++ environment. I haven't used the .plt Swansea converter and without the mesh file, it will be hard to debug. I suppose only Dave can comment on the details knowing your conventions in the .plt file. Regarding your question: I don't think it is necessary to specify the High-Order(Curvature information - FaceNodes) to the boundary faces in InputSwan.cpp. I think they are reconstructed later on in the OutputNekpp.cpp(TransferCurves) module directly from the 3D element. However, you should specify this information in your 3D element in the first place. That being said, from the error message, I suspect the error comes even before this when OutputNekpp calls MakeOrder() function. The ASSERT error looks for the number of vertices you have given to the element and complains it's not 3(triangles) or 4(quads) when trying to populate the faces with FaceNodes. You can check the number of vertices for the faces in the InputSwan.cpp module and if investigate why it's not 3 or 4. Is it possible that you have specified the high-order curvature information in the VertexList instead of in the FaceNodes? This is not consistent with the NekMesh data structure conventions - Vertex -> Edge -> EdgeNodes (Edge Curvature Info)-> Face -> FaceNodes(Face Curvature Info) -> Element-> VolumeNodes (Element Curvature Info). I hope this helps. If not, I recommend trying a smaller test mesh with <10-12 elements, where we can investigate the problem with a GDB for example. Kind Regards, Kaloyan ________________________________ From: nektar-users-bounces@imperial.ac.uk <nektar-users-bounces@imperial.ac.uk> on behalf of Xi Zou <xi.zou@swansea.ac.uk> Sent: Wednesday, March 15, 2023 3:41 PM To: nektar-users <nektar-users@imperial.ac.uk> Cc: Moxey, David <david.moxey@kcl.ac.uk> Subject: [Nektar-users] Reading high-order tet mesh in Swansea format This email from xi.zou@swansea.ac.uk originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list<https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email stamping for this address. Dear all, I have just started studying Nektar++ for the purpose of adding a new type of element for my research. It is my pleasure to join this great user group. As a first step, I'm exploring the function for reading my mesh in Swansea .plt format, which is virtual void Nektar::NekMesh::InputSwan::Process() within file library/NekMesh/Module/InputModules/InputSwan.cpp. Some improvements have been made to the function so it successfully converts a linear .plt mesh in Swansea format to a Nektar++ .xml session file with boundary faces on each surface fall into an individual COMPOSITE. However, the function seems able to read the 3rd order tetrahedral mesh (at least for the connectivity), but the boundary faces are just linear triangles. Would the subsequent processing convert the linear faces into curved ones? In fact, the NekMesh main function will crash after a successful return from InputSwan::Process(): [InputSwan] Reading Swansea mesh file 'm6.plt' [InputSwan] # tetrahedra : 235377 [InputSwan] # points : 1079083 [InputSwan] mesh order : 3 [InputSwan] ND : 20 [InputSwan] Mesh statistics: [InputSwan] - Mesh dimension : 3 [InputSwan] - Element dimension : 3 [InputSwan] - Has CAD attached : no [InputSwan] - Node count : 41093 [InputSwan] - Edge count : 281235 [InputSwan] - Face count : 475520 [InputSwan] - Elements : 235377 [InputSwan] - Bnd elements : 9532 [InputSwan] - Number of composites : 19 [InputSwan] - Lower mesh extent : -125 0 -125 [InputSwan] - Upper mesh extent : 125 124.901 125 [InputSwan] Element counts (regular/deformed/total): [InputSwan] - Triangle : 0 9532 9532 [InputSwan] - Tetrahedron : 0 235377 235377 [InputSwan] Finished reading mesh. [InputSwan] - Element dimension : 3 [InputSwan] - Space dimension : 3 [InputSwan] - No. of nodes : 41093 [InputSwan] - No. of 3D elements : 235377 [InputSwan] - No. of boundary elements : 9532 [InputSwan] - Elapsed time: 156.314s. [OutputNekpp] Writing Nektar++ file 'm6.xml' Fatal : Level 0 assertion violation Where : /lustre/xi.zou/Documents/work_folder/nektar/nektar-v5.2.0/library/NekMesh/MeshElements/Face.cpp[79] Message : Face nodes of tensor product only supported for quadrilaterals. terminate called after throwing an instance of 'Nektar::ErrorUtil::NekError' what(): Level 0 assertion violation Where : /lustre/xi.zou/Documents/work_folder/nektar/nektar-v5.2.0/library/NekMesh/MeshElements/Face.cpp[79] Message : Face nodes of tensor product only supported for quadrilaterals. I look forward to hearing from the experts on NekMesh and a further discussion. Best regards, Xi Dr. Xi Zou xi.zou@swansea.ac.uk<mailto:xi.zou@swansea.ac.uk> Research Assistant Zienkiewicz Institute for Modelling, Data and AI Faculty of Science and Engineering Swansea University Swansea, UK
Hi Kaloyan, Glad to hear from you and hope you enjoyed the IMR23 workshop, too. I have attached an example of the Swansea .plt file with a simple Fortran code to create it just for your information. It is just one cubic Tet element with curved edges and faces which is light to debug. As you can visualise it with the .vtk file, the ordering of nodes we use is different from Nektar++. I have figured out the mapping and added the vid_map in the InputSwan.cpp file, as you may want to perform a diff to compare with the original. As you have pointed out, indeed the problem lies on the function TransferCurves in OutputNekpp.cpp. Here I list my analyses: 1. The MakeOrder function was not called in OutputNekpp::Process(). I suspect the configuration m_config["order"] was not defined somewhere, and will be overridden in OutputNekpp if I specified it in InputSwan. 2. The error message indicated that Face::GetCurvedNodes is not recognising the face as triangular, because the m_curveType is LibUtilities::ePolyEvenlySpaced. I am not sure how Nektar++ deals with the curved faces. Is it dealing with only the boundary faces or it also considers the interior curved faces? It would be great if you can provide me an example .xml file containing Tet elements with a curved face. Best regards, Xi From: Kirilov, Kaloyan S <kaloyan.kirilov19@imperial.ac.uk> Sent: Sunday, March 19, 2023 4:11 PM To: Xi Zou <Xi.Zou@Swansea.ac.uk>; nektar-users <nektar-users@imperial.ac.uk> Cc: Moxey, David <david.moxey@kcl.ac.uk> Subject: Re: Reading high-order tet mesh in Swansea format Hi Zou, It was great seeing your presentation at the IMR23 and I am glad to see you are progressing towards implementing the NEFEM work to the Nektar++ environment. I haven't used the .plt Swansea converter and without the mesh file, it will be hard to debug. I suppose only Dave can comment on the details knowing your conventions in the .plt file. Regarding your question: I don't think it is necessary to specify the High-Order(Curvature information - FaceNodes) to the boundary faces in InputSwan.cpp. I think they are reconstructed later on in the OutputNekpp.cpp(TransferCurves) module directly from the 3D element. However, you should specify this information in your 3D element in the first place. That being said, from the error message, I suspect the error comes even before this when OutputNekpp calls MakeOrder() function. The ASSERT error looks for the number of vertices you have given to the element and complains it's not 3(triangles) or 4(quads) when trying to populate the faces with FaceNodes. You can check the number of vertices for the faces in the InputSwan.cpp module and if investigate why it's not 3 or 4. Is it possible that you have specified the high-order curvature information in the VertexList instead of in the FaceNodes? This is not consistent with the NekMesh data structure conventions - Vertex -> Edge -> EdgeNodes (Edge Curvature Info)-> Face -> FaceNodes(Face Curvature Info) -> Element-> VolumeNodes (Element Curvature Info). I hope this helps. If not, I recommend trying a smaller test mesh with <10-12 elements, where we can investigate the problem with a GDB for example. Kind Regards, Kaloyan ________________________________ From: nektar-users-bounces@imperial.ac.uk<mailto:nektar-users-bounces@imperial.ac.uk> <nektar-users-bounces@imperial.ac.uk<mailto:nektar-users-bounces@imperial.ac.uk>> on behalf of Xi Zou <xi.zou@swansea.ac.uk<mailto:xi.zou@swansea.ac.uk>> Sent: Wednesday, March 15, 2023 3:41 PM To: nektar-users <nektar-users@imperial.ac.uk<mailto:nektar-users@imperial.ac.uk>> Cc: Moxey, David <david.moxey@kcl.ac.uk<mailto:david.moxey@kcl.ac.uk>> Subject: [Nektar-users] Reading high-order tet mesh in Swansea format This email from xi.zou@swansea.ac.uk<mailto:xi.zou@swansea.ac.uk> originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fspam.ic.ac.uk%2FSpamConsole%2FSenders.aspx&data=05%7C01%7CXi.Zou%40Swansea.ac.uk%7C609497e2e04a41d7346308db28948290%7Cbbcab52e9fbe43d6a2f39f66c43df268%7C0%7C0%7C638148390510918608%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LwY5k8NmJIjyxtmfHB7fcDebJhO0roJVg7dum8Ogoq4%3D&reserved=0> to disable email stamping for this address. Dear all, I have just started studying Nektar++ for the purpose of adding a new type of element for my research. It is my pleasure to join this great user group. As a first step, I'm exploring the function for reading my mesh in Swansea .plt format, which is virtual void Nektar::NekMesh::InputSwan::Process() within file library/NekMesh/Module/InputModules/InputSwan.cpp. Some improvements have been made to the function so it successfully converts a linear .plt mesh in Swansea format to a Nektar++ .xml session file with boundary faces on each surface fall into an individual COMPOSITE. However, the function seems able to read the 3rd order tetrahedral mesh (at least for the connectivity), but the boundary faces are just linear triangles. Would the subsequent processing convert the linear faces into curved ones? In fact, the NekMesh main function will crash after a successful return from InputSwan::Process(): [InputSwan] Reading Swansea mesh file 'm6.plt' [InputSwan] # tetrahedra : 235377 [InputSwan] # points : 1079083 [InputSwan] mesh order : 3 [InputSwan] ND : 20 [InputSwan] Mesh statistics: [InputSwan] - Mesh dimension : 3 [InputSwan] - Element dimension : 3 [InputSwan] - Has CAD attached : no [InputSwan] - Node count : 41093 [InputSwan] - Edge count : 281235 [InputSwan] - Face count : 475520 [InputSwan] - Elements : 235377 [InputSwan] - Bnd elements : 9532 [InputSwan] - Number of composites : 19 [InputSwan] - Lower mesh extent : -125 0 -125 [InputSwan] - Upper mesh extent : 125 124.901 125 [InputSwan] Element counts (regular/deformed/total): [InputSwan] - Triangle : 0 9532 9532 [InputSwan] - Tetrahedron : 0 235377 235377 [InputSwan] Finished reading mesh. [InputSwan] - Element dimension : 3 [InputSwan] - Space dimension : 3 [InputSwan] - No. of nodes : 41093 [InputSwan] - No. of 3D elements : 235377 [InputSwan] - No. of boundary elements : 9532 [InputSwan] - Elapsed time: 156.314s. [OutputNekpp] Writing Nektar++ file 'm6.xml' Fatal : Level 0 assertion violation Where : /lustre/xi.zou/Documents/work_folder/nektar/nektar-v5.2.0/library/NekMesh/MeshElements/Face.cpp[79] Message : Face nodes of tensor product only supported for quadrilaterals. terminate called after throwing an instance of 'Nektar::ErrorUtil::NekError' what(): Level 0 assertion violation Where : /lustre/xi.zou/Documents/work_folder/nektar/nektar-v5.2.0/library/NekMesh/MeshElements/Face.cpp[79] Message : Face nodes of tensor product only supported for quadrilaterals. I look forward to hearing from the experts on NekMesh and a further discussion. Best regards, Xi Dr. Xi Zou xi.zou@swansea.ac.uk<mailto:xi.zou@swansea.ac.uk> Research Assistant Zienkiewicz Institute for Modelling, Data and AI Faculty of Science and Engineering Swansea University Swansea, UK
participants (2)
- 
                
                Kirilov, Kaloyan S
- 
                
                Xi Zou