yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #22778
Re: [Question #689919]: Accumulation effect of heat over time steps
Question #689919 on Yade changed:
https://answers.launchpad.net/yade/+question/689919
Status: Open => Answered
Jan Stránský proposed the following answer:
to compute temperature, probably some loop inside collect method:
###
def __init__(self):
...
self.temperatureData = dict(self.cumulativeData) # one more copy
...
def collect(self):
self.currentData = ...
self.computeTemperature() # here
def computeTemperature(self): # compute and store actual temperature
for k,cur in self.currentData.items():
cum = self.cumulativeData[k]
temerature = ... # some computation here
self.temperatureData[k] = temperature
###
to print, just print it then :-)
###
def pprint(self):
...
print("temperatures")
print("============")
for key,valve in self.temperatureData.items():
print(key,valve)
###
What I have created was just to show the idea of the approach, according
to your specific needs, you can modify it to look completely different
:-)
Also if the computation takes too long with Python, it is possible to
create a C++ engine. But it is a nice feature that you can play easily
with Python beforehand :-)
cheers
Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.