Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
test Namespace Reference

Functions

 plotMobility (m, mat, singleCrystal, slipSystem, ax1, ax2)
 selectMobility (materialFile, Temps, slipSystemID, theta_deg, phi_deg)
 plotGammaSurface (mat, gammaSurface, lab, pts, nc, nR, C)

Variables

int slipSystemID = 0
 main
 Temps = np.array([100,300,1000])
float phi_deg = 0.0
int theta_deg = 45
 materialFile = str(file)
 Main.
 Tm = getValueInFile(materialFile,"Tm")
 materialName = getStringInFile(materialFile,"materialName")
float absoluteTemperature = 0.0
 mat = pyMoDELib.PolycrystallineMaterialBase(materialFile,absoluteTemperature)
 energyDensityScaling = mat.mu_SI*mat.b_SI
 C2G = np.array([[1,0,0],[0,1,0],[0,0,1]])
 singleCrystal = pyMoDELib.SingleCrystalBase(mat,C2G)
int nR = 4
int pts = 50
int nc = 100
 C
 XiYi = np.random.rand(6, 2)
 dX = np.max(XiYi[:,0])-np.min(XiYi[:,0])
 extrapolation = pyMoDELib.ExtrapolationMethod(2,1.1*dX)
 lagrangeInterp = pyMoDELib.LagrangeInterpolant(XiYi,extrapolation)
 linearInterp = pyMoDELib.LinearInterpolant(XiYi,extrapolation)
 X = np.linspace(np.min(XiYi[:,0])-2, np.max(XiYi[:,0])+2, num=10000, endpoint=True)
 Y1 = np.zeros(len(X))
 Y2 = np.zeros(len(X))
 fig1 = plt.figure()
 ax1 = plt.subplot(1,1,1)
 label
 linestyle
bool compute = True
 periodicImageMatrix = np.array([[0,0,0],[1,1,1],[2,2,2],[4,4,4]])
int EwaldLengthDivisions = 2
 curDir = os.getcwd()
 microstrucureFile = getStringInFile('inputFiles/initialMicrostructure.txt','microstructureFile')
str microstrucureFileName = curDir+'/inputFiles/'+microstrucureFile
str ddFileName = curDir+'/inputFiles/DD.txt'
 periodicImageSize = periodicImageMatrix[k]
 EwaldLengthFactors = np.linspace(0.0, 1.0, num=EwaldLengthDivisions)
 EwaldLengthFactor = EwaldLengthFactors[c];
float E = X*0.0;
float S11 = X*0.0;
float S12 = X*0.0;
float S13 = X*0.0;
float S22 = X*0.0;
float S23 = X*0.0;
float S33 = X*0.0;
 x = X[k]
 F
 Flabels
 aux = readAUXtxt('config/ddAux_0')
 data = np.empty([np.size(X),8])
str outFileName = 'data'+'_'+str(periodicImageSize[0])+'_'+str(periodicImageSize[1])+'_'+str(periodicImageSize[2])+'_'+str(EwaldLengthFactor)+'.txt'
 dataDict = dict()
 Load data into dictionary for plotting.
str key = str(periodicImageSize[0])+'_'+str(periodicImageSize[1])+'_'+str(periodicImageSize[2])+'_'+str(EwaldLengthFactor)
str FileName = 'data_'+key+'.txt'
list fields = ['energy','sigma11','sigma22','sigma33','sigma23','sigma13','sigma12']
list fieldLabels = ['elastic energy $[\mu b^3]$','$\sigma_{11}$ $[\mu]$','$\sigma_{22}$ $[\mu]$','$\sigma_{33}$ $[\mu]$','$\sigma_{23}$ $[\mu]$','$\sigma_{13}$ $[\mu]$','$\sigma_{12}$ $[\mu]$']
 bbox_inches
 periodicImageCases = np.array([[4,4,4,2]])
list folders = ['config','F','inputFiles']
 Preparing input files.
str DDfile = 'DD.txt'
str DDfileTemplate = '../../Library/DislocationDynamics/'+DDfile
str materialFileTemplate = '../../Library/Materials/'+materialFile;
 b_SI = getValueInFile('inputFiles/'+materialFile,'b_SI')
str meshFile = 'unitCube24.msh';
str meshFileTemplate = '../../Library/Meshes/'+meshFile;
 pf = PolyCrystalFile(materialFile);
 alignToSlipSystem0
 boxScaling
 periodicFaceIDs
 simulationDir = os.path.abspath(".")
 Iterate over configurations and run one step.
