xcfem / xc

finite element analysis package for civil engineering structures.
http://www.xcengineering.xyz/html_files/software.html
GNU General Public License v3.0
266 stars 54 forks source link

AttributeError: 'FiberSection3d' object has no attribute 'getReinfLayers' on tutorial003_script.py #62

Closed antonsurv closed 4 years ago

antonsurv commented 4 years ago

First ImportError: No module name cairo. So I install pycairo: pip install pycairo

anton@anton-VirtualBox:~/xc_examples/XC_tutorial_003$ python tutorial003_script.py 
Traceback (most recent call last):
  File "tutorial003_script.py", line 39, in <module>
    from materials.sections.fiber_section import plot_fiber_section 
  File "/usr/local/lib/python2.7/dist-packages/materials/sections/fiber_section/plot_fiber_section.py", line 4, in <module>
    import cairo
ImportError: No module named cairo
anton@anton-VirtualBox:~/xc_examples/XC_tutorial_003$ pip install pycairo
Collecting pycairo
  Downloading https://files.pythonhosted.org/packages/3c/1a/c0478ecab31baae50fda9956547788afbd0ca563adc52c9b03cab30f17eb/pycairo-1.18.2.tar.gz (200kB)
    100% |████████████████████████████████| 204kB 1.1MB/s 
Building wheels for collected packages: pycairo
  Running setup.py bdist_wheel for pycairo ... done
  Stored in directory: /home/anton/.cache/pip/wheels/7b/92/58/23fe9dac5877db460919311ad3d31b6c8a0073178abf9d4f1e
Successfully built pycairo
Installing collected packages: pycairo
Successfully installed pycairo-1.18.2

But still, there's an error about atribute FiberSection3d object has no attibute "getReinfLayers'

anton@anton-VirtualBox:~/xc_examples/XC_tutorial_003$ python tutorial003_script.py 
Traceback (most recent call last):
  File "tutorial003_script.py", line 209, in <module>
    fig1,ax2d=fsPlot.generatePlot()
  File "/usr/local/lib/python2.7/dist-packages/materials/sections/fiber_section/plot_fiber_section.py", line 95, in generatePlot
    for reinfLayer in self.fiberSection.getReinfLayers:
AttributeError: 'FiberSection3d' object has no attribute 'getReinfLayers'

Any Suggestion? Thank you.

lcpt commented 4 years ago

Hi.

I've fixed the error. I don't know what happened with this getReinfLayers property, anyway now it works. You will need to recompile XC and reinstall the python modules. On the other hand there is some problem with the legend position in the graphic: fig1

I'll ask @anaiortega about this. I've also fixed some minor problems on the other examples.

About the cairo module, I've added pycairo installation commands to the package installation scripts in xc_utils.

Apart from the legend position problem I think the problem is solved.