Coder Social home page Coder Social logo

calculix / calculix-examples Goto Github PK

View Code? Open in Web Editor NEW
300.0 300.0 92.0 245.75 MB

CalculiX examples by Prof. Martin Kraska from Brandenburg University of Applied Sciences. Excellent starting point to master parametric modelling with CGX and CCX.

License: MIT License

Python 79.23% Makefile 4.33% Batchfile 4.13% GLSL 4.20% Gnuplot 7.23% NASL 0.88%
calculix cgx contact fea linear-elasticity non-linear-mechanics parametric-modelling plasticity

calculix-examples's People

Contributors

imirzov avatar mkraska avatar oldninja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calculix-examples's Issues

Unsupported element types in CGX

Some element types aren't supported in CGX.

Using the command elty <set> <type> shows the following deficiencies:
qu4r is unknown (no meshing)
qu4er generates CPE4 instead of CPE4R
qu4sr generates CPS4 instead of CPS4R
qu4cr generates CAX4 instead of CAX4R
qu4cr generates CAX4 instead of CAX4R
qu8r generates S8 instead of S8R

The test script types.txt creates individual meshes with the available structural element types and
prints the CGX type name and the element numbers. You can then check the element type in all.msh

execute cgx -b types.txt

grafik

Mistake in example ./Test/Supports1

There is a mistake in example ./Test/Supports1.

test.py calls os.system("cgx -b run.fbl"),
but there is no run.fbl file:
ERROR in readfbd: The input file "run.fbl" could not be opened.

Please, add missed file.

Displacement as a load

Hi everyone,
I want to bring a load as a displacement, but I dont know how. Could you help me please?

Problem with Strains in dat2txt

Hi,

I have problem with strain results in xxx.dat (using dat2txt):

a. If I have only:
*EL PRINT,ELSET=Element, TOTALS=ONLY
E

then dat2txt not generate any file.

b. If I have:
*NODE PRINT, NSET=Nepsilon, TOTALS=ONLY
U
*NODE PRINT, NSET=Nfix_y, TOTALS=ONLY
RF
+
*EL PRINT,ELSET=Element, TOTALS=ONLY
E

then strains are add to total force file:

"0.025 1.174672E-09 -1.091615E+01 -1.705246E-16 strains elem, integ.pnt.,exx,eyy,ezz,exy, ......."

example:
total force fx,fy,fz_NFIX_Y.txt

c. If I have in *EL FILE S, SDV then dat2txt creates the right files for them like:
internal state variables elem, integ.pnt.,values_ELEMENT
stresses elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz_ELEMENT

Regards

Contact Pair doesn't work

Hello everyone,

i want to modeling a three point bending test (3PB) with a Sandwich. It's similar to the NonLinear Sandwichtest from Hr. Kraska. I'm only in the linear-elasticity section. I've made the contacts between cylinder and coat with the contact pair type node to surface. The cylinder surface is the slave and the coat the master surface. The job finished but the contacts didn't worked. I have after the calculation no contact between cylinder and coat.
It came the message "the increment size exceeds the remainder of the step and is decreased to < a value>" .

Now i've tested the verification samples, which are namend in the user manual for contact pair. These are files are contact1 and contact2. Here came the same Problem.
When the programm calculate the sandwichtest from Hr. Kraska, the same message is coming but the contact pair works.

Have anyone an idea what could be the problem and why the verification test also didn't worked?

CGX: Re-appearance of zapped nodes

Nodes, which have been zapped, re-appear (without the also zapped elements) when other parts of the model are meshed.

The CGX input file is here.

This is "plot n all" before meshing the cylinders.
grafik

Now we mesh two other parts and plot all in red and the cylinders in green and turquoise.

As you can see, now there are nodes which don't belong to any element. These nodes have been zapped together with the elements. However, the nodes seem to re-appear.

grafik

Keep output files

Dear Prof. Kraska,

Each time a user runs test.py he produces many output files. Why don't you keep all output files on the GutHub repository?

I suppose it could be useful: for example, if someone fail to successfully run an example and generate all the model files, he still can use models directly from the repository.

Also keeping all the files on the GitHub is useful for developers. Now before committing a new feature a have to delete all generated output files. It's bothering.

Library not loaded

Hi-
I apologize if this isn't the proper place to ask. I am trying to run Calculix from a command line but I am having some install issues. I know very little about this stuff so I apologize.

I installed Calculix with these commands:

brew tap brewsci/science
brew install calculix-ccx

Here is the error I am receiving and my system info: thanks.

