示例#1
0
    def launch(self, application):
        Solver.launch(self, application)

        # verify the machine layout
        layout = application.layout
        rank = layout.rank
        communicator = layout.communicator

        if not communicator:
            import journal
            journal.error(self.name).log("null communicator")
            return

        if communicator.size > 1:
            import journal
            journal.error(self.name).log("this is a single processor solver")
            return

        # save the communicator info
        self._fluidServer = rank
        self._solidServer = (rank + 1) % 2

        self.coupler = application.coupler

        # initial boundary synchronization with the fluid
        if self.inventory.syncOnInit:
            self.applyBoundaryConditions()
        else:
            raise "pulse requires options.syncBoundaryInitialization=true"

        from pyre.units.SI import second
        t, step = 0.0 * second, 0

        return (t, step)
示例#2
0
	def endSimulation( self, step ):
		BaseSolver.endSimulation( self, step, self.t )

		# StGermain stuff
		self._context.Stg_Class_Delete()

		return
示例#3
0
    def launch(self, application):
        Solver.launch(self, application)

        # verify the machine layout
        layout = application.layout  
        rank = layout.rank
        communicator = layout.communicator

        if not communicator:
            import journal
            journal.error(self.name).log("null communicator")
            return

        if communicator.size > 1:
            import journal
            journal.error(self.name).log("this is a single processor solver")
            return

        # save the communicator info
        self._fluidServer = rank
        self._solidServer = (rank + 1) % 2

        self.coupler = application.coupler

        # initial boundary synchronization with the fluid
        if self.inventory.syncOnInit:
            self.applyBoundaryConditions()
        else:
            raise "pulse requires options.syncBoundaryInitialization=true"
            
        from pyre.units.SI import second
        t, step = 0.0*second, 0

        return (t, step)
示例#4
0
	def newStep( self, t, step ):
		BaseSolver.newStep( self, t, step )

		# Coupler stuff
		if self.coupler:
			self.coupler.newStep()
		return
示例#5
0
    def newStep(self, t, step):
        BaseSolver.newStep(self, t, step)

        # Coupler stuff
        if self.coupler:
            self.coupler.newStep()
        return
示例#6
0
    def endSimulation(self, step):
        BaseSolver.endSimulation(self, step, self.t)

        # StGermain stuff
        self._context.Stg_Class_Delete()

        return
示例#7
0
	def initialize( self, application ):
		BaseSolver.initialize( self, application )

		# StGermain stuff
		self._dictionary = application._dictionary
		self.communicator = application.solverCommunicator
		if not application._context:
			application._context = application.BuildContext()
		self._context = application._context

		# StGermain build... required now... as in the coupled case we control the coupling-boundary and it needs to be
		# prepared first. Also The geometry needs to be set.
		self._context.Construct()
		self._context.Build()
		self._context.Initialise()

		# Coupler stuff
		try:
			application.inventory.coupler
		except AttributeError:
			pass
		else:
			self.myPlus = application.myPlus
			self.remotePlus = application.remotePlus
			self.exchanger = application.exchanger
			self.coupler = application.inventory.coupler
			if self.coupler:
				self.coupler.initialize( self )
		return
示例#8
0
    def initialize(self, application):
        BaseSolver.initialize(self, application)

        # StGermain stuff
        self._dictionary = application._dictionary
        self.communicator = application.solverCommunicator
        if not application._context:
            application._context = application.BuildContext()
        self._context = application._context

        # StGermain build... required now... as in the coupled case we control the coupling-boundary and it needs to be
        # prepared first. Also The geometry needs to be set.
        self._context.Construct()
        self._context.Build()
        self._context.Initialise()

        # Coupler stuff
        try:
            application.inventory.coupler
        except AttributeError:
            pass
        else:
            self.myPlus = application.myPlus
            self.remotePlus = application.remotePlus
            self.exchanger = application.exchanger
            self.coupler = application.inventory.coupler
            if self.coupler:
                self.coupler.initialize(self)
        return
示例#9
0
	def endTimestep( self, t, steps, done ):
		BaseSolver.endTimestep( self, t )

		# Coupler stuff
		if self.coupler:
			done = self.coupler.endTimestep( steps, done )

		return done
示例#10
0
    def __init__(self):
        Solver.__init__(self, "rigid")

        self.coupler = None
        self._fluidServer = None
        self._solidServer = None

        return
示例#11
0
    def endTimestep(self, t, steps, done):
        BaseSolver.endTimestep(self, t)

        # Coupler stuff
        if self.coupler:
            done = self.coupler.endTimestep(steps, done)

        return done
示例#12
0
    def __init__(self):
        Solver.__init__(self, "rigid")

        self.coupler = None
        self._fluidServer = None
        self._solidServer = None

        return
示例#13
0
    def __init__(self):
        Solver.__init__(self, "pulse")

        self.coupler = None
        self._fluidServer = None
        self._solidServer = None

        self.generator = None

        return
示例#14
0
    def __init__(self):
        Solver.__init__(self, "pulse")

        self.coupler = None
        self._fluidServer = None
        self._solidServer = None

        self.generator = None
        
        return
示例#15
0
    def publishState(self, directory):
        Solver.publishState(self, directory)

        # pRange = self.coupler.pressureRange()
        # self._monitorInfo.log("pressure range: (%g, %g) pascal" % pRange)

        # NYI
        # self.coupler.publish()

        Solver.publishState(self, directory)
        return
