Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
117d7a9
commit a540b49
Showing
3 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from __future__ import division | ||
import numpy as np | ||
from ARBTools.ARBInterp import tricubic | ||
|
||
###################################################################### | ||
|
||
if __name__ == '__main__': | ||
fieldname = "Example3DScalarField" | ||
|
||
print ("--- Loading field ---") | ||
field = np.genfromtxt(fieldname+'.csv', delimiter=',') | ||
|
||
Run = tricubic(field) # mode kword arg will be ignored if a scalar (Nx4) input is detected | ||
|
||
coords=np.zeros((20,3)) | ||
coords[:,0]=np.linspace(-2e-3,2e-3,20) | ||
coords[:,1]=np.linspace(-2e-3,2e-3,20) | ||
coords[:,2]=np.linspace(-2e-3,2e-3,20) | ||
|
||
output = Run.Query((coords[3])) | ||
print ('\n') | ||
print ('Single point query, scalar field:') | ||
print (output) | ||
print ('\n') | ||
|
||
Comps = Run.Query(coords) | ||
print ('\n') | ||
print ('Multi point query, scalar field:') | ||
print (Comps) | ||
|
||
|
||
fieldname = "Example3DVectorField" | ||
|
||
print ("--- Loading field ---") | ||
field = np.genfromtxt(fieldname+'.csv', delimiter=',') | ||
|
||
Run = tricubic(field, mode='both') # mode options are 'both', 'vector' or 'norm', defaults to 'vector'. Pass arg 'quiet' to suppress setup text | ||
|
||
output = Run.Query((coords[3])) | ||
print ('Single point query, vector field:') | ||
print ('\n') | ||
print (output) | ||
print ('\n') | ||
|
||
Comps = Run.Query(coords) | ||
print ('Multi point query, vector field:') | ||
print ('\n') | ||
print (Comps) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from __future__ import division | ||
import numpy as np | ||
from ARBTools.ARBInterp import quadcubic | ||
|
||
###################################################################### | ||
|
||
if __name__ == '__main__': | ||
fieldname = "Example4DScalarField" | ||
|
||
print ("--- Loading field ---") | ||
field = np.genfromtxt(fieldname+'.csv', delimiter=',') | ||
|
||
Run = quadcubic(field) # mode kword arg will be ignored if a scalar (Nx5) input is detected | ||
|
||
coords=np.zeros((20,4)) | ||
coords[:,0]=np.linspace(-2e-3,2e-3,20) | ||
coords[:,1]=np.linspace(-2e-3,2e-3,20) | ||
coords[:,2]=np.linspace(-2e-3,2e-3,20) | ||
coords[:,3]=np.linspace(-3e-6,3e-6,20) | ||
|
||
output = Run.Query((coords[3])) | ||
print ('\n') | ||
print ('Single point query, scalar field:') | ||
print (output) | ||
print ('\n') | ||
|
||
Comps = Run.Query(coords) | ||
print ('\n') | ||
print ('Multi point query, scalar field:') | ||
print (Comps) | ||
|
||
|
||
fieldname = "Example4DVectorField" | ||
|
||
print ("--- Loading field ---") | ||
field = np.genfromtxt(fieldname+'.csv', delimiter=',') | ||
|
||
Run = quadcubic(field, mode='both') # mode options are 'both', 'vector' or 'norm', defaults to 'vector'. Pass arg 'quiet' to suppress setup text | ||
|
||
output = Run.Query((coords[3])) | ||
print ('Single point query, vector field:') | ||
print ('\n') | ||
print (output) | ||
print ('\n') | ||
|
||
Comps = Run.Query(coords) | ||
print ('Multi point query, vector field:') | ||
print ('\n') | ||
print (Comps) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from __future__ import division | ||
import numpy as np | ||
from ARBTools.ARBInterp import tricubic | ||
#from ARBTools.ARBTrajec | ||
from A5_03032019 import trajectories | ||
|
||
############################### Skookum ############################### | ||
|
||
if __name__ == '__main__': | ||
mAr = 39.948 # Mass Ar | ||
N = 100 # number of atoms | ||
T = 0.01 # temperature in K | ||
|
||
moment = 3 # magnetic moment in Bohr magnetons - mJ x g-factor (neglecting nuclear spin, use mF if I!=0) | ||
# testing with Ar in 3P2 state: mJ = 2, low-field-seeking | ||
|
||
tmax = 0.01 # end time of simulation | ||
timestep = 1e-6 # acceptable timestep depends on shape of potential! | ||
|
||
fieldname = "ExampleVectorField" | ||
field = np.genfromtxt(fieldname+'.csv', delimiter=',') # field to be interpolated | ||
|
||
ArTest = trajectories(field) # creates class to iterate particle trajectories | ||
ArSample = ArTest.atoms(T,N, mAr) # creates random sample of Ar atoms | ||
np.savetxt('Rand_In.csv', ArSample, delimiter=',') # Save initial sample to file | ||
|
||
ArTest.Iterate(ArSample, tmax, timestep, mAr, moment) # tracks motion of particles through field for some time | ||
|
||
np.savetxt('Rand_Out.csv', ArSample, delimiter=',') # Save final sample to file |