OSX High Sierra
v 10.13.6

dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/7/libgfortran.4.dylib
Referenced from: /usr/local/bin/ccx_2.13
Reason: image not found
Abort trap: 6

Some doubts about the branch of the pipe

I was recently working on calculix, but when I refer to CCX2.12.pdf again, I noticed a problem that I always do not understand. The problem is in the pipeline branch file, such as the branchsplit1.inp file, TYPE=ORIFICE and TYPE=BRANCH SPLIT IDELCHIK2 Is there any connection to the cross-sectional area? Or how are they set up? Thank you for your answer, be grateful

CGX swep

Swep command badly (wrong) creates surfaces by rotation (swep set set rot y 90 a):

  • ellipse (example)
  • part of the circle is also badly formed!

aa

CGX valu

Hi,
I would like to propose an extension of the valu command, adding the ability to retrieve the coordinate value of a specific point.

For instance:

In file part1.fbd a have point p1 (pnt p1 10. 32. 0.45673), I read this file to assemble.fbd and in this file I want to create new point with the "z" value of p1.

read part1.fbd
valu namex x p1
valu namey y p1
valu namez z p1
pnt p2 45. 0. namez

Regards
Rafal

issue with param.py and floor() function

Hello
my par.floortest.txt file is:
#<a= 1.3 >
#<floor(a)>
#<b= floor(a)>
b =

and when I run : python param.py par.floortest.txt
I got the following error message:

Using file: par.floortest.txt
Source: par.floortest.txt
Target: floortest.txt
a= 1.3 (1.3)
******* ERROR ********
Line 2 in par.floortest.txt

#<floor(a)>

'NoneType' object is not callable

it looks like if the floor function is not usable....

CGX: Movie recording skips frames

When recording a movie within a CGX-Script, then only every other frame is recorded. See https://github.com/mkraska/CalculiX-Examples/tree/master/NonLinear/Rohrknie for an example. in the script https://github.com/mkraska/CalculiX-Examples/blob/master/NonLinear/Rohrknie/post-modal.fbd
the number of frames per period is set to 8 and the number of frames to record by the movi-command is also set to 8. One would expect that just one cycle is recorded. Instead, there are two of them, as can be seen in the gif:

Movie

Error running "run_all.py"

Hello,
Thank you Dr. Kraska for putting this repo together - it is a great resource! Also, thanks to @imirzov for the latest edits.
I tried running the python script "run_all.py" but I get the following error, does anyone had this issue before? Or did I miss something from the - Setup page.

Traceback (most recent call last):
  File "run_all.py", line 225, in <module>
    auto.run()
  File "run_all.py", line 171, in run
    all_tests = self.scan(self.start_folder, 'test.py')
  File "run_all.py", line 116, in scan
    for f in os.scandir(start_folder):
FileNotFoundError: [Errno 2] No such file or directory: ''

Using cgx_2.15 & ccx_2.16, with Python 3.8.2 [GCC 9.3.0] on linux (Ubuntu 20.04).

Thanks in advance!

What is the difference between TYPE=PIPE ENTRANCE and TYPE=PIPE INOUT?

Thank you very much for your help, but I still have a question: What is the difference between TYPE=PIPE ENTRANCE and TYPE=PIPE INOUT? Why do I find it in some of your inp format files (for example, pipe.inp and pipe2.inp), some apply TYPE = PIPE ENTRANCE and TYPE = PIPE INOUT, while some files only have TYPE = PIPE INOUT. So how do I determine how to quote this? Thank you again

Virtual elements

Hi mkraska, I'm looking for an example of how to create virtual elements. You know the ones we use instead of screws or to place a force/torque a distance away from the calculated object. I saw a guy in the FreeCAD forum asking for it and sure enough, I couldn't find how to it either.
Any chance you could create a few examples on how to make them?

U1 / General beam section issue

I saw that the results of the U1General beam section are not logical. Concretely, the displacement goes up and down across the beam, instead of being smooth. Do you know what's the reason for this?

Modelling different elasto-plastic behaviour in tension and compression

Hi,

I'm trying to model a fibre reinforced concrete beam with different stiffness and stress-strain curve in tension and compression.
How should I implement this model?
Can I simply add the compression with negative values as below: (example numbers)
*plastic
-1200,-1
-100,-0.1
20,0.1
120,1

Thanks in advance for your help and assistance.

Alex

sh: 1: ng_vol: not found

Running some of the examples I've got error:

sh: 1: ng_vol: not found

What does it mean? Which library/software should I install for the 'ng_vol' command to be available?

