Code Monkey home page Code Monkey logo

jigsaw-geo-matlab's Introduction

JIGSAW(GEO): Mesh generation for geoscientific modelling

JIGSAW(GEO) is a set of algorithms designed to generate unstructured grids for geoscientific modelling. Applications include: large-scale atmospheric simulation and numerical weather prediction, global and coastal ocean-modelling, and ice-sheet dynamics.

JIGSAW(GEO) can be used to produce high-quality 'generalised' Delaunay / Voronoi tessellations for unstructured finite-volume / element type models. Grids can be generated in local two-dimensional domains, and over general spheroidal surfaces. Mesh resolution can be adapted to follow complex user-defined metrics, including: topographic contours, discrete solution profiles or coastal features. This enables the construction of complex, multi-resolution climate process models, with simulation fidelity enhanced in regions of interest.

JIGSAW(GEO) is typically able to produce the very high-quality staggered unstructured grids required by contemporary unstructued general circulation models (i.e. MPAS, COMPAS, FESOM, etc), generating highly optimised, multi-resolution meshes that are locally-orthogonal, mutually-centroidal and self-centred.

JIGSAW(GEO) depends on the JIGSAW-MATLAB package; a MATLAB / OCTAVE interface to the underlying JIGSAW meshing library.

Quickstart

JIGSAW(GEO) requires the JIGSAW meshing package be installed and available on the MATLAB / OCTAVE path. JIGSAW's MATLAB / OCTAVE interface is available here. Once installed, the test problems can be run via:

Clone/download + unpack this repository.
From MATLAB / OCTAVE:
Ensure JIGSAW-MATLAB is installed and available on the path.
Run example.m

Note: installation of JIGSAW requires a c++ compiler and the cmake utility. JIGSAW may also be installed as a conda package. See here for details.

Example Problems

The following set of example problems are available in example.m:

example(1); % generate a uniform resolution global grid
example(2); % generate a regionally-refined global grid
example(3); % build smooth mesh-spacing functions from noisy input data
example(4); % generate a complex, variable resolution global grid
example(5); % generate structured icosahedral and cubedsphere meshes
example(6); % generate a coastal mesh for the Australasian region
example(7); % generate a multi-part mesh for the (contiguous) USA

Additional material and discussion can be found in the worked examples here.

License

This program may be freely redistributed under the condition that the copyright notices (including this entire header) are not removed, and no compensation is received through use of the software. Private, research, and institutional use is free. You may distribute modified versions of this code UNDER THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution of this code as part of a commercial system is permissible ONLY BY DIRECT ARRANGEMENT WITH THE AUTHOR. (If you are not directly supplying this code to a customer, and you are instead telling them how they can obtain it for free, then you are not required to make any arrangement with me.)

DISCLAIMER: Neither I nor: Columbia University, the Massachusetts Institute of Technology, the University of Sydney, nor the National Aeronautics and Space Administration warrant this code in any way whatsoever. This code is provided "as-is" to be used at your own risk.

References

There are a number of publications that describe the algorithms used in JIGSAW(GEO) in detail. Additional information and references regarding the formulation of the underlying JIGSAW mesh-generator can also be found here. If you make use of JIGSAW in your work, please consider including a reference to the following:

[1] - Darren Engwirda: Generalised primal-dual grids for unstructured co-volume schemes, J. Comp. Phys., 375, pp. 155-176, https://doi.org/10.1016/j.jcp.2018.07.025, 2018.

[2] - Darren Engwirda: JIGSAW-GEO (1.0): locally orthogonal staggered unstructured grid generation for general circulation modelling on the sphere, Geosci. Model Dev., 10, pp. 2117-2140, https://doi.org/10.5194/gmd-10-2117-2017, 2017.

[3] - Darren Engwirda, David Ivers, Off-centre Steiner points for Delaunay-refinement on curved surfaces, Computer-Aided Design, 72, pp. 157-171, http://dx.doi.org/10.1016/j.cad.2015.10.007, 2016.

[4] - Darren Engwirda: Multi-resolution unstructured grid-generation for geophysical applications on the sphere, Research note, Proceedings of the 24th International Meshing Roundtable, https://arxiv.org/abs/1512.00307, 2015.

[5] - Darren Engwirda, Locally-optimal Delaunay-refinement and optimisation-based mesh generation, Ph.D. Thesis, School of Mathematics and Statistics, The University of Sydney, http://hdl.handle.net/2123/13148, 2014.

jigsaw-geo-matlab's People

Contributors

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jigsaw-geo-matlab's Issues

conda-forge jigsaw not playing nice with jigsaw.m

When I install the jigsaw conda package, I now have jigsaw and tripod in my path. However, when I try to call jigsaw.m, I get:

error: JIGSAW's executable not found -- has JIGSAW been compiled from src?

The problem seems to be 2-fold. First, the expectation is that jigsaw is installed locally rather than in my path, whereas I would think the first place to look would be in my path:
https://github.com/dengwirda/jigsaw-geo-matlab/blob/master/jigsaw.m#L280-L281
Second, the file naming convention seems to be different than what the conda package produces (here's there's a 64d or 64r appended).

I presume there is plan to update this repo following the 0.9.10 release, and I wanted to just point out this issue to make sure it's part of such an update.

proper system installation scripts

As I work on #12, I am realizing that it would be simplest to separate the python wrapper from the library itself.

What would be ideal would be for this package to have a standard build process to install both the executable and the libraries in a system-wide location via make install. Then the cython code could link to those libraries and not have to worry about hacking the linking process.

Is this something you would consider providing?

Incorrect number of mesh points in output file

Using: jigsaw-geo64r.exe
downloaded from archive: dengwirda-jigsaw-geo-matlab-66d396d (zenodo)

Running the example for the uniform geo mesh at 150, 30, 20, 10km spacings, the number of points specified in the output file (points=N) does not match the actual number of points listed in the text file. Not sure if there is a similar problem with the listed number of triangles.

cython wrappers for python?

Hi @dengwirda...just getting up to speed on jigsaw. Thanks for this amazing package!

Us python users would love a python API to jigsaw-geo. Wrapping c++ libraries for python is very common and easy to do thanks to cython. Here are some instructions on how this works:
https://github.com/cython/cython/wiki/WrappingCPlusPlus

I'm wondering if you have considered doing this or if someone else has done it already. @toddringler mentioned that they use python to interact with jigsaw. I would consider spending some time on it myself, but I don't want to repeat effort that has already been done elsewhere.

Thanks again for contributing this fantastic tool to our community.

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.