Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2.0 #182

Merged
merged 71 commits into from
Dec 3, 2024
Merged

3.2.0 #182

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
751d8d1
[vis] Fix Matplotlib color handling
holl- Oct 6, 2024
ad492c1
[vis] Allow for variable titles in animations
Oct 7, 2024
2126976
[vis] Fix animating non-stackable values
Oct 7, 2024
c7a8617
[vis] Remove legacy view() and Viewer, add show_hist()
Oct 7, 2024
0a056f2
[field] Layout non-stackable Fields when stacking
Oct 7, 2024
65d1e31
[vis] Fix bounds of channel-only bar charts
Oct 7, 2024
85d7084
[field] Add Field.grid
Oct 7, 2024
376b6aa
[geom] Add bounding_box()
Oct 7, 2024
12dae2f
[vis] Fix limits of quiver plots
Oct 7, 2024
5b30ce5
[vis] Improved Matplotlib annotation positions
Oct 7, 2024
97797f5
[geom] Add read_stl()
Oct 16, 2024
b639f48
[field] Support stacking Fields with compatible Geometries
Oct 16, 2024
b30ffe4
[field,geom] Optimize Field.shape getter
holl- Oct 17, 2024
2d4d6f3
[geom] Add Cylinder
holl- Oct 18, 2024
041ccb0
[geom] Minor refactoring
holl- Oct 18, 2024
6baf0ee
[geom] SDFGrid optional surface properties
Oct 18, 2024
03f090a
[geom] Refactor Cylinder as @dataclass
holl- Oct 19, 2024
0a277f6
[vis] Avoid unnecessary stacking
holl- Oct 20, 2024
4d3ca16
fixup cylinder dataclass
Oct 21, 2024
2f64194
[geom] Add Cylinder.vertex_rings()
Oct 21, 2024
4ece83f
[vis] Support plotting cylinders with Plotly
Oct 21, 2024
12bc8f1
[Φ] Add mean, where, nonzero to convenience imports
Oct 21, 2024
4260399
[vis] Fix plot when default backend is not NumPy
Oct 23, 2024
b8995d7
[geom] Fix Cylinder, allow vector axis
Oct 23, 2024
ae79d4c
[geom] Add UniformGrid.position_of(), voxel_at()
Oct 23, 2024
525deef
[geom] Broadcast Mesh loading functions
Oct 23, 2024
8312fa5
[geom] Add SDFGrid.approximate_occupancy(), downsample2x()
Oct 23, 2024
bd240ef
[field] Support PointCloud(0, directions)
Oct 25, 2024
62517f4
[vis] Plotly equal aspect for 3D plots
Oct 26, 2024
cf21001
[geom] Add internal closest_points_on_lines()
Oct 26, 2024
8ed1f27
[geom] Vectorize decimate_tri_mesh()
Oct 26, 2024
f08cafd
[geom] Implement Cylinder.sample_uniform()
holl- Oct 26, 2024
0505bf7
[geom] Support cylinder(0, depth=None)
Nov 3, 2024
0571c9f
[geom] Support cylinders with channel dims
Nov 3, 2024
d86ffdd
[geom] Implement Cylinder.bounding_half_extent for rotated cylinders
Nov 3, 2024
70e107e
[field] Fix Field.sampled_at
Nov 3, 2024
2338cb1
[vis] Plotly 3D equal aspect ratio
Nov 3, 2024
4d36f56
[vis] Fix Plotly cylinder/sphere with non-NumPy backend
Nov 3, 2024
d03f7a7
[vis] Fix Plotly mesh color
Nov 3, 2024
ce7961b
[geom] Add build parameters to load_tri_mesh()
Nov 3, 2024
a819047
[geom] Fix Mesh.at()
Nov 3, 2024
33cc44b
[geom] Add reduce to bounding_box()
Nov 4, 2024
dd0255f
[geom] Add Cylinder.with_radius/depth
Nov 4, 2024
4aed806
[geom] Fix NaN gradient in cylinder
Nov 4, 2024
b605f19
[Φ] Add median() to convenience imports
Nov 4, 2024
e5636af
[geom] Update cylinder
Nov 22, 2024
ee89314
[geom] Add UniformGrid.with_scaled_resolution()
Nov 22, 2024
10df2bd
[geom] SDFGrid fix out-of-bounds, add property type hints
Nov 22, 2024
4980be5
[vis] Fix color assignment
Nov 22, 2024
c4ac237
[geom] Add private distance_line_point()
Nov 22, 2024
4fd6c9a
[Φ] Add more math functions to convenience imports
Nov 22, 2024
8461805
[field] Make Field a dataclass, update docstrings
holl- Nov 22, 2024
5f975ff
[geom] Update Cylinder to use getitem_dataclass()
holl- Nov 24, 2024
3488e33
[geom] Fix Point.bounding_half_extent()
holl- Nov 24, 2024
a94e9c7
[geom] Refactor Mesh
holl- Nov 24, 2024
9489992
[vis] Fix plotting sparse points
holl- Nov 24, 2024
bf9025f
[geom] Generalized transformation functions (previously in PhiML)
holl- Nov 24, 2024
b6e3cda
[geom] Fix Mesh.vertex_connectivity, simplify
Nov 25, 2024
b49a4e7
[Φ] Default to geom.length, geom.normalize
holl- Nov 25, 2024
1deca98
[geom] Move cross(), clip_length() to geom
holl- Nov 25, 2024
4659a14
[physics] Fix MacCormack advection
holl- Nov 25, 2024
868cc8b
[Φ] Require PhiML 1.10
Nov 27, 2024
f212906
[field] Minor fix for PhiML 1.10
Nov 27, 2024
d71843e
[geom] Add load_stl() docstring
Nov 27, 2024
e09458f
[geom] Update Mesh face analysis
holl- Nov 29, 2024
e7e2cd0
[doc] Update Fluid_Simulation.ipynb
holl- Nov 29, 2024
c716dca
[field] Fix FieldEmbedding.pad_values()
holl- Nov 29, 2024
b1fa45c
[doc] Update Wake_Flow.ipynb
holl- Nov 29, 2024
d6c762a
[vis] Fix Plotly cmap interpolation
holl- Nov 29, 2024
308171e
[field] Fix deprecated Hard/SoftGeometryMask
Dec 2, 2024
0e5b57c
[Φ] Update version to 3.2.0
holl- Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions docs/Fluid_Simulation.ipynb

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions examples/grids/Wake_Flow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install phiflow\n",
"from phi.jax.flow import *\n",
"# from phi.flow import * # If JAX is not installed. You can use phi.torch or phi.tf as well."
"from phi.torch.flow import *\n",
"# from phi.flow import * # If JAX is not installed. You can use phi.torch or phi.tf as well.\n",
"from tqdm.notebook import trange"
]
},
{
Expand Down Expand Up @@ -75,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -86,7 +87,8 @@
"\n",
"boundary = {'x-': vec(x=2, y=0, z=0), 'x+': ZERO_GRADIENT, 'y': PERIODIC, 'z': PERIODIC}\n",
"v0 = StaggeredGrid((8., 0, 0), boundary, x=128, y=64, z=8, bounds=Box(x=200, y=100, z=5))\n",
"v_trj, p_trj = iterate(step, batch(time=200), v0, None)"
"v0, p0 = fluid.make_incompressible(v0, cylinder, Solve('scipy-direct'))\n",
"v_trj, p_trj = iterate(step, batch(time=200), v0, p0, range=trange)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion phi/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
3.2.0
4 changes: 2 additions & 2 deletions phi/field/_angular_velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from phi import math
from ._field import FieldInitializer, get_sample_points
from ..geom import Geometry
from ..geom import Geometry, cross
from ..math import Shape, spatial, instance, Tensor, wrap, Extrapolation


Expand Down Expand Up @@ -36,6 +36,6 @@ def _sample(self, geometry: Geometry, at: str, boundaries: Extrapolation, **kwar
points = get_sample_points(geometry, at, boundaries)
distances = points - self.location
strength = self.strength if self.falloff is None else self.strength * self.falloff(distances)
velocity = math.cross_product(strength, distances)
velocity = cross(strength, distances)
velocity = math.sum(velocity, self.location.shape.batch.without(points.shape))
return velocity
2 changes: 1 addition & 1 deletion phi/field/_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def is_face_valid(self, key) -> bool:
return False

def pad_values(self, value: Tensor, width: int, dim: str, upper_edge: bool, bounds: Box = None, already_padded: dict = None, **kwargs) -> Tensor:
assert bounds is not None, f"{type(self)}.pad() requires 'bounds' argument"
assert bounds is not None or (already_padded and not value.shape.is_non_uniform), f"{type(self)}.pad() requires 'bounds' argument"
if value.shape.is_non_uniform:
unstacked = unstack(value, value.shape.non_uniform_shape)
indices = value.shape.non_uniform_shape.meshgrid(names=True)
Expand Down
Loading
Loading