Dynamics with couping

Have you ever tried an example of dynamic simulation with coupling? I always get wrong results when try to use both *dynamic and *coupling keywords in the same problem.

CGX graph enhancement

Added the ability to create plots datasets vs. datasets (STRES vs. STARIN):

graph set vs STRES SXX STRAIN EXX

CalculiX model files extensions

Dear Prof. Kraska,

In your wonderful Examples you use too wide variety of file extensions for the same file type - INP.
Files with extensions msh, nam, dlo, sur, con, bou, inc, equ, frc, dfl are of the same type and could have the same extension - INP extension.

CGX: Wrong normals computation in batch mode

With CGX 2.10, and with the example
https://github.com/mkraska/CalculiX-Examples/tree/master/Kasten,
the following fbd script produces wrong shading:

ead Kasten.frd
rot y
rot r 30
rot u 20
view disp
view elem
frame
zoom 0.9
rep all
ds -0 e 1
#ds -0
plot f all n
hcpy png
sys cp hcpy_1.png deformed.png

This produces the following screenshot:

hcpy_2

When in interactive mode, after any interaction with the GUI (selecting a menu command, slight view modification with the mouse or whatever), the plot command is re-issued, then the shading is correct:

hcpy_3

CGX: Handling of missing geometry in path plots

if the sampling points of a path plot happen to be outside the geometry, then these points are removed, no matter if they were based on line division or node selection.
If such nodes occure at the beginning or end of a path, then there is no problem. If the nodes are in a hole or gap in the geometry, then in the plot there is just a straight line connecting the proximal nodes with valid values.
See for example https://github.com/mkraska/CalculiX-Examples/tree/master/Linear/StressConc1#post-processing
In Gnuplot, you would just need an empty separator line to interrupt the graph. Such lines might be issued whenever there is an invalid data point.

IOError: Elements/Solid/test.py

...examples/mkraska/Elements/Solid/test.py

sh: 1: ng_vol: not found
sh: 1: ng_vol: not found
Segmentation fault (core dumped)
Traceback (most recent call last):
File "solid-conv.py", line 56, in
f=open("solid.frd")
IOError: [Errno 2] No such file or directory: 'solid.frd'
solid-plot.py:22: MatplotlibDeprecationWarning: pyplot.hold is deprecated.
Future behavior will be consistent with the long-time default:
plot commands add elements without first clearing the
Axes and/or Figure.
pylab.hold(True)
/usr/lib/python2.7/dist-packages/matplotlib/init.py:806: MatplotlibDeprecationWarning: axes.hold is deprecated. Please remove it from your matplotlibrc and/or style files.
mplDeprecation)
/usr/lib/python2.7/dist-packages/matplotlib/rcsetup.py:155: MatplotlibDeprecationWarning: axes.hold is deprecated, will be removed in 3.0
mplDeprecation)
Traceback (most recent call last):
File "solid-plot.py", line 24, in
data = numpy.genfromtxt(elty+".txt")
File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 1549, in genfromtxt
fhd = iter(np.lib._datasource.open(fname, 'rbU'))
File "/usr/lib/python2.7/dist-packages/numpy/lib/_datasource.py", line 151, in open
return ds.open(path, mode)
File "/usr/lib/python2.7/dist-packages/numpy/lib/_datasource.py", line 501, in open
raise IOError("%s not found." % path)
IOError: C3D8I.txt not found.

testall.py: close windows automatically

Hi!

Your examples are amazing! But running testall.py I must manually close GMSH and GraphiX windows for all examples. Please, could you implement automatic close of all windows?

Wrong meshing or mesh export in CGX

Supports.zip

The attached zip archive contains the files

  • Welle.stp (geometry)
  • result.fbd (converted geometry)
  • pre.fbd (CGX input)
  • solve.inp (CCX input)

The mesh produced by cgx -b pre.fbl seems to be ok, but if you open the exported mesh in a new instance of CGX using cgx -c solve.inp, then many elements have negative Jacobian (Menu> Viewing> Show bad elements)
hcpy_1

CGX: Store and retrieve viewport parameters

Transferred from a comment to a closed issue:

Hi,

Set a good view of the model by commands (np. zoom, frame, tra) to make a screenshot is very difficult.

A very useful option would be to set the model view manually (by mouse) and then save that view/frame/position in to the file (eg send abq frame), then in the script file (like post.fbd) that executes a series of screenshots loading this file/position of model (eg read view.frame).

Regards
Rafal

CGX feature request: suppress re-framing at end of reading of batch files

