Skip to content

Issues with Rotating/Flipping GeomGrid in Pre-Processing tool #48

Answered by eisenlohr
123fgh123 asked this question in Q&A
Discussion options

You must be logged in to vote

Grid rotation appears to be working as expected:

>>> import numpy as np
>>> import damask

>>> (g:=damask.GeomGrid(np.ones((80,60,1)),size=[80,60,1]))
cells:  80 × 60 × 1
size:   80.0 × 60.0 × 1.0 m³
origin: 0.0   0.0   0.0 m
# materials: 1 (min: 1, max: 1)

>>> (r:=g.rotate(damask.Rotation.from_axis_angle([1,0,0,90],degrees=True)))
cells:  80 × 1 × 60
size:   80.0 × 1.0 × 60.0 m³
origin: 0.0   29.5   -29.5 m
# materials: 1 (min: 1, max: 1)

Note that the GeomGrid.rotate method is not in-place but returns a new GeomGrid!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by 123fgh123
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants