Example #1
0
    def evaluate(self, structure, gtol=None):

        if gtol is None:
            gtol = self.target_forces

        positions, forces, energy = lj_compact_evaluate(structure, gtol, self.minimal_density)

        structure.set_positions(positions)
        structure.relocate_to_cm()
        if structure.natom > 2:
            structure.align_inertia_momenta()
        sorted_indices = structure.sort_sites()
        forces = forces[sorted_indices]
        pg = get_point_group(structure, executable='symmol')
        properties = {'forces': generic_serializer(forces), 'energy': energy, 'point_group': pg}
        return structure, properties
Example #2
0
    def evaluate(self, entry_id, gtol=None):

        if gtol is None:
            gtol = self.target_forces

        print('Evaluating %s target density= %7.3F' % (entry_id, self.minimal_density))
        structure = self.get_structure(entry_id)

        positions, forces, energy = lj_compact_evaluate(structure, gtol, self.minimal_density)

        structure.set_positions(positions)
        structure.relocate_to_cm()
        if structure.natom > 2:
            structure.align_inertia_momenta()
        sorted_indices = structure.sort_sites()
        forces = forces[sorted_indices]
        properties = {'forces': generic_serializer(forces), 'energy': energy}
        return structure, properties, energy
Example #3
0
    def evaluate(self, entry_id, gtol=None):

        if gtol is None:
            gtol = self.target_forces

        print('Evaluating %s target density= %7.3F' %
              (entry_id, self.minimal_density))
        structure = self.get_structure(entry_id)

        positions, forces, energy = lj_compact_evaluate(
            structure, gtol, self.minimal_density)

        structure.set_positions(positions)
        structure.relocate_to_cm()
        if structure.natom > 2:
            structure.align_inertia_momenta()
        sorted_indices = structure.sort_sites()
        forces = forces[sorted_indices]
        properties = {'forces': generic_serializer(forces), 'energy': energy}
        return structure, properties, energy
Example #4
0
    def evaluate(self, structure, gtol=None):

        if gtol is None:
            gtol = self.target_forces

        positions, forces, energy = lj_compact_evaluate(
            structure, gtol, self.minimal_density)

        structure.set_positions(positions)
        structure.relocate_to_cm()
        if structure.natom > 2:
            structure.align_inertia_momenta()
        sorted_indices = structure.sort_sites()
        forces = forces[sorted_indices]
        pg = get_point_group(structure, executable='symmol')
        properties = {
            'forces': generic_serializer(forces),
            'energy': energy,
            'point_group': pg
        }
        return structure, properties