Request: Provide an option to suppress the automatic re-adjustment of the view when switching to interactive mode after reading command files.2

For an example, see issue #3 and compare the generated png file with the screen contents after readng the file.

Reason: Sometimes command files are used to adjust the view for a particular purpose. This can be spoiled by automatic re-adjustments.

Proposal: do not perform any adjustment, if reading the file was stopped by break (be it at the end or in the midst of a file).

1D heat transfer in Calculix

Hi guys
How can I write the file *.inp to simulate 1D heat transfer in a truss ? It's just an academic example to compare with solutions found in heat transfer's book by means finite difference. Left boundary contidion is an imposed temperature and rigth BC a flux.
I proved with the T3D2 (T2D2 too) and B31 element but it didn't work. The example is a simple steady problem.
Thanks!

CGX crash with swep

This code crashes CGX 2.12 with elemChecker.c enabled (should that matter here? No elements generated so far)

valu ri 10
seto ind
  pnt pk0 0 0 0
  pnt pkx ri 0 0
  pnt pky 0 ri 0
  pnt pkz 0 0 ri
  #line lxy pkx pky pk0 8
  #line lyz pky pkz pk0 8
  line lzx pkz pkx pk0 8
  swep ind inds rot z 90 10 n

This is part of the CGX output

bug.fbd opened
 reading file
   #line lxy pkx pky pk0 8
   #line lyz pky pkz pk0 8
X: 0.000000 Y: 0.000000 Z: 10.000000
X: 1.950903 Y: 0.000000 Z: 9.807853
X: 3.826834 Y: 0.000000 Z: 9.238795
X: 5.555702 Y: 0.000000 Z: 8.314696
X: 7.071068 Y: 0.000000 Z: 7.071068
X: 8.314696 Y: 0.000000 Z: 5.555702
X: 9.238795 Y: 0.000000 Z: 3.826834
X: 9.807853 Y: 0.000000 Z: 1.950903
X: 10.000000 Y: 0.000000 Z: 0.000000
fitting B-Spline...BSpline fitting ... done
Error: 0.00131488 after 12-iterations
 --> Done
N001 DEFINE COMPACT 3 2 11 9 15 12
*** buffer overflow detected ***: /home/user/A_Inst_Calculix/CalculiX/cgx_2.12/src/cgx terminated

CGX feature request: frame <set>

Extend the command 'frame' such that it can fit the view to a given set. Possible applications:

  • create images of parts
  • show all elements with values above a particular one.
    This would extract all nodes with values above 200
    enq nodes roi rec _ _ _ 1 h 200
    frame roi would then zoom into that region.

frame h 200 would be more elegant but also more special, less universal.

Extended valu command

Hi,

Please consider adding:
The possibility of easy manipulation (performing calculations) on datasets from the .frd file would be very helpful in calculations by ASME.
Now to perform calculations "Determine the limiting Triaxial strain" I use Praview (ccx + exodus extras):
kd-232 2

I know I can use userFunction.c but it is quite difficult for a non-programmer.

Example:
read all.frd
valu e1 2.7182
valu m2 0.2743
valu m5 0.3657
valu elu 0.2743

valu A1a + PS1 PS2
valu A1b + A1a PS3
valu A2 * 3 Mises

valu B1 / A1b A2
valu B2 - B1 0.33

and so on, and the results could be displayed in the form of a map.

Regards
Rafal

Import SETs into assembly (referring to the Contact tutorial)

Hi mkraska,

I have seen your example of assembling (Contact), I have a further question: Is it somehow possible to import SETs?

For this the following example:
I have a Mesh in FRD format and the sets as NAM file. The structure of the files is (as an example)

part.frd:

1CMESH
1UTest
2C 12345 1
-1 1 0.00000E+03 0.00000E+03 0.00000E+03
-1 2 1.00000E+03 0.00000E+03 0.00000E+03
[...]

part.nam:

seta N_LEFT n 1
seta N_LEFT n 2
seta N_RIGHT n 3
[...]

If I now import both twice with

seto part_one
read part.frd
read part.nam
setc
seto part_two
read part.frd
read part.nam
setc

the second part did not get the correct nodes from the NAM file (which is somehow obvious, since the node numbers in the FRD are incremented, but those in the NAM file are not).

Is it somehow possible to load multiple parts into one assembly and keep the SETs?

PS: I am completely free in the way the files have to be prepared, because I create the mesh with a converter I wrote myself and can adjust the output to the needs.

Thanks a lot! Also for the many great examples!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.