示例#1
0
    def __init__(self, targetTime=PQ.PhysicalQuantity(3., 's')):
        super(Demo13, self).__init__(file='',
                                     workdir='',
                                     targetTime=targetTime)

        self.thermal = demoapp.thermal_nonstat('inputT13.in', '.')
        self.mechanical = demoapp.mechanical('inputM13.in', '.')
        self.matPlotFig = None
示例#2
0
    def __init__(self, targetTime=PQ.PhysicalQuantity(3., 's')):
        super(Demo13, self).__init__(targetTime=targetTime)

        self.thermal = demoapp.thermal_nonstat()
        self.mechanical = demoapp.mechanical()
        self.matPlotFig = None

        if (status):  # experimental section by bp
            from Config import config
            import Pyro4
            cfg = config(3)
            ns = PyroUtil.connectNameServer(nshost=cfg.nshost,
                                            nsport=cfg.nsport,
                                            hkey=cfg.hkey)
            uri = ns.lookup(cfg.monitorName)
            self.workflowMonitor = Pyro4.Proxy(uri)
        self.updateStatus('Initialized')
        if (status):
            time.sleep(10)
示例#3
0
import argparse
#Read int for mode as number behind '-m' argument: 0-local (default), 1-ssh, 2-VPN
mode = argparse.ArgumentParser(
    parents=[Util.getParentParser()]).parse_args().mode
from Config import config
cfg = config(mode)

Util.changeRootLogger('thermal.log')

#locate nameserver
ns = PyroUtil.connectNameServer(nshost=cfg.nshost,
                                nsport=cfg.nsport,
                                hkey=cfg.hkey)

#(user, hostname)=PyroUtil.getUserInfo()

thermal = demoapp.thermal_nonstat()
thermal.initialize(
    '..' + os.path.sep + 'Example13-transiTM-local' + os.path.sep +
    'inputT13.in', '.')

PyroUtil.runAppServer(server=cfg.server,
                      port=cfg.serverPort,
                      nathost=cfg.serverNathost,
                      natport=cfg.serverNatport,
                      nshost=cfg.nshost,
                      nsport=cfg.nsport,
                      appName='thermal',
                      hkey=cfg.hkey,
                      app=thermal)
示例#4
0
from mupif import *
import demoapp
import argparse
#Read int for mode as number behind '-m' argument: 0-local (default), 1-ssh, 2-VPN
mode = argparse.ArgumentParser(
    parents=[Util.getParentParser()]).parse_args().mode
from Config import config
cfg = config(mode)

Util.changeRootLogger('thermal.log')

#locate nameserver
ns = PyroUtil.connectNameServer(nshost=cfg.nshost,
                                nsport=cfg.nsport,
                                hkey=cfg.hkey)

#(user, hostname)=PyroUtil.getUserInfo()

thermal = demoapp.thermal_nonstat(
    '..' + os.path.sep + 'Example13-transiTM-local' + os.path.sep +
    'inputT13.in', '.')
PyroUtil.runAppServer(server=cfg.server,
                      port=cfg.serverPort,
                      nathost=cfg.serverNathost,
                      natport=cfg.serverNatport,
                      nshost=cfg.nshost,
                      nsport=cfg.nsport,
                      appName='thermal',
                      hkey=cfg.hkey,
                      app=thermal)
示例#5
0
#Thermal server for nonstationary problem
from __future__ import print_function
import os,sys
sys.path.extend(['..','../../..','../Example10'])
from mupif import *
import mupif
import demoapp
import conf_vpn as cfg

#locate nameserver
ns = PyroUtil.connectNameServer(nshost=cfg.nshost, nsport=cfg.nsport, hkey=cfg.hkey)

#Run a daemon. It will run even the port has DROP/REJECT status. The connection from a client is then impossible.
daemon = cfg.Pyro4.Daemon(host=cfg.server, port=cfg.serverPort)

thermal = demoapp.thermal_nonstat('..'+os.path.sep+'Example13-thermoMechanicalNonStat'+os.path.sep+'inputT13.in','.')
#register agent
uri = daemon.register(thermal)
ns.register('thermal', uri)
mupif.log.debug ("Daemon for thermal problem runs at " + str(uri))
daemon.requestLoop()
示例#6
0
#!/usr/bin/env pythonoun            
from __future__ import print_function
import sys
sys.path.append('../../..')
from mupif import *
from mupif import logger
# Import module Example10/demoapp.py
sys.path.append('../Example10')
import demoapp

time  = 0.
dt = 0.
timestepnumber = 0
targetTime = 3

thermal = demoapp.thermal_nonstat('inputT13.in','.')
mechanical = demoapp.mechanical('inputM13.in', '.')
matPlotFig = None

while (abs(time - targetTime) > 1.e-6):

    logger.debug("Step: %g %g %g"%(timestepnumber,time,dt))
    # create a time step
    istep = TimeStep.TimeStep(time, dt, timestepnumber)

    try:
        # solve problem 1
        thermal.solveStep(istep)
        # request Temperature from thermal
        ft = thermal.getField(FieldID.FID_Temperature, istep.getTime())
        #print ("T(l/2)=", f.evaluate((2.5,0.2,0.0)))