← Back to team overview

yade-users team mailing list archive

Re: [Question #678257]: export fabric tensor in txt

 

Question #678257 on Yade changed:
https://answers.launchpad.net/yade/+question/678257

    Status: Open => Answered

Jérôme Duriez proposed the following answer:
Hi,

I think #1 actually was the source of your problem.

utils.fabricTensor(splitTensor=False) returns (for some reason) a tuple
with a matrix as a first element, and no second element.

E.g. 
In [5]: fabricTensor(splitTensor=False)
Out[5]: (Matrix3(nan,nan,nan, nan,nan,nan, nan,nan,nan),) # "nan" at a state without any interactions

Then:

In [2]: fabricTensor(splitTensor=False)[0]
Out[2]: Matrix3(nan,nan,nan, nan,nan,nan, nan,nan,nan) # is a matrix...

and you do not deal yet with numbers.
(fabricTensor(splitTensor=False)[0][0][0] would)


Going into more details, plot.addData() can deal with matrices: it stores all the components in plot.data, but plot.saveDataTxt() can deal with numbers only.


Jérôme

PS : please avoid "NameError: name 'plot' is not defined" in your script
next time... ;-)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.