示例#16
0
    def advance(self, dt):
        BaseSolver.advance(self, dt)

        # For imposing Force Boundary condition in coupled case
        if self.coupler:
            self.coupler.preVSolverRun()

        # StGermain stuff
        self._context.Step(dt)

        return
示例#17
0
    def applyBoundaryConditions(self):
        Solver.applyBoundaryConditions(self)
    
        import mpi
        rank = mpi.world().rank

        self.coupler.exchangeBoundary()
        self.generator.updatePressure(self.coupler.boundary)
        self.coupler.exchangeFields()
    
        return
示例#18
0
	def advance( self, dt ):
		BaseSolver.advance( self, dt )

		# For imposing Force Boundary condition in coupled case
		if self.coupler:
		    self.coupler.preVSolverRun()

		# StGermain stuff
		self._context.Step( dt )

		return
示例#19
0
    def applyBoundaryConditions(self):
        Solver.applyBoundaryConditions(self)

        import mpi
        rank = mpi.world().rank

        self.coupler.exchangeBoundary()
        self.generator.updatePressure(self.coupler.boundary)
        self.coupler.exchangeFields()

        return
示例#20
0
    def publishState(self, directory):
        Solver.publishState(self, directory)

        # pRange = self.coupler.pressureRange()
        # self._monitorInfo.log("pressure range: (%g, %g) pascal" % pRange)

        # NYI
        # self.coupler.publish()

        Solver.publishState(self, directory)
        return
示例#21
0
    def stableTimestep(self):
        dt = self.inventory.timestep

        sink = self._fluidServer
        source = self._solidServer

        import pulse
        from pyre.units.time import second
        dt = pulse.timestep(sink, source, dt.value) * second

        Solver.stableTimestep(self, dt)
        return dt
示例#22
0
    def stableTimestep(self):
        dt = self.inventory.timestep
    
        sink = self._fluidServer
        source = self._solidServer
        
        import pulse
        from pyre.units.time import second
        dt = pulse.timestep(sink, source, dt.value) * second

        Solver.stableTimestep(self, dt)
        return dt
示例#23
0
	def __init__( self, name="solver", facility="solver" ):
		BaseSolver.__init__( self, name, facility )

		# StGermain stuff
		self._context = None
		self.communicator = None
		self._dictionary = None
		self.dt_prev = 0.0

		# Coupler stuff
		self.coupler = None
		self.exchanger = None
		self.myPlus = []
		self.remotePlus = []

		self.start_cpu_time = 0
		self.cpu_time = 0
		self.model_time = 0
		self.fptime = None
		return
示例#24
0
    def __init__(self, name="solver", facility="solver"):
        BaseSolver.__init__(self, name, facility)

        # StGermain stuff
        self._context = None
        self.communicator = None
        self._dictionary = None
        self.dt_prev = 0.0

        # Coupler stuff
        self.coupler = None
        self.exchanger = None
        self.myPlus = []
        self.remotePlus = []

        self.start_cpu_time = 0
        self.cpu_time = 0
        self.model_time = 0
        self.fptime = None
        return
示例#25
0
	def stableTimestep( self ):
		dt = self._context.Dt()
		if self.dt_prev > dt:
			dt = self.dt_prev
		else:
			self.dt_prev = dt

		# Coupler stuff
		if self.coupler:
			# negotiate with other solver(s)
			dt = self.coupler.stableTimestep( dt )

		return BaseSolver.stableTimestep( self, dt )
示例#26
0
    def stableTimestep(self):
        dt = self._context.Dt()
        if self.dt_prev > dt:
            dt = self.dt_prev
        else:
            self.dt_prev = dt

        # Coupler stuff
        if self.coupler:
            # negotiate with other solver(s)
            dt = self.coupler.stableTimestep(dt)

        return BaseSolver.stableTimestep(self, dt)
示例#27
0
 def applyBoundaryConditions(self):
     Solver.applyBoundaryConditions(self)
     self.coupler.exchangeBoundary()
     self.coupler.exchangeFields()
     return
示例#28
0
 def _configure(self):
     Solver._configure(self)
     self.generator = self.inventory.generator
     return
示例#29
0
 def publishState(self, directory):
     # NYI
     # self.coupler.publish()
     Solver.publishState(self, directory)
     return
示例#30
0
 def launch(self, application):
     BaseSolver.launch(self, application)
     # Coupler stuff
     if self.coupler:
         self.coupler.launch(self)
     return
示例#31
0
	def launch( self, application ):
		BaseSolver.launch( self, application )
		# Coupler stuff
		if self.coupler:
			self.coupler.launch( self )
		return
示例#32
0
 def advance(self, dt):
     Solver.advance(self, dt)
     self.inventory.generator.advance(dt)
     return
示例#33
0
 def publishState(self, directory):
     # NYI
     # self.coupler.publish()
     Solver.publishState(self, directory)
     return
示例#34
0
 def applyBoundaryConditions(self):
     Solver.applyBoundaryConditions(self)
     self.coupler.exchangeBoundary()
     self.coupler.exchangeFields()
     return
示例#35
0
 def _configure(self):
     Solver._configure(self)
     self.generator = self.inventory.generator
     return
示例#36
0
 def advance(self, dt):
     Solver.advance(self, dt)
     self.inventory.generator.advance(dt)
     return