calculix / ccx2paraview

CalculiX to Paraview converter (frd to vtk/vtu). Makes possible to view and postprocess CalculiX analysis results in Paraview. Generates Mises and Principal components for stress and strain tensors.
GNU General Public License v3.0
84 stars 18 forks source link

Using ccx2paraview in my code #15

Closed SangeetSunderroy closed 3 years ago

SangeetSunderroy commented 3 years ago

Hello, So I wanted to run ccx2paraview inside a venv. I ran

python3 -m venv venv
source venv/bin/activate
pip install numpy vtk ccx2paraview

and then I tried to run the script

#!/usr/bin/env python3
# Converts calculix results to vtk or vtu
import ccx2paraview
c = ccx2paraview.Converter("beam.frd", 'vtu')`
c.run()

But this only creates an empty file named ccx2paraview

imirzov commented 3 years ago

Yep, my fault. Thanks for reporting the problem. Please, try this code:

import logging
import ccx2paraview
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
c = ccx2paraview.Converter("beam.frd", ['vtu'])
c.run()
SangeetSunderroy commented 3 years ago

Hello! Thanks for the quick reply. Running the script changes my mouse to a plus symbol and when I click, I get these errors

import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/408.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/408.
./convert_frd_paraview.py: line 9: syntax error near unexpected token `level=logging.INFO,'

This creates two empty files named ccx2paraview and logging. I am on ubuntu 20.04.

imirzov commented 3 years ago

I guess if you run this code:

import os
import sys

the script will produce empty files named 'os' and 'sys', doesn't it? Definitely you have problems with venv, Python or OS. I can't help. Sorry.

SangeetSunderroy commented 3 years ago

I apologize, I had forgotten the shebang in my script. The code works perfectly.

By the way, thanks a bunch for ccx2paraview. This is a very useful tool.