def __init__(self, potentials=None, avgn=None, **kwargs):
<EOL>self.pots = [ ]<EOL>self.couls = [ ]<EOL>if potentials is not None:<EOL><INDENT>for pot in potentials:<EOL><INDENT>if isinstance(pot, Atomistica):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if hasattr(pot, '<STR_LIT>'):<EOL><INDENT>self.couls += [ pot ]<EOL><DEDENT>else:<EOL><INDENT>self.pots += [ pot ]<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>pot = self.potential_class(**convpar(kwargs))<EOL>if hasattr(pot, '<STR_LIT>'):<EOL><INDENT>self.couls += [ pot ]<EOL><DEDENT>else:<EOL><INDENT>self.pots += [ pot ]<EOL><DEDENT><DEDENT>if avgn:<EOL><INDENT>self.avgn = avgn<EOL><DEDENT>self.particles = None<EOL>self.nl = None<EOL>self.charges = None<EOL>self.initial_charges = None<EOL>self.mask = None<EOL>self.force_update = True<EOL>self.kwargs = kwargs<EOL>self.compute_epot_per_bond = False<EOL>self.compute_f_per_bond = False<EOL>self.compute_wpot_per_at = False<EOL>self.compute_wpot_per_bond = False<EOL>self.epot_per_bond = None<EOL>self.f_per_bond = None<EOL>self.wpot_per_bond = None<EOL>
Initialize a potential. *potential* is the a native Atomistica
potential class, in which case the arguments are given by the
keywords of this function. Alternatively, it can be a list of tuples
[ ( pot1, args1 ), ... ] in which case *pot1* is the name of the
first potential and *args1* a dictionary containing its arguments.