Giter Club home page Giter Club logo

dhi.mesh's Introduction

DHI.Mesh

ci

This library contains data structures for easing implementing algorithms on 2D mesh type data, i.e. unstructured, triangulated data. It can contain quadrilateral elements as well as triangular elements.

From within DHI, mesh type data is present in the .mesh file and in the .dfsu files.

The following algorithms are currently implemented:

  • Searching for elements containing a point or within an extent/polygon.
  • Extract mesh boundary
  • Interpolation: Calculate values in space, interpolating based on mesh element center values.
  • Mesh-polygon intersection and element intersection weight calculations
  • Find connected sub-meshes.

Mesh Data classes

DHI.Mesh contains two basic data structures representing a mesh, MeshData and SMeshData. They represent the same mesh in two different ways.

The MeshData class represents the mesh in an object oriented manner, referencing data as objects, and representing the mesh as a set of MeshNode and MeshElement objects.

The SMeshData class represents the mesh using low-level structures as arrays to save on memory and improve performance and referencing data through indices. For big meshes, the SMeshData can often half the memory usage, and some algorithms are several times faster on SMeshData than the similar algorithm on the MeshData structure.

The recommendation is to use MeshData for building up new meshes and manipulate with the mesh geometry, and use the SMeshData for mesh processing and calculations. Not all algorithms are available for both data structures.

There are routines for easy conversion between MeshData and SMeshData, as e.g. meshData.ToSMesh() and smeshData.ToMesh().

Algorithms

Extract mesh boundary

For a given mesh, the boundary is extracted. A line for each boundary-code is returned.

Interpolation

For mesh values defined at element center, DHI.Mesh can calculate an interpolated value anywhere within the mesh. The approach is as follows:

  • Node values are calculated based on a Pseudo-Laplacian interpolation procedure.
  • for a given point, interpolation using node and element center values are applied, such that:
    • If a value in the center of an element is requested, the element center value is returned.
    • On the straight line between two element center values, linear interpolation between these two element center values are returned.
    • Left or right of this straight line between two element center values, the nearest node value is also taken into account in the interpolation, doing triangular interpolation.

This approach can be used for interpolation of data from one mesh to another. It will not apply any smoothing when interpolating to identical elements.

dhi.mesh's People

Contributors

dhijca avatar jespergr avatar larsmichael avatar marcridler avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.