Skip to content

Releases: simpeg/discretize

NumPy Build & Bug Fixes

11 Jan 00:23

Choose a tag to compare

summary of changes

This is a patch to fix a few bugs that have popped up over the last few months, as well as a single function addition to output only the model for a TreeMesh.

Also we have dropped testing of discretize on Python 2.7 as it is officially in end-of-life stage (as of January 1st, 2020).

  • From #191:
    Enables discretize to be installed on a system without NumPy present beforehand (for example when pip installing discretize).
    It also contains a small update to the curvilinear mesh view that updates that function to be in line with the other plotImage functions.

  • From #189:
    Bugfix. Slicer failed if xslice was provided without a yslice, because of wrong comparison.
    Before, if you provided a homogenous model, it looked like this:
    Selection_002
    So the colour in the xy- and xz-plots is wrong. As soon as you scroll, the colour in the yz-plot will change to the wrong colour too.
    With the bug-fix, they all get the right colour, and will remain correct if scrolling:
    Selection_001
    The bug only affects homogeneous fullspaces, which caused an issue with the range used by colorbar().

  • From #187:
    We can output models through the writeUBC method of the TreeMesh. However, we might want, for symmetry with TensorMesh, also have the writeModelUBC function, which will only write out the model.

serialization of meshes

06 Aug 23:24

Choose a tag to compare

summary of changes

  • Update instantiation of basemesh so meshes can be formed from their serialized state, e.g.

    mesh = discretize.BaseMesh.deserialize(mesh_json)
    

    will have the value of _n stored, thus, n does not need to be provided on instantiation

  • Update the x0 property on the TreeMesh so that it goes through the

  • Allow complex scalars to return true in the isScalar util, as well as numpy.number (rather than specifically np.int, np.float)

  • Add testing on the serialization / deserialization of meshes

Tree functions

08 Jul 21:12

Choose a tag to compare

Updates

  • Several of the functions are used to integrate line source terms for FDEM.
  • The TreeCell object now exposes it's node/edge/face indices to python, a TreeCell object can be obtained by directly indexing the TreeMesh.
  • Added much documentation to the TreeMesh objects and their functions.
  • The TreeMesh plotSlice and plotGrid functions now have the same calling conventions as the respective TensorMesh functions

0.4.7

05 Jul 19:15

Choose a tag to compare

Tutorials in the discretize docs

Addition of tutorials for:

  • Mesh generation (tensor, cyl and tree)
  • Averaging and differential operators
  • Discretized approximations to inner products using finite volume (basic, constitutive relations, differential operators and an advanced section)
  • Solving PDE examples

image

Update TensorMesh-OMF interface

03 Jul 18:36

Choose a tag to compare

Overview

This release adds full support for going back and forth between OMF and discretize.TensorMesh. The OMF support implemented in a previous release only went one way (disscretize ➡️ OMF) and had a bug that messed up the spatial reference of the OMF mesh. This release makes it seamless to go back and forth (discretize ↔️ OMF). Give it a try with the new to_omf(models) method and load your TensorMeshs into other software that supports OMF (e.g. Leapfrog)!

Notes

  • At the moment, only TensorMeshs are supported by OMF
  • OMFv2 should bring more support for Curvilinear and Tree meshes. When that's released we can fill in the methods that currently raises a NotImplementedError
  • These changes makes updates to the TensorMesh-OMF interface to make going to/from OMF/discretize more fluid.

Example

import discretize
import omf
import numpy as np

# Make a TensorMesh
h = np.ones(16)
mesh = discretize.TensorMesh([h, 2*h, 3*h])
vec = np.arange(mesh.nC)
models = {'arange': vec}

# Make an OMF Element
omf_element = mesh.to_omf(models)

# Use OMF to save that element to an OMF project
proj = omf.Project(
    name='My project',
    description='The most awesome project I have ever worked '\
                'on and this is a lengthy description of how '\
                'awesome it is.',
)

# Add the volume element
proj.elements = [omf_element,]

# Verify all is good
assert proj.validate()

# Write it out
omf.OMFWriter(proj, 'myproject.omf')

And now you can use the .omf project file with your tensor mesh or many tensor meshes in your favorite software that supports OMF (e.g. Leapfrog).

Or you could verify this all worked with omfvista:

import omfvista
foo = omfvista.load_project('myproject.omf')
foo.plot()

Make matplotlib a soft dependency

28 Jun 17:26

Choose a tag to compare

Make matplotlib a soft dependency; reasoning:

  • it is "only" used for the plotting of meshes, which is sort of a relatively small (yet important) part of the whole discretize scope.
  • it would help to install discretize on minimal conda-environments for running models on a server, without having to install matplotlib.

This is achieved by

  • using a decorator on functions where matplotlib is required
  • removing matplotlib from the setup.py

`plot_3d_slicer` improvements; `refine_mesh_xyz` bug fix; `VTK` interaction improvements

23 May 17:46

Choose a tag to compare

Commits: @dccowan ; @prisae ; @banesullivan ; @lheagy
Reviewers: @lheagy ; @thast

Merged from PR #159 #160 #163 #166

  • Add (x,y,z)lim to limit the axis. It works with the interactive tools and the home-button will reset to the provided limits. Resolves #165.

Peek 2019-05-21 08-25

  • Fix Broken Example: plot_3d_slicer

  • Fix refine_mesh_xyz for Tree mesh class

  • Change model array shape check for VTK mixin: It must be an array of size nC

PyVista updates & deploy docs to GitHub Pages

15 May 00:44

Choose a tag to compare

Changes

  • Update discretize to work with PyVista (previously vtki)
  • Enable the PyVista 3D visualization examples to be run when making the docs on CI services
  • Switch the documentation hosting service to GitHub Pages from Read The Docs
  • New InterfaceOMF mixin for converting discretize meshes to Open Mining Format (OMF) objects
  • pep8 refactoring of mixins
  • Drop Windows testing on Python 3.5

Add representation methods for `TensorMesh`

26 Apr 23:16

Choose a tag to compare

This PR adds html and non-html representations which should be more generally applicable, for small and big TensorMesh's.

Based on work by @banesullivan on vtki and @prisae on the printversion-tool.

Selection_001

Tree mesh refinement

22 Apr 22:19

Choose a tag to compare

Tree Mesh updates

  • Add functionality for TreeMesh creation
  • General bug fix on refine function

Docs

  • typo fix in the installation from source