Discretize

Latest version: v0.10.0

Safety actively analyzes 641082 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 9

0.4.9

- from pr: 182
- commits from: jcapriot, lheagy
- review from: jcapriot

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

0.4.8

- from pr 177
- commits from jcapriot
- pr started by micmitch
- review from lheagy

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

- from pr: 172
- commits from: dccowan
- review from: sarahgarre, sgkang, lheagy

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](https://user-images.githubusercontent.com/6361812/60741119-2713fc80-9f1d-11e9-84a7-8f9498cfddbf.png)

0.4.6

- from pr 174
- commits from banesullivan
- review from lheagy

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` :arrow_right: 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` :left_right_arrow: OMF). Give it a try with the new `to_omf(models)` method and load your `TensorMesh`s into other software that supports OMF (e.g. Leapfrog)!

Notes

- At the moment, only `TensorMesh`s 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

py
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`](https://github.com/OpenGeoVis/omfvista):

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

0.4.5

- from pr 156
- commits from prisae
- review from rowanc1, lheagy

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

0.4.4

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](https://user-images.githubusercontent.com/8020943/58073128-19d7c400-7ba2-11e9-8b97-e603410128a0.gif)

- 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`

Page 2 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.