Skip to content

Commit

Permalink
SOF-7123: context provider for DFT+U+J calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
pranabdas committed Dec 2, 2023
1 parent 37be003 commit 323f5c6
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/context/context.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BoundaryConditionsFormDataProvider } from "./providers/BoundaryConditionsFormDataProvider";
import { HubbardContextProviderLegacy } from "./providers/HubbardContextProviderLegacy";
import { HubbardJContextProvider } from "./providers/HubbardJContextProvider";
import { HubbardUContextProvider } from "./providers/HubbardUContextProvider";
import { HubbardVContextProvider } from "./providers/HubbardVContextProvider";
import { MLSettingsContextProvider } from "./providers/MLSettingsContextProvider";
Expand All @@ -23,6 +24,7 @@ export default {
PointsPathFormDataProvider,
ExplicitPointsPathFormDataProvider,
ExplicitPointsPath2PIBAFormDataProvider,
HubbardJContextProvider,
HubbardUContextProvider,
HubbardVContextProvider,
HubbardContextProviderLegacy,
Expand Down
5 changes: 5 additions & 0 deletions src/context/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const {
PointsPathFormDataProvider,
ExplicitPointsPathFormDataProvider,
ExplicitPointsPath2PIBAFormDataProvider,
HubbardJContextProvider,
HubbardUContextProvider,
HubbardVContextProvider,
HubbardContextProviderLegacy,
Expand Down Expand Up @@ -63,6 +64,10 @@ export const wodeProviders = {
providerCls: ExplicitPointsPath2PIBAFormDataProvider,
config: _makeImportant({ name: "explicitKPath2PIBA" }),
},
HubbardJContextManager: {
providerCls: HubbardJContextProvider,
config: _makeImportant({ name: "hubbard_j" }),
},
HubbardUContextManager: {
providerCls: HubbardUContextProvider,
config: _makeImportant({ name: "hubbard_u" }),
Expand Down
95 changes: 95 additions & 0 deletions src/context/providers/HubbardJContextProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { HubbardUContextProvider } from "./HubbardUContextProvider";

const defaultHubbardConfig = {
paramType: "U",
atomicSpecies: "",
atomicOrbital: "2p",
value: 1.0,
};

export class HubbardJContextProvider extends HubbardUContextProvider {
get defaultData() {
return [
{
...defaultHubbardConfig,
atomicSpecies: this.uniqueElements?.length > 0 ? this.uniqueElements[0] : "",
},
];
}

get uiSchemaStyled() {
return {
"ui:options": {
addable: true,
orderable: true,
removable: true,
},
title: {
"ui:classNames": "col-xs-12",
},
items: {
paramType: this.defaultFieldStyles,
atomicSpecies: this.defaultFieldStyles,
atomicOrbital: this.defaultFieldStyles,
value: this.defaultFieldStyles,
},
};
}

get jsonSchema() {
return {
$schema: "http://json-schema.org/draft-04/schema#",
title: "",
description: "Hubbard parameters for DFT+U+J calculation.",
type: "array",
items: {
type: "object",
properties: {
paramType: {
type: "string",
title: "Species",
enum: ["U", "J", "B", "E2", "E3"],
default: defaultHubbardConfig.paramType,
},
atomicSpecies: {
type: "string",
title: "Species",
enum: this.uniqueElements,
default: this.uniqueElements?.length > 0 ? this.uniqueElements[0] : "",
},
atomicOrbital: {
type: "string",
title: "Orbital",
enum: [
"2p",
"3s",
"3p",
"3d",
"4s",
"4p",
"4d",
"4f",
"5s",
"5p",
"5d",
"5f",
"6s",
"6p",
"6d",
"7s",
"7p",
"7d",
],
default: defaultHubbardConfig.atomicOrbital,
},
value: {
type: "number",
title: "Value (eV)",
default: defaultHubbardConfig.value,
},
},
},
minItems: 1,
};
}
}

0 comments on commit 323f5c6

Please sign in to comment.