Files
TRIMSP/TrimSP.html

436 lines
16 KiB
HTML

<!DOCTYPE html>
<html class="mcss">
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<link rel="stylesheet" href="ZGUI.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<script src="TrimSPlib.js"></script>
<script src="TrimSPelec.js"></script>
<script src="myplots.js"></script>
<script type="text/javascript">
const ipcRenderer = require('electron').ipcRenderer;
const fs = require('fs');
const exec = require('child_process').execSync;
const remote = require('electron').remote;
</script>
<title>Trim.SP</title>
</head>
<body onresize="resizePl()" onload="adjust_table();adjust_scans();">
<table style="width: 100%;">
<tr><td>
<div class="col-full">
<div class="tab">
<button class="tablinks" onclick="openTab(event,'Layers')" id="btnLayers">Layers</button>
<button class="tablinks" onclick="openTab(event,'Scans')" id="btnScans">Scans</button>
<button class="tablinks" onclick="openTab(event,'Plots')" id="btnPlots">Plots</button>
<button class="tablinks" onclick="openTab(event,'Other')" id="btnOther">Other Parameters</button>
</div>
<div id="Layers" class="tabcontent">
<table style="width: 100%;">
<tr>
<td style="vertical-align: top;">
<table cellpadding="5">
<tr>
<td><label>File name prefix:</label></td>
<td>
<input name="fileNamePrefix" id="fileNamePrefix" type="text" style="width:70%" value="SrTiO3"/>
<input name="trimPath" id="trimPath" type="text" style="width:70%;visibility:hidden;"/>
</td>
</tr>
<tr>
<td><label>Save folder:</label></td>
<td>
<input type="text" style="width:70%" id="workPath" name="workPath" readonly/>
<input type="button" value="Browse"
id="browseFolde" onclick="ipcRenderer.send('browseFolder');">
</td>
</tr>
<td><label>Number of Layers:</label></td>
<td><input name="numLayer" id="numLayer" type="number" size="3" step="1" min="1" max="100" value="1" onchange="adjust_table()"></td>
</tr>
<tr><td colspan="2">
<table id="LTable" border="2" cellpadding="10">
<tr><td><b>Layer #</b></td><td><b>Composition</b></td><td><b>Density [g/cm<sup>3</sup>]</b></td><td><b>Thickness [Å]</b></td></tr>
</table>
</td></tr>
</table>
</td>
<td style="vertical-align: top;">
<table cellpadding="5">
<tr><td collspan="2"><b>Projectile parameters</b></td></tr>
<tr><td>Projectile</td>
<td><select name="ProjType" id="ProjType" onchange="ProjSmartDefaults()" onload="ProjSmartDefaults()">
<option selected="selected" value="muon">muon</option>
<option value="lithium-8">lithium-8</option>
<option value="boron-12">boron-12</option>
<option value="magnesium-31">magnesium-31</option>
<option value="H">H</option>
<option value="He">He</option>
</select>
</td>
</tr>
<tr><td>Number of projectiles</td>
<td><input name="numberProj" id="numberProj" type="text" size="7" value="1000" onchange="//ProjNumberLimit()"></td>
</tr>
<tr><td>Starting depth [Å]</td><td><input name="z0" id="z0" type="text" size="7" value="0"></td></tr>
<tr><td>Depth increment [Å]</td><td><input name="dz" id="dz" type="text" size="7" value="20"></td></tr>
<tr><td>Energy [eV]</td><td><input name="valEnergy" id="valEnergy" type="text" size="7" value="2000"></td></tr>
<tr><td>Energy sigma [eV]</td><td><input name="sigEnergy" id="sigEnergy" type="text" size="7" value="450"></td></tr>
<tr><td>Angle [deg]</td><td><input name="valAngle" id="valAngle" type="text" size="7" value="0"></td></tr>
<tr><td>Angle sigma [deg]</td><td><input name="sigAngle" id="sigAngle" type="text" size="7" value="15"></td></tr>
<tr><td>Random seed</td><td><input name="ranSeed" id="ranSeed" type="text" size="7" value="78741"></td></tr>
<tr><td><button onclick="document.getElementById('btnPlots').click();tester();">Start</button></td><td></td></tr>
</table>
</td>
</tr>
</table>
</div>
<div id="Scans" class="tabcontent">
<input type="checkbox" name="scanSeq" id="scanSeq" onChange="adjust_scans();"> Enable scan on
<select name="scanType" id="scanType" onchange="adjust_scans();">
<option value="scanLoop">Loop</option>
<option value="scanVals">Set of values</option>
</select>
<div id="ScansLine" style="visibility: hidden;">
<br>Set of values: <input name="scanList" id="scanList" type="text" value="1000">
Corresponding depth increment: <input name="scanListdz" id="scanListdz" type="text" value="">
</div>
<table id="ScansTable" style="width: 100%;visibility: hidden;">
<tr>
<td colspan="3">Scan parameter
<select name="comboScan" id="comboScan" onchange="">
<option value="EScan">Energy [eV]</option>
<option value="SigEScan">Energy sigma [eV]</option>
<option value="AngleScan">Angle [deg]</option>
<option value="SigAngleScan">Angle sigma [deg]</option>
<option value="NProjScan">Number of projectiles</option>
<option value="dScan">Thickness of layer # 1</option>
</select>
</td>
</tr>
<tr>
<td>
<!input type="radio" name="ScanType" value="Loop" checked onChange="">
<!input type="radio" name="ScanType" value="ScanList" onChange="">
From: <input name="scanFrom" id="scanFrom" type="text" value="1000">
</td>
<td>
Step: <input name="scanStep" id="scanStep" type="text" value="2000">
</td>
<td>
To: <input name="scanTo" id="scanTo" type="text" value="14000">
</td>
</tr>
</table>
</div>
<div id="Plots" class="tabcontent">
<table style="width: 100%;">
<tr>
<td align="center"><div id="plotRge"><!-- Plotly chart will be drawn inside this DIV --></div></td>
<td align="center"><div id="plotFrac"><!-- Plotly chart will be drawn inside this DIV --></div></td>
</tr>
</table>
</div>
<div id="Other" class="tabcontent">
<table cellpadding="5">
<tr>
<td>
<details>
<summary>EF</summary>
Cutoff energy of projectiles (in eV);
must be greater than zero.
Used for low projectile energies (< 1000 eV) and ESB = 0.
EF should be of the order of ~0.2 eV,
but not above SBE (for sputtering data).
With increasing projectile energy,
EF can be increased to save computing time.
</details>
</td>
<td>
<input name="parEF" id="parEF" type="number" size="7" step="0.1" value="0.5">
</td>
<td>
<details>
<summary>KK0</summary>
Maximum order of weak (simultaneous) collisions between projectile and target atoms:
<ol>
<li value="0">No weak collisions included.</li>
<li value="1">???</li>
<li value="2">Sufficient for most calculations.</li>
<li value="3">Only useful for very heavy particles; increases computing time.</li>
<li value="4">Only useful for very heavy particles; increases computing time.</li>
</ol>
</details>
</td>
<td>
<input name="parKK0" id="parKK0" type="number" step="1" min="0" max="4" value="2">
</td>
</tr>
<tr>
<td>
<details>
<summary>ESB</summary>
Surface binding energy for projectiles (in eV).
This value is zero for the noble gases,
but ESB should be larger than zero if the projectile is an active
chemically species.
ESB = SBE for self-sputtering calculations.
</details>
</td>
<td>
<input name="parESB" id="parESB" type="number" size="7" step="0.1" value="0.0">
</td>
<td>
<details>
<summary>KK0R</summary>
Maximum order of weak (simultaneous) collisions between target atoms:
<ol>
<li value="0">No weak collisions included.</li>
<li value="1">???</li>
<li value="2">Sufficient for most calculations.</li>
<li value="3">Only useful for very heavy particles; increases computing time.</li>
<li value="4">Only useful for very heavy particles; increases computing time.</li>
</ol>
</details>
</td>
<td>
<input name="parKK0R" id="parKK0R" type="number" step="1" min="0" max="4" value="2">
</td>
</tr>
<tr>
<td>
<details>
<summary>SHEATH</summary>
Sheath potential (in eV);
typically 3 * kT (i.e., 3 * |projectile energy|).
</details>
</td>
<td>
<input name="parSHEATH" id="parSHEATH" type="number" size="7" step="0.1" value="0.0">
</td>
<td>
<details>
<summary>KDEE1</summary>
Inelastic energy loss model for projectiles:
<ol>
<li value="1">Nonlocal (Lindhard-Scharff).</li>
<li value="2">Local (Oen-Robinson).</li>
<li value="3">
Equipartition of local and nonlocal models (i.e., options 1 & 2).
</li>
<li value="4">
Nonlocal (Anderson-Ziegler tables for hydrogen);
must be used for hydrogen-like projectile with energies > 10 keV.
</li>
<li value="5">
Nonlocal (Ziegler tables for helium);
must be used for helium-like projectiles with energies > 50 keV.
</li>
</ol>
Note: options 1, 2, and 3 can only be used at energies below the stopping power maximum.
</details>
</td>
<td>
<input name="parKDEE1" id="parKDEE1" type="number" step="1" min="1" max="5" value="4">
</td>
</tr>
<tr>
<td>
<details>
<summary>ERC</summary>
Recoil cutoff energy (in eV);
usually equal to the surface binding energy.
</details>
</td>
<td>
<input name="parERC" id="parERC" type="number" size="7" step="0.1" value="0.0">
</td>
<td>
<details>
<summary>KDEE2</summary>
Inelastic energy loss for target atoms:
<ol>
<li value="1">Nonlocal (Lindhard-Scharff).</li>
<li value="2">Local (Oen-Robinson).</li>
<li value="3">
Equipartition of local and nonlocal models (i.e., options 1 & 2).
</li>
</ol>
Note: options 1, 2, and 3 can only be used at energies below the stopping power maximum.
</details>
</td>
<td>
<input name="parKDEE2" id="parKDEE2" type="number" step="1" min="1" max="3" value="3">
</td>
</tr>
<tr>
<td>
<details>
<summary>RD</summary>
Depth (in Å) to which recoils are followed.
RD = 50 is usually sufficient for sputtering
(if the projectile energy is not too high).
Use RD = 100 * CW (i.e., the depth increment)
for following the full collision cascade.
</details>
</td>
<td>
<input name="parRD" id="parRD" type="number" size="7" step="0.1" value="50.0">
</td>
<td>
<details>
<summary>IPOT</summary>
Interaction potential between projectile and target atoms:
<ol>
<li value="1">Krypton-Carbon (Kr-C) potential.</li>
<li value="2">Molière potential.</li>
<li value="3">Ziegler-Biersack-Littmark (ZBL) potential.</li>
</ol>
</details>
</td>
<td>
<input name="parIPOT" id="parIPOT" type="number" step="1" min="1" max="3" value="2">
</td>
</tr>
<tr>
<td>
<details>
<summary>CA</summary>
Correction factor to the Firsov screening length for
collisions between projectile and target atoms
(only used in the application of the Molière potential);
usually on the order of ~1.0.
</details>
</td>
<td>
<input name="parCA" id="parCA" type="number" size="7" step="0.1" value="1.0">
</td>
<td>
<details>
<summary>IPOTR</summary>
Interaction potential between target atoms:
<ol>
<li value="1">Krypton-Carbon (Kr-C) potential.</li>
<li value="2">Molière potential.</li>
<li value="3">Ziegler-Biersack-Littmark (ZBL) potential.</li>
</ol>
</details>
</td>
<td>
<input name="parIPOTR" id="parIPOTR" type="number" step="1" min="0" max="3" value="1">
</td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<details>
<summary>IRL</summary>
Collision recoils:
<ol>
<li value="0">
No recoils are generated (i.e., no sputtering effects);
used to speed up the calculation if only projectile ranges are of interest.
</li>
<li value="1">Calculate collision recoils.</li>
</ol>
</details>
</td>
<td>
<input name="parIRL" id="parIRL" type="number" step="1" min="0" max="1" value="0">
</td>
</tr>
</table>
<p>
For further details see:
</p>
<p>
W. Eckstein, <i>Computer Simulation of Ion-Solid Interactions</i>,<br>
Springer Series in Materials Science, Vol. 10 (Springer-Verlag, Berlin, 1991).<br>
<a href="https://doi.org/10.1007/978-3-642-73513-4">
https://doi.org/10.1007/978-3-642-73513-4
</a>
</p>
</div>
</div>
</td></tr>
<!tr>
<!td>
<!progress id="myBar" max=100 min=0><!/progress>
<!/td>
<!/tr>
</table>
</body>
<script>
document.getElementById("trimPath").value = remote.getGlobal('path');
// Catch calls for open file
ipcRenderer.on('openFile', function(event, filename) {
console.log('Open file '+filename);
fs.readFile(filename.toString(), function read(err, data) {
if (err) {
throw err;
}
setValues(data);
});
});
let workPath = document.getElementById("workPath");
// If empty or undefined use local folder as default
if (workPath.value == '' || workPath.value == undefined ) {
// workPath.value = process.cwd();
workPath.value = '/tmp';
//app.setPath('temp',process.cwd());
}
// Catch calls for selectfolder
ipcRenderer.on('selectFolder', function(event, foldername) {
if (foldername.length != 0) {
document.getElementById("workPath").value = foldername[0];
// Change process directory
process.chdir(foldername[0]);
}
console.log("currentdir",process.cwd());
});
// Catch calls for save as
ipcRenderer.on('saveFile', function(event, filename) {
// If filename is empty use default value
if (filename == '') {filename='TrimSP.cfg';}
// Get values from all fields and prepare config file
let trimSPcfg=prep_cfg(0);
// Save file to filename
console.log('Save file to '+filename);
try { fs.writeFileSync(filename, trimSPcfg, 'utf-8'); }
catch(e) { alert('Failed to save the file !'); }
});
// Catch calls for plotProf
ipcRenderer.on('plotProf', function(event, filename) {
console.log("filename="+filename);
plotProfiles(filename);
});
// Catch calls for plotFrac
ipcRenderer.on('plotFrac', function(event, filename) {
console.log("filename="+filename);
plotFractions(filename);
});
// Catch calls for plotMean
ipcRenderer.on('plotMean', function(event, filename) {
console.log("filename="+filename);
plotMean(filename);
});
// Catch clicks for Browse button
ipcRenderer.on('browseFolder', function(event, foldername) {
if (foldername.length != 0) {
document.getElementById("workPath").value = foldername[0];
// Change process directory
process.chdir(foldername[0]);
}
});
// Get the element with id="defaultOpen" and click on it
document.getElementById("btnLayers").click();
</script>
</html>