def __init__(self, filename, groups, period, header_prefix='', r0_file=None, overwrite=False, phase=0): hoomd.util.print_status_line() # initialize base class _analyzer.__init__(self) # create the c++ mirror class self.cpp_analyzer = _deprecated.MSDAnalyzer( hoomd.context.current.system_definition, filename, header_prefix, overwrite) self.setupAnalyzer(period, phase) # it is an error to specify no groups if len(groups) == 0: hoomd.context.msg.error( 'At least one group must be specified to analyze.msd\n') raise RuntimeError('Error creating analyzer') # set the group columns for cur_group in groups: self.cpp_analyzer.addColumn(cur_group.cpp_group, cur_group.name) if r0_file is not None: self.cpp_analyzer.setR0(r0_file)
def __init__(self, mc, filename, xmax, dx, navg, period, overwrite=False, phase=0): hoomd.util.print_status_line() # initialize base class _analyzer.__init__(self) # create the c++ mirror class cls = None if isinstance(mc, integrate.sphere): cls = _hpmc.AnalyzerSDFSphere elif isinstance(mc, integrate.convex_polygon): cls = _hpmc.AnalyzerSDFConvexPolygon elif isinstance(mc, integrate.simple_polygon): cls = _hpmc.AnalyzerSDFSimplePolygon elif isinstance(mc, integrate.convex_polyhedron): cls = _hpmc.AnalyzerSDFConvexPolyhedron elif isinstance(mc, integrate.convex_spheropolyhedron): cls = _hpmc.AnalyzerSDFSpheropolyhedron elif isinstance(mc, integrate.ellipsoid): cls = _hpmc.AnalyzerSDFEllipsoid elif isinstance(mc, integrate.convex_spheropolygon): cls = _hpmc.AnalyzerSDFSpheropolygon else: hoomd.context.msg.error("analyze.sdf: Unsupported integrator.\n") raise runtime_error("Error initializing analyze.sdf") self.cpp_analyzer = cls(hoomd.context.current.system_definition, mc.cpp_integrator, xmax, dx, navg, filename, overwrite) self.setupAnalyzer(period, phase) # meta data self.filename = filename self.xmax = xmax self.dx = dx self.navg = navg self.period = period self.overwrite = overwrite self.metadata_fields = [ 'filename', 'xmax', 'dx', 'navg', 'period', 'overwrite' ]
def __init__(self, mc, filename, xmax, dx, navg, period, overwrite=False, phase=0): hoomd.util.print_status_line(); # initialize base class _analyzer.__init__(self); # create the c++ mirror class cls = None; if isinstance(mc, integrate.sphere): cls = _hpmc.AnalyzerSDFSphere; elif isinstance(mc, integrate.convex_polygon): cls = _hpmc.AnalyzerSDFConvexPolygon; elif isinstance(mc, integrate.simple_polygon): cls = _hpmc.AnalyzerSDFSimplePolygon; elif isinstance(mc, integrate.convex_polyhedron): cls = _hpmc.AnalyzerSDFConvexPolyhedron; elif isinstance(mc, integrate.convex_spheropolyhedron): cls = _hpmc.AnalyzerSDFSpheropolyhedron; elif isinstance(mc, integrate.ellipsoid): cls = _hpmc.AnalyzerSDFEllipsoid; elif isinstance(mc, integrate.convex_spheropolygon): cls =_hpmc.AnalyzerSDFSpheropolygon; else: hoomd.context.msg.error("analyze.sdf: Unsupported integrator.\n"); raise runtime_error("Error initializing analyze.sdf"); self.cpp_analyzer = cls(hoomd.context.current.system_definition, mc.cpp_integrator, xmax, dx, navg, filename, overwrite); self.setupAnalyzer(period, phase); # meta data self.filename = filename self.xmax = xmax self.dx = dx self.navg = navg self.period = period self.overwrite = overwrite self.metadata_fields = ['filename', 'xmax', 'dx', 'navg', 'period', 'overwrite']
def __init__(self, filename, groups, period, header_prefix='', r0_file=None, overwrite=False, phase=0): hoomd.util.print_status_line(); # initialize base class _analyzer.__init__(self); # create the c++ mirror class self.cpp_analyzer = _deprecated.MSDAnalyzer(hoomd.context.current.system_definition, filename, header_prefix, overwrite); self.setupAnalyzer(period, phase); # it is an error to specify no groups if len(groups) == 0: hoomd.context.msg.error('At least one group must be specified to analyze.msd\n'); raise RuntimeError('Error creating analyzer'); # set the group columns for cur_group in groups: self.cpp_analyzer.addColumn(cur_group.cpp_group, cur_group.name); if r0_file is not None: self.cpp_analyzer.setR0(r0_file);