Skip to content
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

[feature.FEM.EdgeAndCornerConnectivity] New Feature: Edge and Vertex connectivity, needed for a FEM solver #51

Merged
merged 31 commits into from
Feb 13, 2024

Conversation

fhindenlang
Copy link
Collaborator

@fhindenlang fhindenlang commented Nov 24, 2023

We introduce a new version 1.3.0 of HOPR, where the mesh file is extended to provide element edge connectivity and element corner or "Vertex" connectivity, which is needed for (high order) Finite Element solvers.

Version 1.3.0

  • fixed 2d GMSH testcase, was failing now because all stop calls have been replaced by abort
  • read-in flag to activate FEM output via GenerateFEMConnectivity=T/F (default is F)
  • HDF5 meshfile variable names of lower versions are kept, and new ones are added for GenerateFEMConnectivity=T
    see documentation for the updated mesh format. The following changes to the meshfile are important:
    • additional information on the element level is stored in FEMElemInfo
    • edge connectivity information ( arrays EdgeInfo and EdgeConnectInfo )
    • vertex connectivity information ( arrays VertexInfo and VertexConnectInfo)
  • Visualization of FEM connectivity of the mesh in paraview:
    - DebugMesh_Faces.vtu visualizes all element faces with their element ID and uniqueFaceID.
    - DebugMesh_Edges.vtu visualizes all element edges (1D lines) with their element ID and uniqueEdgeID, and VertexIDs and their master/slave status
  • Note that the edge and vertex connectivity has been implemented only for conforming meshes. If a non-conforming mesh is found, the default GenerateFEMConnectivity=F will be used.

TODOs before merge:

  • Add read-in flag GenerateFEMConnectivity=T/Fto activate FEM output with new container FEMElemInfo in order to not change the original container ElemInfo
  • implement vertex connectivity
  • check edge+vertex connectivity implementation in simulations @OttTs
    • non-periodic
    • periodic
    • unstructured
  • Descriptions for new/changed routines
    • Short header description (do not just spell out the name of the subroutine, units for important variables if applicable)
    • Workflow
      • Short summary in the header
      • Inside the routine at the appropriate positions
  • Regression tests
    • GenerateFEMConnectivity=T/F (default is F) @fhindenlang
      • non-periodic
      • periodic
      • unstructured
      • curved $N=2,3$: Case(4) used
  • Check if all STOP additionally return != 0, replace with abort() @scopplestone
  • Remove line breaks from all abort() calls @scopplestone
  • Check correct deallocation of new pointer structures by running memory checker for leaks @kopperp
  • Remove leading white spaces from all old and new .ini files @scopplestone
  • Visualize FEM connectivity of the mesh in paraview:
    - DebugMesh_Faces.vtu visualizes all element faces with their element ID and uniqueFaceID.
    - DebugMesh_Edges.vtu visualizes all element edges (1D lines) with their element ID and uniqueEdgeID, and VertexIDs and their master/slave status

Florian Hindenlang and others added 8 commits November 22, 2023 12:02
  - build and write edge and corner connectivity for FEM solvers
  - removed unused supernode
  - added local edge pointer
…nd FEM edges, write EdgeInfo and EdgeConnectInfo to HDF5 file (to be filled)
…lled edgeInfo and edgeConnectionInfo. compiles and runs, but result not yet checked.
@fhindenlang
Copy link
Collaborator Author

Hi everbody, lets dicuss here the further developments.

project-fluxo-old and others added 6 commits November 24, 2023 16:48
… and fully periodic boundaries. This also includes edge and vertex information.
…ged a little, but still there are bugs with periodic edges and vertices...
…ult is false, such that previously running tests work. added a new tutorials folder with cases that test that new feature explicitly, and the periodic ones still fail...
…s all examples, for all kinds of periodic meshes (all internal checks go through). Output file data still need to be checked if they are correct.
- its important to check for the periodic edges, when both firstlocaledges  already exist, if they point onto the same, and if not re-pointer.
  this then makes all common periodic edges pointing to the same firstlocalEdge. all other edges are already unique, and thus always point to one firstlocaledge.
