예제 #1
0
class PhononAbinitInput(AbinitBasicInputMixin, EmbeddedDocument):
    gs_input = MSONField(
        help_text="The last input used to calculate the wafunctions.")
    ddk_input = MSONField(
        help_text="The last input used to calculate one of the ddk.")
    dde_input = MSONField(
        help_text="The last input used to calculate one of the dde.")
    wfq_input = MSONField(
        help_text="The last input used to calculate one of the wfq.")
    phonon_input = MSONField(
        help_text="The last input used to calculate one of the phonons.")
    kppa = IntField()
    ngqpt = ListField(IntField())
    qpoints = DictField()
    qppa = IntField()
예제 #2
0
class DteAbinitInput(AbinitBasicInputMixin, EmbeddedDocument):
    """
    EmbeddedDocument containing the typical inputs for a DTE workflow.

    .. rubric:: Inheritance Diagram
    .. inheritance-diagram:: DteAbinitInput
    """

    gs_input = MSONField(help_text="The last input used to calculate the wafunctions.")
    ddk_input = MSONField(help_text="The last input used to calculate one of the ddk.")
    dde_input = MSONField(help_text="The last input used to calculate one of the dde.")
    dte_input = MSONField(help_text="The last input used to calculate one of the dte.")
    phonon_input = MSONField(help_text="The last input used to calculate one of the phonons.")
    kppa = IntField()
    with_phonons = BooleanField(help_text="Whether the phonon perturbations have been included or not")
예제 #3
0
class AbinitBasicInputMixin(object):
    """
    Mixin providing some basic fields that are required to run a calculation.
    """
    #TODO add more variables
    structure = MSONField()
    ecut = FloatField()
    nshiftk = IntField()
    shiftk = ListField(ListField(FloatField()))
    ngkpt = ListField(IntField())
    kptrlatt = ListField(ListField(IntField()))
    dilatmx = FloatField(default=1)
    occopt = IntField()
    tsmear = FloatField()
    pseudopotentials = EmbeddedDocumentField(AbinitPseudoData,
                                             default=AbinitPseudoData)

    def set_abinit_basic_from_abinit_input(self, abinit_input):
        """
        create the object from an AbinitInput object
        """
        self.structure = abinit_input.structure.as_dict()
        self.ecut = abinit_input['ecut']
        # kpoints may be defined in different ways
        self.nshiftk = abinit_input.get('nshiftk', None)
        self.shiftk = abinit_input.get('shiftk', None)
        self.ngkpt = abinit_input.get('ngkpt', None)
        self.kptrlatt = abinit_input.get('kptrlatt', None)
        self.dilatmx = abinit_input.get('dilatmx', 1)
        self.occopt = abinit_input.get('occopt', 1)
        self.tsmear = abinit_input.get('tsmear', None)
예제 #4
0
class DteResult(MaterialMixin, DateMixin, DirectoryMixin, CustomFieldMixin, Document):
    """
    Document containing the results for a dte workflow.
    Includes information from the various steps of the workflow (scf, ddk, dde, ph, dte, anaddb)

    .. rubric:: Inheritance Diagram
    .. inheritance-diagram:: DteResult
    """

    mp_id = StringField()
    relax_db = MSONField()
    relax_id = StringField()
    time_report = MSONField()
    fw_id = IntField()
    abinit_input = EmbeddedDocumentField(DteAbinitInput, default=DteAbinitInput)
    abinit_output = EmbeddedDocumentField(DteAbinitOutput, default=DteAbinitOutput)
예제 #5
0
class PhononResult(MaterialMixin, DateMixin, DirectoryMixin, Document):
    """
    Document containing the results for a phonon workflow.
    Includes information from the various steps of the workflow (scf, nscf, ddk, dde, ph, anaddb)
    """

    mp_id = StringField()
    # relax_result = ReferenceField(RelaxationResult)
    relax_db = MSONField()
    relax_id = StringField()
    time_report = MSONField()
    fw_id = IntField()
    abinit_input = EmbeddedDocumentField(PhononAbinitInput,
                                         default=PhononAbinitInput)
    abinit_output = EmbeddedDocumentField(PhononAbinitOutput,
                                          default=PhononAbinitOutput)
