Commit a22dc0b9 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed missing bz data.

parent dfc3aa56
......@@ -2463,8 +2463,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var dosValueFactor = E_FACTOR;
//console.log('setPoints codeName : ', calcData.code_name, calcData.cell_volume);
if (calcData.code_name === 'exciting') dosValueFactor = 1 / E_FACTOR;else if (calcData.code_name === 'VASP') dosValueFactor = 1 / (E_FACTOR * 1e-30); //calcData.cell_volume); previous version
else if (calcData.code_name === 'FHI-aims') dosValueFactor = 1;
// add exceptional cases here
//if (calcData.code_name === CODE)
// dosValueFactor = FACTOR;
// else general case
this.pointsSpin1 = [];
......@@ -5539,6 +5540,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'band_structure'), function (e2) {
var bsData = JSON.parse(e2.target.response).band_structure;
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'brillouin_zone_json'), function (e3) {
var bzData = JSON.parse(e3.target.response).brillouin_zone_json;
if (bothSpins(bsData, dosData)) _this33.spinLegend.style.display = 'block';
//***util.addBandGapData(calcData, bsData);
......@@ -5549,16 +5554,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
_this33.bandGapField.style.display = 'block';
_this33.bandGapValue.textContent = util.J2eV(calc.band_gap, 2) + ' eV ';
// console.log('calc.brillouin_zone_json',calc.brillouin_zone_json);
if (calc.brillouin_zone_json !== null) {
if (bzData) {
_this33.lowerSection.style.display = 'block';
_this33.bzViewerWrapper.setCalcData(calc.brillouin_zone_json, bsData.segments);
_this33.bzViewerWrapper.setCalcData(bzData, bsData.segments);
} else {
_this33.lowerSection.style.display = 'none';
_this33.bzViewerWrapper.setNoData();
}
//this.bzViewerWrapper.setCalcData(calc.brillouin_zone_json, bsData.segments);
//this.bzViewerWrapper.setCalcData(bzData, bsData.segments);
// if there bandstruc data && calc.band_gap === 0 => show FermiSurface
//if (calc.band_gap === 0)
//setFermiVizContent(this.fermiBox, (calc === null ? '' : util.FERMI_SURFACE_URL));
......@@ -5570,6 +5574,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
LoadingPopup.hide();
});
});
});
}
function bothSpins(bsData, dosData) {
......
......@@ -2570,12 +2570,9 @@ class DOSPlotter extends InteractivePlotterBase{
let dosValueFactor = E_FACTOR;
//console.log('setPoints codeName : ', calcData.code_name, calcData.cell_volume);
if (calcData.code_name === 'exciting')
dosValueFactor = 1/E_FACTOR;
else if (calcData.code_name === 'VASP')
dosValueFactor = 1/(E_FACTOR * 1e-30); //calcData.cell_volume); previous version
else if (calcData.code_name === 'FHI-aims')
dosValueFactor = 1;
// add exceptional cases here
//if (calcData.code_name === CODE)
// dosValueFactor = FACTOR;
// else general case
this.pointsSpin1 = [];
......@@ -6278,40 +6275,43 @@ class ElectronicStructDetails extends DetailsViewBase{
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'dos'), e1 => {
let dosData = JSON.parse(e1.target.response).dos;
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'band_structure'),
e2 => {
let bsData= JSON.parse(e2.target.response).band_structure;
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'band_structure'), e2 => {
let bsData = JSON.parse(e2.target.response).band_structure;
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'brillouin_zone_json'), e3 => {
let bzData = JSON.parse(e3.target.response).brillouin_zone_json;
if (bothSpins(bsData, dosData))
this.spinLegend.style.display = 'block';
//***util.addBandGapData(calcData, bsData);
//console.log('CODE NAME:', calc.code_name);
this.bsDosPlotter.setUpAndData(bsData, dosData, calc );
this.bsDosPlotter.setUpAndData(bsData, dosData, calc);
if (calc.has_band_structure){
if (calc.has_band_structure) {
this.bandGapField.style.display = 'block';
this.bandGapValue.textContent= util.J2eV(calc.band_gap, 2)+' eV ';
// console.log('calc.brillouin_zone_json',calc.brillouin_zone_json);
if (calc.brillouin_zone_json !== null){
this.bandGapValue.textContent = util.J2eV(calc.band_gap, 2) + ' eV ';
if (bzData) {
this.lowerSection.style.display = 'block';
this.bzViewerWrapper.setCalcData(calc.brillouin_zone_json, bsData.segments);
}else{
this.bzViewerWrapper.setCalcData(bzData, bsData.segments);
} else {
this.lowerSection.style.display = 'none';
this.bzViewerWrapper.setNoData();
}
//this.bzViewerWrapper.setCalcData(calc.brillouin_zone_json, bsData.segments);
//this.bzViewerWrapper.setCalcData(bzData, bsData.segments);
// if there bandstruc data && calc.band_gap === 0 => show FermiSurface
//if (calc.band_gap === 0)
//setFermiVizContent(this.fermiBox, (calc === null ? '' : util.FERMI_SURFACE_URL));
}else{
} else {
this.lowerSection.style.display = 'none';
this.bandGapField.style.display = 'none';
this.bzViewerWrapper.setNoData();
}
LoadingPopup.hide();
});
})
});
}
......
......@@ -309,40 +309,43 @@ class ElectronicStructDetails extends DetailsViewBase{
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'dos'), e1 => {
let dosData = JSON.parse(e1.target.response).dos;
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'band_structure'),
e2 => {
let bsData= JSON.parse(e2.target.response).band_structure;
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'band_structure'), e2 => {
let bsData = JSON.parse(e2.target.response).band_structure;
util.serverReq(util.getMaterialCalcURL(matId, calc.id, 'brillouin_zone_json'), e3 => {
let bzData = JSON.parse(e3.target.response).brillouin_zone_json;
if (bothSpins(bsData, dosData))
this.spinLegend.style.display = 'block';
//***util.addBandGapData(calcData, bsData);
//console.log('CODE NAME:', calc.code_name);
this.bsDosPlotter.setUpAndData(bsData, dosData, calc );
this.bsDosPlotter.setUpAndData(bsData, dosData, calc);
if (calc.has_band_structure){
if (calc.has_band_structure) {
this.bandGapField.style.display = 'block';
this.bandGapValue.textContent= util.J2eV(calc.band_gap, 2)+' eV ';
// console.log('calc.brillouin_zone_json',calc.brillouin_zone_json);
if (calc.brillouin_zone_json !== null){
this.bandGapValue.textContent = util.J2eV(calc.band_gap, 2) + ' eV ';
if (bzData) {
this.lowerSection.style.display = 'block';
this.bzViewerWrapper.setCalcData(calc.brillouin_zone_json, bsData.segments);
}else{
this.bzViewerWrapper.setCalcData(bzData, bsData.segments);
} else {
this.lowerSection.style.display = 'none';
this.bzViewerWrapper.setNoData();
}
//this.bzViewerWrapper.setCalcData(calc.brillouin_zone_json, bsData.segments);
//this.bzViewerWrapper.setCalcData(bzData, bsData.segments);
// if there bandstruc data && calc.band_gap === 0 => show FermiSurface
//if (calc.band_gap === 0)
//setFermiVizContent(this.fermiBox, (calc === null ? '' : util.FERMI_SURFACE_URL));
}else{
} else {
this.lowerSection.style.display = 'none';
this.bandGapField.style.display = 'none';
this.bzViewerWrapper.setNoData();
}
LoadingPopup.hide();
});
})
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment