How to use the diffusion.DiffusionComponent function in diffusion

To help you get started, we’ve selected a few diffusion examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github landlab / landlab / landlab / components / diffusion / diffusion_model.py View on Github external
def initialize(self, input_stream=None):
    
        # If no input file/stream specified, use default (or command line?)
        # (or default values?)
        if input_stream is None:
            input_stream = str(raw_input('Enter name of input file: '))
        
        # Open input file
        inputs = ModelParameterDictionary(input_stream)
    
        # Create grid
        self.grid = create_and_initialize_grid(inputs)
        
        # Create a diffusion component
        self.diffusion_component = diffusion.DiffusionComponent(self.grid)
        self.diffusion_component.initialize(input_stream)
        
        # Read parameters
        self.run_duration = inputs.get('RUN_DURATION', ptype=float)
        self.opt_netcdf_output = inputs.get('OPT_FILE_OUTPUT', ptype='bool')
        self.opt_display_output = inputs.get('OPT_DISPLAY_OUTPUT', ptype='bool')
        
        self.setup_output_timing(inputs)

diffusion

Python SDK for Diffusion.

MIT
Latest version published 17 days ago

Package Health Score

81 / 100
Full package analysis