예제 #6
0
class PhononAbinitInput(AbinitBasicInputMixin, EmbeddedDocument):
    """
    EmbeddedDocument containing the typical inputs for a phonon workflow.

    .. rubric:: Inheritance Diagram
    .. inheritance-diagram:: PhononAbinitInput
    """

    gs_input = MSONField(help_text="The last input used to calculate the wafunctions.")
    ddk_input = MSONField(help_text="The last input used to calculate one of the ddk.")
    dde_input = MSONField(help_text="The last input used to calculate one of the dde.")
    wfq_input = MSONField(help_text="The last input used to calculate one of the wfq.")
    phonon_input = MSONField(help_text="The last input used to calculate one of the phonons.")
    kppa = IntField()
    ngqpt = ListField(IntField())
    qpoints = ListField()
    qppa = IntField()
예제 #7
0
class AbinitDftpOutputMixin(object):
    """
    Mixin providing generic fiels for dfpt calculation
    """

    ddb = AbiFileField(abiext="DDB", abiform="t", help_text="DDB file produced by a dfpt falculation",
                       db_field='ddb_id', collection_name='ddb_fs')
    structure = MSONField(required=True, help_text="The structure used for the calculation.")
예제 #8
0
class RelaxAbinitInput(AbinitBasicInputMixin, EmbeddedDocument):
    """
    EmbeddedDocument containing the typical inputs for a relaxation workflow.

    .. rubric:: Inheritance Diagram
    .. inheritance-diagram:: RelaxAbinitInput
    """

    last_input = MSONField(help_text="The last input used for the calculation.")
    kppa = IntField()
예제 #9
0
class DfptResult(MaterialMixin, DateMixin, DirectoryMixin, CustomFieldMixin, Document):
    """
    Document containing the results for a dfpt workflow.
    Includes information from the various steps of the workflow (scf, nscf, ddk, dde, ph, strain, dte, anaddb)

    .. rubric:: Inheritance Diagram
    .. inheritance-diagram:: DfptResult
    """

    mp_id = StringField()
    relax_db = MSONField()
    relax_id = StringField()
    time_report = MSONField()
    fw_id = IntField()
    abinit_input = EmbeddedDocumentField(DfptAbinitInput, default=DfptAbinitInput)
    abinit_output = EmbeddedDocumentField(DfptAbinitOutput, default=DfptAbinitOutput)

    has_phonons = BooleanField(help_text="Whether the phonon perturbations have been included or not", default=False)
    has_ddk = BooleanField(help_text="Whether the ddk perturbations have been included or not", default=False)
    has_dde = BooleanField(help_text="Whether the dde perturbations have been included or not", default=False)
    has_strain = BooleanField(help_text="Whether the strain perturbations have been included or not", default=False)
    has_dte = BooleanField(help_text="Whether the dte perturbations have been included or not", default=False)
예제 #10
0
class RelaxResult(MaterialMixin, DateMixin, DirectoryMixin, Document):
    """
    Document containing the results for a relaxation workflow consisting of an ion followed by ioncell relaxations.
    """

    history = DictField()
    mp_id = StringField()
    abinit_input = EmbeddedDocumentField(RelaxAbinitInput,
                                         default=RelaxAbinitInput)
    abinit_output = EmbeddedDocumentField(RelaxAbinitOutput,
                                          default=RelaxAbinitOutput)
    time_report = MSONField()
    fw_id = IntField()
예제 #11
0
파일: mixins.py 프로젝트: setten/abiflows
class GroundStateOutputMixin(object):
    """
    Mixin providing generic fiels for ground state calculation
    """
    #TODO would it be convenient to make these FloatWithUnitField?
    final_energy = FloatField(help_text="Final energy obtained computed in eV")
    efermi = FloatField(help_text="Computed Fermi energy in eV")
    total_magnetization = FloatField(
        help_text="Total magnetization computed"
    )  # does pymatgen have a default unit for this?

    structure = MSONField(
        required=True,
        help_text=
        "The structure used for the calculation. If a relaxation the final structure."
    )
예제 #12
0
class RelaxAbinitInput(AbinitBasicInputMixin, EmbeddedDocument):
    last_input = MSONField(
        help_text="The last input used for the calculation.")
    kppa = IntField()