def __init__(self, symbols, potential_type='eamembed'):

        Potential.__init__(self,
                           symbols=symbols,
                           potential_type=potential_type,
                           is_charge=False)

        self.embedding_evaluations = None
Beispiel #2
0
    def __init__(self, symbols, potential_type='eamdens'):

        Potential.__init__(self,
                           symbols=symbols,
                           potential_type=potential_type,
                           is_charge=False)

        self.density_evaluations = None
Beispiel #3
0
    def __init__(self,
            symbols,
            func_pair=None,
            func_density=None,
            func_embedding=None,
            filename=None):

        # parameter format strings
        self.PYPOSPACK_EAM_PAIR_FORMAT = "{s1}{s2}_eam_pair_{p}"
        self.PYPOSPACK_EAM_DENSITY_FORMAT = "{s1}_eam_density_{p}"
        self.PYPOSPACK_EAM_EMBEDDING_FORMAT = "{s1}_eam_embedding_{p}"

        # these are pypospack.potential.Potential objects
        self.obj_pair = None
        self.obj_density = None
        self.obj_embedding = None

        self.N_r = None
        self.r_max = None
        self.r_cut = None

        self.N_rho = None
        self.rho_max = None

        # these will be numpy arrays
        self.r = None
        self.rho = None
        self.pair= None
        self.density = None
        self.embedding = None

        self.symbols = symbols

        self.setfl_filename_src = filename
        self.setfl_filename_dst = "{symbols}.eam.alloy".format(
                symbols="".join(self.symbols))
        self.setfl = None

        if filename is None:
            self.set_obj_pair(func_pair=func_pair)
            self.set_obj_density(func_density=func_density)
            self.set_obj_embedding(func_embedding=func_embedding)
        else:
            pass
            #raise NotImplementedError()

        Potential.__init__(self,
                symbols=symbols,
                potential_type='eam',
                is_charge = False)
Beispiel #4
0
def test____import__():
    from pypospack.potential import Potential

    symbols = ['Ni']
    
    with pytest.raises(NotImplementedError):
        testpot = Potential(symbols=symbols)
Beispiel #5
0
def test___init____():
    #<--- test vars
    symbols = ['Ni']

    #<--- test setup
    from pypospack.potential import Potential

    #<---- code being tested
    with pytest.raises(NotImplementedError):
        testpot = Potential(symbols=symbols)
Beispiel #6
0
    def __init__(self,
                 symbols,
                 func_pair=None,
                 func_density=None,
                 func_embedding=None,
                 filename=None):

        # these are pypospack.potential.Potential objects
        self.obj_pair = None
        self.obj_density = None
        self.obj_embedding = None

        self.setfl_filename_src = filename
        self.setfl_filename_dst = "{}.eam.alloy".format("".join(symbols))
        self.setfl = None

        potential_type = EamPotential.potential_type
        Potential.__init__(self,
                           symbols=symbols,
                           potential_type=potential_type,
                           is_charge=False)

        if filename is None:
            self.set_obj_pair(func_pair=func_pair)
            self.set_obj_density(func_density=func_density)
            self.set_obj_embedding(func_embedding=func_embedding)
        else:
            raise NotImplementedError()

        self.N_r = None
        self.r_max = None
        self.r_cut = None

        self.N_rho = None
        self.rho_max = None

        # these will be numpy arrays
        self.r = None
        self.rho = None
        self.pair = None
        self.density = None
        self.embedding = None
from pypospack import potential
from pypospack.potential import Potential

potential_list = []
for potential in Potential.__subclasses__():
    print(potential,potential.__subclasses__())
    if potential.__subclasses__() != []:
       potential_list.append(potential)

    for sub_potential in potential.__subclasses__():
        if potential.__subclasses__() != []:
           potential_list.append(potential)

exit()
for i in dir(potential):
    print(i," ",type(getattr(potential,i)))
    #print(getattr(potential,i))
    #print(isinstance(getattr(potential,i),Potential))
Beispiel #8
0
 def __init__(self,symbols,potential_type,is_charge):
     Potential.__init__(self,
             symbols=symbols,
             potential_type=potential_type,
             is_charge=is_charge)
     self.pair_evaluations = None
Beispiel #9
0
 class PotentialTest(Potential):
     def __init__(self,symbols): Potential.__init__(self,symbols)
Beispiel #10
0
 def __init__(self,symbols): Potential.__init__(self,symbols)
 def __init_parameter_names(self): self.parameter_names = []