lanl / LaGriT

Los Alamos Grid Toolbox (LaGriT) is a library of user callable tools that provide mesh generation, mesh optimization and dynamic mesh maintenance in two and three dimensions.
https://lanl.github.io/LaGriT/
Other
122 stars 49 forks source link

rotatept phi angle #187

Open hymanjd opened 4 years ago

hymanjd commented 4 years ago

rotatept phi angle "bends" all z coords towards z pole rather that rotating all points.

'''

Define the bounding box

# define / X0 / -1.0 define / X1 / 1.0 define / Y0 / -0.5 define / Y1 / 0.5 define / Z0 / -0.5 define / Z1 / 0.5

Define a box that is epsilon smaller than the box

define / X0eps / -0.9999 define / X1eps / 0.9999 define / Y0eps / -0.4999 define / Y1eps / 0.4999 define / Z0eps / -0.4999 define / Z1eps / 0.4999 # define / h_by_10 / 0.01 # #############################################################

define / NPX / 6 define / NPY / 3 define / NPZ / 3

Define the bounding box

# define / X0 / -1.0 define / X1 / 1.0 define / Y0 / -0.5 define / Y1 / 0.5 define / Z0 / -0.5 define / Z1 / 0.5

Define a box that is epsilon smaller than the box

define / X0eps / -0.9999 define / X1eps / 0.9999 define / Y0eps / -0.4999 define / Y1eps / 0.4999 define / Z0eps / -0.4999 define / Z1eps / 0.4999 # define / h_by_10 / 0.01 # #############################################################

define / NPX / 6 define / NPY / 3 define / NPZ / 3

cmo / create / mo_tet / / / tet createpts / xyz / NPX NPY NPZ / X0 Y0 Z0 / X1 Y1 Z1 / 1 1 1

createpts /random / xyz / .5 / X0 Y0 Z0 / X1 Y1 Z1

filter / 1 0 0 rmpoint / compress

cmo / setatt / mo_tet / imt / 1 0 0 / 1 cmo / setatt / mo_tet / itp / 1 0 0 / 0 connect / noadd resetpts / itp

pset / psmooth / attribute / itp / 1,0,0 / 0 / eq smooth / position / geometry / pset,get,psmooth

rotatept/1,0,0/nocopy/ 0. 0. 0./ 15. 0. dump / avs / tmp_smooth.inp / mo_tet

finish

'''

millerta commented 4 years ago

I am working on documentation and a solution which will be a new rotate command:

rotatept – leave at it is, but document what it really does (which is wacked). It does not really rotate about a point. It may have the option of transforming the origin of the rotation, but other than that, it is a deterministic but kind of random, weird, (useless), algorithm.

Create a new command. All angle are degrees: rotate_euler / ifirst, ilast, istride / [no] copy / xcen, ycen, zcen / phi, theta, psi / forward|inverse

Where forward (default) is X’ = AX and Inverse is X = ATX