Coder Social home page Coder Social logo

libdistmesh's Introduction

libDistMesh: A Simple Mesh Generator in C++

libDistMesh is a C++ implementation of the original DistMesh algorithm for generating unstructured triangular and tetrahedral meshes using signed distance functions.

Getting Started

Simply clone the repository, make sure all dependencies are installed and build it.

cp Makefile.config.example Makefile.config
make
make install

Example

  • Uniform Mesh on Unit Circle:
#include <distmesh/distmesh.h>

int main() {
    // create mesh
    auto const mesh = distmesh::distmesh(distmesh::distanceFunction::circular(1.0), 0.2);

    return 0;
}
  • Rectangle with circular hole, refined at circle boundary:
#include <distmesh/distmesh.h>

int main() {
    // fixed points at the corners of domain to guarantee convergence
    Eigen::ArrayXXd fixedPoints(4, 2);
    fixedPoints << -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0;

    // create mesh
    auto const mesh = distmesh::distmesh(
        distmesh::distanceFunction::rectangular(rectangle)
            .max(-distmesh::distanceFunction::circular(0.5)),
        0.05, 0.05 + 0.3 * distmesh::distanceFunction::circular(0.5),
        distmesh::utils::boundingBox(2), fixedPoints);

    return 0;
}

Dependencies

libDistMesh uses some C++11 features and compiles properly with both clang and gcc. For linear algebra operations and the delaunay triangulation two libraries are needed for building and using libDistMesh:

References

The DistMesh algorithm is described in the following two references. If you use the algorithm in a program or publication, please acknowledge its authors by adding a reference to the first paper below.

libdistmesh's People

Contributors

pgebhardt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libdistmesh's Issues

How to compile this program in visual studio 2010

Hi:
I'd like to compile this program in visual studio 2010. However, when I use 'nmake' to compile this Makefile, an fatal error u1033 occured and syntax error ; '=' unexpected. So, how can I solve this problem?

Thank you very much

undefined reference to "qh_qh"/"qh_save_qhull"

Hi there,

I am trying to compiling the code with the latest qhull and eigen. I can use "make" and "make install" to compile the code without error. However, when i use "make examples", it gives the error below:

build/release/.../lib/libdistmesh.so: undefined reference to 'qh_qh'
build/release/.../lib/libdistmesh.so: undefined reference to 'qh_save_qhull'

Any idea about why this happened?

Thanks

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.