str fFile = "F/F_0.txt"
str fLabes = "F/F_labels.txt"
 ddBase = pyMoDELib.DefectiveCrystalBase(simulationDir)
 mesh = ddBase.mesh
 xMax = mesh.xMax()
 xMin = mesh.xMin()
 xCenter = mesh.xCenter()
 defectiveCrystal = pyMoDELib.DefectiveCrystal(ddBase)
 spec = pyMoDELib.PeriodicDipoleIndividualSpecification()
 slipSystemIDs
 exitFaceIDs
 dipoleCenters
 dipoleHeights
 nodesPerLine
int j = 0
 glideSteps
 microstructureGenerator = pyMoDELib.MicrostructureGenerator(ddBase)
 P0 = np.array([0.0,0.0,0.0])
 P1 = np.array([1.0,0.0,0.0])
 b = np.array([1.0,0.0,0.0])
 ss = pyMoDELib.StressStraight(mat,P0,P1,b,0.0)
 start_time = time.perf_counter()
 sigma = ss.stress(x)
 end_time = time.perf_counter()
 execution_time = end_time - start_time

Function Documentation

◆ plotGammaSurface()

test.plotGammaSurface ( mat,
gammaSurface,
lab,
pts,
nc,
nR,
C )

Definition at line 12 of file gammaSurface/test.py.

◆ plotMobility()

test.plotMobility ( m,
mat,
singleCrystal,
slipSystem,
ax1,
ax2 )

Definition at line 14 of file dislocationMobility/test.py.

◆ selectMobility()

test.selectMobility ( materialFile,
Temps,
slipSystemID,
theta_deg,
phi_deg )

Definition at line 38 of file dislocationMobility/test.py.

Variable Documentation

◆ absoluteTemperature

test.absoluteTemperature = 0.0

Definition at line 58 of file gammaSurface/test.py.

◆ alignToSlipSystem0

test.alignToSlipSystem0

Definition at line 66 of file periodicFields/test.py.

◆ aux

test.aux = readAUXtxt('config/ddAux_0')

Definition at line 60 of file periodicEnergy/test.py.

◆ ax1

test.ax1 = plt.subplot(1,1,1)

Definition at line 39 of file interpolation1D/test.py.

◆ b

test.b = np.array([1.0,0.0,0.0])

Definition at line 20 of file stressStraight/test.py.

◆ b_SI

test.b_SI = getValueInFile('inputFiles/'+materialFile,'b_SI')

Definition at line 56 of file periodicFields/test.py.

◆ bbox_inches

test.bbox_inches

Definition at line 122 of file periodicEnergy/test.py.

◆ boxScaling

test.boxScaling

Definition at line 67 of file periodicFields/test.py.

◆ C

test.C
Initial value:
1= np.array([[1,1],
2 [0,1]])

Definition at line 69 of file gammaSurface/test.py.

◆ C2G

test.C2G = np.array([[1,0,0],[0,1,0],[0,0,1]])

Definition at line 61 of file gammaSurface/test.py.

◆ compute

bool test.compute = True

Definition at line 9 of file periodicEnergy/test.py.

◆ curDir

test.curDir = os.getcwd()

Definition at line 17 of file periodicEnergy/test.py.

◆ data

test.data = np.empty([np.size(X),8])

Definition at line 70 of file periodicEnergy/test.py.

◆ dataDict

test.dataDict = dict()

Load data into dictionary for plotting.

Definition at line 89 of file periodicEnergy/test.py.

◆ ddBase

test.ddBase = pyMoDELib.DefectiveCrystalBase(simulationDir)

Definition at line 87 of file periodicFields/test.py.

◆ DDfile

str test.DDfile = 'DD.txt'

Definition at line 24 of file periodicFields/test.py.

◆ ddFileName

str test.ddFileName = curDir+'/inputFiles/DD.txt'

Definition at line 20 of file periodicEnergy/test.py.

◆ DDfileTemplate

str test.DDfileTemplate = '../../Library/DislocationDynamics/'+DDfile

Definition at line 25 of file periodicFields/test.py.

◆ defectiveCrystal

test.defectiveCrystal = pyMoDELib.DefectiveCrystal(ddBase)

Definition at line 93 of file periodicFields/test.py.

◆ dipoleCenters

test.dipoleCenters

Definition at line 100 of file periodicFields/test.py.

◆ dipoleHeights

test.dipoleHeights

Definition at line 101 of file periodicFields/test.py.

◆ dX

test.dX = np.max(XiYi[:,0])-np.min(XiYi[:,0])

Definition at line 22 of file interpolation1D/test.py.

◆ E

test.E = X*0.0;

Definition at line 44 of file periodicEnergy/test.py.

◆ end_time

test.end_time = time.perf_counter()

Definition at line 26 of file stressStraight/test.py.

◆ energyDensityScaling

test.energyDensityScaling = mat.mu_SI*mat.b_SI

Definition at line 60 of file gammaSurface/test.py.

◆ EwaldLengthDivisions

int test.EwaldLengthDivisions = 2