- Analogously done for the periodic vertices.
output to hdf5:
- add a FEMconnect="OFF"/"ON" variable, to be able to know if the edge and vertex connectivity has been generated and written to file (paramterflag `generateFEMconnectivity=T`)
- changed from modified ElemInfo back to original ElemInfo, moved edge and vertex offsets into a new FEMElemInfo.
- added vertex connectivity information to hdf5.
- updated the documentation of the meshformat.
@fhindenlang
Copy link
Collaborator Author

ok, so I think we have now a running version with edge and vertex connectivity.

I changed the elemInfo back to its original, and added the Flag FEMconnect="ON"/"OFF" to the hdf5 file. (Mortar meshes will still have that flag being "OFF", since mortar edges are not yet implemented!)

  • We wanted current hdf5 readers to have no problem with the eleminfo being larger.
  • DG code users can decide if they even need the FEM edge and vertex connectivity information.
  • only if FEMconnect="ON", we write the FEMElemInfo;EdgeInfo;EdgeConnectInfo;VertexInfo;VertexConnectInfo arrays to the meshfile!
    TODOS:
  • We still need (with a FEM code) if the information now given in the HDF5 file is meaningful!!

@fhindenlang
Copy link
Collaborator Author

So I added some cases for the "sphere in cube" in tutorials/4-02, which are conforming curved meshes of a box in [-1,1], and there are mulitple
cases for full/2D/1D/no periodicity.
@OttTs These meshes can be used for testing against an exact solution with dirichlet BCs.

@fhindenlang
Copy link
Collaborator Author

I also added a visualization of the FEM connectivity in vtu files:

  • DebugMesh_Faces visualizes all element faces with their element ID and uniqueFaceID.
  • DebugMesh_Edges visualizes all element edges (1D lines) with their element ID and uniqueEdgeID, and VertexIDs and their master/slave status

@fhindenlang
Copy link
Collaborator Author

opened an issue #56, since checks are failing, but not only because of the new feature. Actually, the meshdim=2d does not work in the gmsh test.

…hich fixes case tutorials/4-05. the problem was that the triangles were not created, and the fill2.5mesh did not see this. Added abort in Fill2.5 mesh, if anything else than prism or hexa are in the mesh. In the screen output for the element types, the names prism and pyramids had to be interchanged.
@fhindenlang
Copy link
Collaborator Author

I did not yet fix the FEMconnectivity cases, they seem to have a problem with periodicity...

…opr can check it. A FEM solver should run on these meshes, to be sure.
@fhindenlang
Copy link
Collaborator Author

@OttTs Now that the unstructured meshes in tutorials/4-02-unstruct_curved_FEMconnect are working, could you try to run them with your FEM solver?

@OttTs
Copy link
Collaborator

OttTs commented Feb 5, 2024

@OttTs Now that the unstructured meshes in tutorials/4-02-unstruct_curved_FEMconnect are working, could you try to run them with your FEM solver?

The meshes all seem to work. For the fully periodic case, I'm having some trouble getting the convergence test to work due to the constant offset.

@fhindenlang
Copy link
Collaborator Author

fhindenlang commented Feb 5, 2024 via email

@fhindenlang
Copy link
Collaborator Author

TITEL OF RELEASE:
Build and write FEM "Edge" and "Vertex" connectivity information (flag: GenerateFEMConnectivity=T/F, default is F). Adds new variables to existing hdf5 meshfile.

@scopplestone scopplestone changed the title New Feature: Edge and Vertex connectivity, needed for a FEM solver [feature.FEM.EdgeAndCornerConnectivity] New Feature: Edge and Vertex connectivity, needed for a FEM solver Feb 13, 2024
@scopplestone scopplestone merged commit 0a27c88 into master Feb 13, 2024
2 checks passed
@scopplestone scopplestone deleted the feature.FEM.EdgeAndCornerConnectivity branch February 13, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants