Coder Social home page Coder Social logo

meshtepologyrefactor's Introduction

Mesh Tepology Refactor

For numerical methods that require integration or interpolation on internal edges or faces (such as discontinuous Galerkin methods), it is necessary to obtain information about low-dimensional elements. This project can reconstruct information about low-dimensional elements from high-dimensional meshes. For example, in a 2D mesh, it can obtain boundary information of the elements (including nodes included in the boundary, upstream and downstream elements of the boundary, and boundary types).

The data format of the input mesh is example.dat

numNodes(size_t)
x(double) y(double) z(double)
    ...(numNodes rows)
numElements(size_t)
nodeTag(size_t) ... (numNodeTag columns)
    ...(numElements rows)

The data format of the output mesh is example.grd

numNodes(size_t)
x(double) y(double) z(double)
    ...(numNodes rows)
numEdges(size_t)
edgeStartNodeTag(size_t) edgeEndNodeTag(size_t) edgeLeftElement(size_t) edgeRightElement(size_t)
    ...(numEdges rows)
numElements(size_t)
nodeTag(size_t) ... (numNodeTag columns)
    ...(numElements rows)

The problem can be abstracted as follows. Taking a 2D mesh as an example, we can view the mesh as a graph, with mesh nodes as the vertices of the graph and mesh edges as the edges of the graph. We assign directions to the edges based on the orientation of the elements (that is, when traversing the connectivity between elements and nodes, we assign a positive direction to an edge that is encountered for the first time, assuming that all elements in the mesh are oriented consistently in either a clockwise or counterclockwise direction). This creates a directed graph, and we can obtain its adjacency matrix. By traversing the adjacency matrix, we can reconstruct the boundary information of the 2D elements.

The number of edges needs to be given in advance using the Euler formula, which is R + V - E = 2. Therefore, the number of holes in the mesh needs to be specified, which is the number of regions to be subtracted. You can understand the above formula as R_in + R_out + R_mesh + V_mesh - E_mesh = 2. For a regular mesh, R_out = 1, which means you need to input the value of R_in for the interior. The number of edges in the mesh is initialized using the above formula.

meshtepologyrefactor's People

Contributors

callm1101 avatar bcynuaa avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.