Definition at line 11 of file periodicEnergy/test.py.

◆ EwaldLengthFactor

test.EwaldLengthFactor = EwaldLengthFactors[c];

Definition at line 34 of file periodicEnergy/test.py.

◆ EwaldLengthFactors

test.EwaldLengthFactors = np.linspace(0.0, 1.0, num=EwaldLengthDivisions)

Definition at line 27 of file periodicEnergy/test.py.

◆ execution_time

test.execution_time = end_time - start_time

Definition at line 27 of file stressStraight/test.py.

◆ exitFaceIDs

test.exitFaceIDs

Definition at line 99 of file periodicFields/test.py.

◆ extrapolation

test.extrapolation = pyMoDELib.ExtrapolationMethod(2,1.1*dX)

Definition at line 24 of file interpolation1D/test.py.

◆ F

test.F

Definition at line 58 of file periodicEnergy/test.py.

◆ fFile

str test.fFile = "F/F_0.txt"

Definition at line 76 of file periodicFields/test.py.

◆ fieldLabels

list test.fieldLabels = ['elastic energy $[\mu b^3]$','$\sigma_{11}$ $[\mu]$','$\sigma_{22}$ $[\mu]$','$\sigma_{33}$ $[\mu]$','$\sigma_{23}$ $[\mu]$','$\sigma_{13}$ $[\mu]$','$\sigma_{12}$ $[\mu]$']

Definition at line 110 of file periodicEnergy/test.py.

◆ fields

list test.fields = ['energy','sigma11','sigma22','sigma33','sigma23','sigma13','sigma12']

Definition at line 109 of file periodicEnergy/test.py.

◆ fig1

test.fig1 = plt.figure()

Definition at line 38 of file interpolation1D/test.py.

◆ FileName

str test.FileName = 'data_'+key+'.txt'

Definition at line 103 of file periodicEnergy/test.py.

◆ Flabels

test.Flabels

Definition at line 58 of file periodicEnergy/test.py.

◆ fLabes

str test.fLabes = "F/F_labels.txt"

Definition at line 79 of file periodicFields/test.py.

◆ folders

list test.folders = ['config','F','inputFiles']

Preparing input files.

Definition at line 18 of file periodicFields/test.py.

◆ glideSteps

test.glideSteps

Definition at line 114 of file periodicFields/test.py.

◆ j

int test.j = 0

Definition at line 111 of file periodicFields/test.py.

◆ key

str test.key = str(periodicImageSize[0])+'_'+str(periodicImageSize[1])+'_'+str(periodicImageSize[2])+'_'+str(EwaldLengthFactor)

Definition at line 101 of file periodicEnergy/test.py.

◆ label

test.label

Definition at line 42 of file interpolation1D/test.py.

◆ lagrangeInterp

test.lagrangeInterp = pyMoDELib.LagrangeInterpolant(XiYi,extrapolation)

Definition at line 25 of file interpolation1D/test.py.

◆ linearInterp

test.linearInterp = pyMoDELib.LinearInterpolant(XiYi,extrapolation)

Definition at line 26 of file interpolation1D/test.py.

◆ linestyle

test.linestyle

Definition at line 42 of file interpolation1D/test.py.

◆ mat

test.mat = pyMoDELib.PolycrystallineMaterialBase(materialFile,absoluteTemperature)

Definition at line 59 of file gammaSurface/test.py.

◆ materialFile

str test.materialFile = str(file)

Main.

main

Definition at line 71 of file dislocationMobility/test.py.

◆ materialFileTemplate

str test.materialFileTemplate = '../../Library/Materials/'+materialFile;

Definition at line 51 of file periodicFields/test.py.

◆ materialName

test.materialName = getStringInFile(materialFile,"materialName")

Definition at line 74 of file dislocationMobility/test.py.

◆ mesh

test.mesh = ddBase.mesh

Definition at line 88 of file periodicFields/test.py.

◆ meshFile

test.meshFile = 'unitCube24.msh';

Definition at line 59 of file periodicFields/test.py.

◆ meshFileTemplate

str test.meshFileTemplate = '../../Library/Meshes/'+meshFile;

Definition at line 60 of file periodicFields/test.py.

◆ microstructureGenerator

test.microstructureGenerator = pyMoDELib.MicrostructureGenerator(ddBase)

Definition at line 116 of file periodicFields/test.py.

◆ microstrucureFile

test.microstrucureFile = getStringInFile('inputFiles/initialMicrostructure.txt','microstructureFile')

Definition at line 18 of file periodicEnergy/test.py.

◆ microstrucureFileName

str test.microstrucureFileName = curDir+'/inputFiles/'+microstrucureFile

Definition at line 19 of file periodicEnergy/test.py.

◆ nc

int test.nc = 100

