Beispiel #1
0
scheduler = SSPy(verbose=True)

my_model_container = None

#
# Create a model container service and load an ndf file
#
my_model_container = scheduler.CreateService(name="My Model Container",
                                             type="model_container")

my_model_container.Load('chemesis/cal1.ndf')

#
# Must create solver.
#
my_chemesis3 = scheduler.CreateSolver('My Chemesis3', 'chemesis3')

# Sets the element of the model to run from
my_chemesis3.SetModelName('/cal1')

# set the timestep for the entire scheduler (solvers, inputs and outputs)
my_chemesis3.SetTimeStep(0.002)

#
# Create Outputs
#
cal_output = scheduler.CreateOutput('cal output object', 'double_2_ascii')
buf_output = scheduler.CreateOutput('buf output object', 'double_2_ascii')

cal_output.SetFilename('cal1_cal.txt')
buf_output.SetFilename('cal1_buf.txt')
Beispiel #2
0
from sspy import SSPy

scheduler = SSPy(verbose=True)

my_model_container = None
#
# Create a model container service and load an ndf file
#

my_model_container = scheduler.CreateService(name="My Model Container",
                                             type="model_container")

my_model_container.Load('tests/cells/singlep.ndf')

#
# Must create solver.
#
my_heccer = scheduler.CreateSolver('My solver', 'heccer')

# Sets the segment of the model to run from
my_heccer.SetModelName('/singlep')

# set the timestep for the entire scheduler (solvers, inputs and outputs)
my_heccer.SetTimeStep(1e-05)

scheduler.Reset()

scheduler.Run(steps=5, finish=True)

print "Simulation is %f %s complete" % (scheduler.PercentCompleted(), '%')
Beispiel #3
0
#
# Must a des.
#
my_des = scheduler.CreateEventDistributor('My DES', 'des')

my_des.SetModelName('/RSNet')

for i in range(0, nx * ny):

    path = "/RSNet/population/%s" % i

    solver_name = "heccer_%s" % i

    # Here we create a solver with the solver name being heccer_<id number>

    this_heccer = scheduler.CreateSolver(solver_name, 'heccer')

    this_heccer.SetModelName(path)

    this_heccer.SetTimeStep(2e-05)

    # This performs a lookup and set on the solver by the solver name
    # given when you create it via CreateSolver.

    scheduler.SolverSet(path, solver_name)

# need to use run prepare before we can use the other.
scheduler.RunPrepare()

# now check for solver info values