Definition at line 67 of file gammaSurface/test.py.

◆ nodesPerLine

test.nodesPerLine

Definition at line 102 of file periodicFields/test.py.

◆ nR

int test.nR = 4

Definition at line 65 of file gammaSurface/test.py.

◆ outFileName

str test.outFileName = 'data'+'_'+str(periodicImageSize[0])+'_'+str(periodicImageSize[1])+'_'+str(periodicImageSize[2])+'_'+str(EwaldLengthFactor)+'.txt'

Definition at line 86 of file periodicEnergy/test.py.

◆ P0

test.P0 = np.array([0.0,0.0,0.0])

Definition at line 18 of file stressStraight/test.py.

◆ P1

test.P1 = np.array([1.0,0.0,0.0])

Definition at line 19 of file stressStraight/test.py.

◆ periodicFaceIDs

test.periodicFaceIDs

Definition at line 68 of file periodicFields/test.py.

◆ periodicImageCases

test.periodicImageCases = np.array([[4,4,4,2]])

Definition at line 13 of file periodicFields/test.py.

◆ periodicImageMatrix

test.periodicImageMatrix = np.array([[0,0,0],[1,1,1],[2,2,2],[4,4,4]])

Definition at line 10 of file periodicEnergy/test.py.

◆ periodicImageSize

test.periodicImageSize = periodicImageMatrix[k]

Definition at line 23 of file periodicEnergy/test.py.

◆ pf

Definition at line 63 of file periodicFields/test.py.

◆ phi_deg

float test.phi_deg = 0.0

Definition at line 64 of file dislocationMobility/test.py.

◆ pts

int test.pts = 50

Definition at line 66 of file gammaSurface/test.py.

◆ S11

float test.S11 = X*0.0;

Definition at line 45 of file periodicEnergy/test.py.

◆ S12

float test.S12 = X*0.0;

Definition at line 46 of file periodicEnergy/test.py.

◆ S13

float test.S13 = X*0.0;

Definition at line 47 of file periodicEnergy/test.py.

◆ S22

float test.S22 = X*0.0;

Definition at line 48 of file periodicEnergy/test.py.

◆ S23

float test.S23 = X*0.0;

Definition at line 49 of file periodicEnergy/test.py.

◆ S33

float test.S33 = X*0.0;

Definition at line 50 of file periodicEnergy/test.py.

◆ sigma

test.sigma = ss.stress(x)

Definition at line 25 of file stressStraight/test.py.

◆ simulationDir

test.simulationDir = os.path.abspath(".")

Iterate over configurations and run one step.

Definition at line 73 of file periodicFields/test.py.

◆ singleCrystal

test.singleCrystal = pyMoDELib.SingleCrystalBase(mat,C2G)

Definition at line 62 of file gammaSurface/test.py.

◆ slipSystemID

int test.slipSystemID = 0

main

Definition at line 62 of file dislocationMobility/test.py.

◆ slipSystemIDs

test.slipSystemIDs

Definition at line 98 of file periodicFields/test.py.

◆ spec

test.spec = pyMoDELib.PeriodicDipoleIndividualSpecification()

Definition at line 97 of file periodicFields/test.py.

◆ ss

test.ss = pyMoDELib.StressStraight(mat,P0,P1,b,0.0)

Definition at line 22 of file stressStraight/test.py.

◆ start_time

test.start_time = time.perf_counter()

Definition at line 23 of file stressStraight/test.py.

◆ Temps

test.Temps = np.array([100,300,1000])

Definition at line 63 of file dislocationMobility/test.py.

◆ theta_deg

int test.theta_deg = 45

Definition at line 65 of file dislocationMobility/test.py.

◆ Tm

test.Tm = getValueInFile(materialFile,"Tm")

Definition at line 73 of file dislocationMobility/test.py.

◆ X

test.X = np.linspace(np.min(XiYi[:,0])-2, np.max(XiYi[:,0])+2, num=10000, endpoint=True)

Definition at line 28 of file interpolation1D/test.py.

◆ x

test.x = X[k]

Definition at line 52 of file periodicEnergy/test.py.

◆ xCenter

test.xCenter = mesh.xCenter()

Definition at line 91 of file periodicFields/test.py.

◆ XiYi

test.XiYi = np.random.rand(6, 2)

Definition at line 21 of file interpolation1D/test.py.

◆ xMax

test.xMax = mesh.xMax()

Definition at line 89 of file periodicFields/test.py.

◆ xMin

test.xMin = mesh.xMin()

Definition at line 90 of file periodicFields/test.py.

◆ Y1

test.Y1 = np.zeros(len(X))

Definition at line 29 of file interpolation1D/test.py.

◆ Y2

test.Y2 = np.zeros(len(X))

Definition at line 30 of file interpolation1D/test.py.