Giter Site home page Giter Site logo

calfem / calfem-python Goto Github PK

View Code? Open in Web Editor NEW
109.0 14.0 189.0 71.97 MB

CALFEM for Python is the Python port of the CALFEM finite element toolkit. It also implements meshing function based on GMSH and triangle. Visualisation routines are implemented using visvis and matplotlib.

License: MIT License

Python 100.00%
python finite-elements finite-element-methods finite-element-analysis numpy matplotlib visualisation educational

calfem-python's People

Contributors

adsci avatar andama avatar andrew-mitri avatar bagustris avatar dakesson avatar erikhasselwander avatar hovey avatar jonaslindemann avatar karl-eriksson avatar kimauth avatar rdxr10 avatar vedadalic 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

calfem-python's Issues

Error : Unknown mesh format `msh22', using `msh' instead

Hi,
I tried the following code according to the guide in the documentation

import calfem.geometry as cfg
import calfem.mesh as cfm
import calfem.vis as cfv

g = cfg.Geometry()

g.point([0.0, 0.0]) # point 0
g.point([5.0, 0.0]) # point 1
g.point([2.5, 4.0]) # point 2

g.spline([0, 1]) # line 0
g.spline([1, 2]) # line 1
g.spline([2, 0]) # line 2

g.surface([0, 1, 2])

cfv.drawGeometry(g)
cfv.showAndWait()

mesh = cfm.GmshMesh(g)

mesh.elType = 3          # Degrees of freedom per node.
mesh.dofsPerNode = 1     # Factor that changes element sizes.
mesh.elSizeFactor = 0.15 # Element size Factor

coords, edof, dofs, bdofs, elementmarkers = mesh.create()

cfv.figure()

# Draw the mesh.

cfv.drawMesh(
    coords=coords,
    edof=edof,
    dofsPerNode=mesh.dofsPerNode,
    elType=mesh.elType,
    filled=True,
    title="Example 01"
        )

When running the line coords, edof, dofs, bdofs, elementmarkers = mesh.create() , an error is occured.

FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.
  return np.asarray( np.vstack( T * M * CPs[j-1:j+3,:] for j in range( 1, len(CPs)-2 ) ) )

Error : Unknown mesh format msh22', using msh' instead

My environment;
Ubuntu 18.04
Python 3.6
gmsh 4.6.0
calfem-python 3.5.3

I googled but, I can't any solution.
Could you help me?

Inquiry about the Development Status of CALFEM

Hello everyone! I'd like to express my gratitude to the development team behind the CALFEM project. I have successfully utilized your library as an optional dependency in the project IfcTruss for conducting structural analysis on a truss system.

Now, I'd like to ask for some information about the development status of CALFEM. I've noticed that CALFEM is currently listed as “Beta” on PyPI. I wondered if there's any estimated timeline or roadmap for achieving “stable” status.

Your insights and experiences are greatly appreciated!

gsmh

Traceback (most recent call last):
File "C:/Users/HP/AppData/Local/Programs/Python/Python37/hkl.py", line 91, in
coords, edof, dofs, bdofs, elementmarkers = mesh.create()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\calfem\mesh.py", line 230, in create
raise IOError("Error: Could not find GMSH. Please make sure that the \GMSH executable is available on the search path (PATH).")
OSError: Error: Could not find GMSH. Please make sure that the \GMSH executable is available on the search path (PATH).

Annoying info logs

Is there a way to stop the annoying info logs? I'm running this in a loop, and the useful information I am logging gets lost among so much calfem stuff.

Info    : GMSH -> Python-module
Info    : Reading ...
Info    : Done reading ...
Info    : Meshing 1D...
Info    : [  0%] Meshing curve 1 (Nurb)
...
Info    : Done meshing 1D (Wall 0.00704885s, CPU 0s)
Info    : Meshing 2D...
Info    : Meshing surface 1 (Plane, Frontal-Delaunay)
Info    : Done meshing 2D (Wall 0.0078547s, CPU 0s)
Info    : 261 nodes 528 elements
Info    : Writing ...
Info    : Done writing ....

LinAlgError: Singular matrix by `a, r = cfc.solveq(K,f,bc)`

This is my example truss:

image

This is the code:

import numpy as np
import calfem.core as cfc

# Topology matrix Edof
Edof = np.array([
    [1,2,3,4,5,6], # Element 1
    [1,2,3,7,8,9], # Element 2
    [1,2,3,10,11,12], # Element 3
])

K = np.matrix(np.zeros((12,12)))
f = np.matrix(np.zeros((12,1)))

# Area and E-Modulus
E = 1000 # N/mm²
A = 1000 # mm²
ep = [E,A]

#Element coordinates
ex1 = np.array([0., 0.])  # Element 1
ex2 = np.array([0., -4.]) # Element 2
ex3 = np.array([0., -4.]) # Element 3

ey1 = np.array([0., 0.]) # Element 1
ey2 = np.array([0., 0.]) # Element 2
ey3 = np.array([0., 0.]) # Element 3

ez1 = np.array([3., 0.])  # Element 1
ez2 = np.array([3., 3.])  # Element 2
ez3 = np.array([3., 6.])  # Element 3


# Element stiffness matrices
Ke1 = cfc.bar3e(ex1,ey1,ez1,ep)
Ke2 = cfc.bar3e(ex2,ey2,ez2,ep)
Ke3 = cfc.bar3e(ex3,ey3,ez3,ep)

# Assemble Ke into K
cfc.assem(Edof[0,:],K,Ke1)
cfc.assem(Edof[1,:],K,Ke2)
cfc.assem(Edof[2,:],K,Ke3)

# prescribed displacements in bc
bc = np.array([4,5,6,7,8,9,10,11,12])

f[1] = 100000 # N
f[2] = -100000 # N

a, r = cfc.solveq(K,f,bc)

When I run this, I get this error message:

LinAlgError                               Traceback (most recent call last)
Cell In[14], line 49
     46 f[1] = 100000 # N
     47 f[2] = -100000 # N
---> 49 a, r = cfc.solveq(K,f,bc)

File ~/.local/share/python3.11/site-packages/calfem/core.py:5317, in solveq(K, f, bcPrescr, bcVal)
   5313 bcDofs = bcDofs[bc]
   5315 fsys = f[bcDofs]-K[np.ix_((bcDofs), (bcPrescr-1))] * \
   5316     np.asmatrix(bcVal).reshape(nPdofs, 1)
-> 5317 asys = np.linalg.solve(K[np.ix_((bcDofs), (bcDofs))], fsys)
   5319 a = np.zeros([nDofs, 1])
   5320 a[np.ix_(bcPrescr-1)] = np.asmatrix(bcVal).reshape(nPdofs, 1)

File <__array_function__ internals>:200, in solve(*args, **kwargs)

File ~/.local/share/python3.11/site-packages/numpy/linalg/linalg.py:386, in solve(a, b)
    384 signature = 'DD->D' if isComplexType(t) else 'dd->d'
    385 extobj = get_linalg_error_extobj(_raise_linalgerror_singular)
--> 386 r = gufunc(a, b, signature=signature, extobj=extobj)
    388 return wrap(r.astype(result_t, copy=False))

File ~/.local/share/python3.11/site-packages/numpy/linalg/linalg.py:89, in _raise_linalgerror_singular(err, flag)
     88 def _raise_linalgerror_singular(err, flag):
---> 89     raise LinAlgError("Singular matrix")

LinAlgError: Singular matrix

My example truss is 2-dimensional, but I wanted to test bar3e whether it also works in 3 dimensions, and accordingly set all coordinates to zero on one axis.

Creating optional dependencies

It is also known as extras

currently, I also use this library to solve truss system like those

I do not require the dependencies, for example the Vis component of this library. Would it be possible to incorporate them as extras?

Thank you very much and have a happy new year.

Not sure about type of error

Traceback (most recent call last):
File "exmp1.py", line 10, in
import calfem.vis as cfv
File "/usr/local/lib/python3.7/site-packages/calfem/vis.py", line 24, in
visApp = vv.use('qt5') # use qt4
File "/usr/local/lib/python3.7/site-packages/visvis/functions/use.py", line 47, in use
return vv.backends.use(backendName)
File "/usr/local/lib/python3.7/site-packages/visvis/backends/init.py", line 218, in use
raise RuntimeError('Given backend "%s" could not be loaded.' % tmp)
RuntimeError: Given backend "/usr/local/lib/python3.7/site-packages/visvis/backends/pyqt5.xxx" could not be loaded.
larsdigerud@Larss-MBP examples_TMM4135 %

The result is different when using `bar2e` and `bar3e` with the same truss system.

This is my example truss:

image

This is the code with bar2e:

import numpy as np
import calfem.core as cfc

# Topology matrix Edof
Edof = np.array([
    [1,2,3,4], # Element 1
    [1,2,5,6], # Element 2
    [1,2,7,8], # Element 3
])

K = np.matrix(np.zeros((8,8)))
f = np.matrix(np.zeros((8,1)))

# Area and E-Modulus
E =  1000.0 # E-Modulus N/mm²
A = 1000 # Area mm²
ep = [E,A]

#Element coordinates
ex1 = np.array([0., 0.])  # Element 1
ex2 = np.array([0., -4000.]) # Element 2
ex3 = np.array([0., -4000.]) # Element 3

ez1 = np.array([3000., 0.])  # Element 1
ez2 = np.array([3000., 3000.])  # Element 2
ez3 = np.array([3000., 6000.])  # Element 3


# Element stiffness matrices
Ke1 = cfc.bar2e(ex1,ez1,ep)
Ke2 = cfc.bar2e(ex2,ez2,ep)
Ke3 = cfc.bar2e(ex3,ez3,ep)

# Assemble Ke into K
cfc.assem(Edof[0,:],K,Ke1)
cfc.assem(Edof[1,:],K,Ke2)
cfc.assem(Edof[2,:],K,Ke3)

# prescribed displacements in bc
bc = np.array([3,4,5,6,7,8])

f[0] = 100000 # N
f[1] = -1000000 # N

a, r = cfc.solveq(K,f,bc)
print("Displacements a:")
print(np.round(a,6))

print("Reaction forces r:")
print(np.round(r,6))

image

This is the code with bar3e:

import numpy as np
import calfem.core as cfc

# Topology matrix Edof
Edof = np.array([
    [1,2,3,4,5,6], # Element 1
    [1,2,3,7,8,9], # Element 2
    [1,2,3,10,11,12], # Element 3
])

K = np.matrix(np.zeros((12,12)))
f = np.matrix(np.zeros((12,1)))

# Area and E-Modulus
E =  1000.0 # E-Modulus N/mm²
A = 1000.0 # Area mm²
ep = [E,A]

#Element coordinates
ex1 = np.array([0., 0.])  # Element 1
ex2 = np.array([0., -4000.]) # Element 2
ex3 = np.array([0., -4000.]) # Element 3

ey1 = np.array([0., 0.]) # Element 1
ey2 = np.array([0., 0.]) # Element 2
ey3 = np.array([0., 0.]) # Element 3

ez1 = np.array([3000., 0.])  # Element 1
ez2 = np.array([3000., 3000.])  # Element 2
ez3 = np.array([3000., 6000.])  # Element 3


# Element stiffness matrices
Ke1 = cfc.bar3e(ex1,ey1,ez1,ep)
Ke2 = cfc.bar3e(ex2,ey2,ez2,ep)
Ke3 = cfc.bar3e(ex3,ey3,ez3,ep)

# Assemble Ke into K
cfc.assem(Edof[0,:],K,Ke1)
cfc.assem(Edof[1,:],K,Ke2)
cfc.assem(Edof[2,:],K,Ke3)

# prescribed displacements in bc
bc = np.array([2, # has also a support
    4,5,6,7,8,9,10,11,12])

f[0] = 100000 # N
f[2] = -100000 # N

a, r = cfc.solveq(K,f,bc)
print("Displacements a:")
print(np.round(a,6))

print("Reaction forces r:")
print(np.round(r,6))

image

Error in beam2ts()

Found an error on line 737 in core.py:

v = np.concatenate((np.power(x, 3), np.power(x, 2), x, one), 1) * \ C4+qy/(24*EI)*np.np.power(x, 4)-qy/(2*GAK)*np.power(x, 2)

should be

v = np.concatenate((np.power(x, 3), np.power(x, 2), x, one), 1) * \ C4+qy/(24*EI)*np.power(x, 4)-qy/(2*GAK)*np.power(x, 2)

[Question] Is the direct stiffness method being utilized for the calculation of trusses?

def bar3e(ex, ey, ez, ep):
"""
Compute element stiffness matrix for three dimensional bar element.
:param list ex: element x coordinates [x1, x2]
:param list ey: element y coordinates [y1, y2]
:param list ez: element z coordinates [z1, z2]
:param list ep: element properties [E, A], E - Young's modulus, A - Cross section area
:return mat Ke: stiffness matrix, [6 x 6]
"""
E = ep[0]
A = ep[1]
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]],
[ez[1]-ez[0]]
])
L = np.sqrt(b.T*b).item()
n = np.asarray(b.T/L).reshape(3)
G = np.mat([
[n[0], n[1], n[2], 0., 0., 0.],
[0., 0., 0., n[0], n[1], n[2]]
])
Kle = E*A/L*np.mat([
[1, -1],
[-1, 1]
])
return G.T*Kle*G

I couldn't find out in the code if it's the direct stiffness method.

Exception: 'C:\Users\OZY~1.OZK\AppData\Local\Temp\tmp3_8p2440\tempGeometry.geo', line 0: syntax error (}) error when using mesh.create()

Hi all,

I've just started to use Calfem and I'm trying to understand the meshing functions. I've got an L shaped polygon that I want to generate a mesh for, but I keep getting a syntax error when I try.

Traceback (most recent call last):
  File "C:\repositories\b-n\examples\build_mesh.py", line 109, in <module>
    main()
  File "C:\repositories\b-n\examples\build_mesh.py", line 98, in main
    mesh = cfm.createMesh(g)
           ^^^^^^^^^^^^^^^^^
  File "C:\repositories\b-n\venv\Lib\site-packages\calfem\mesh.py", line 105, in createGmshMesh
    return meshGen.create()
           ^^^^^^^^^^^^^^^^
  File "C:\repositories\b-n\venv\Lib\site-packages\calfem\mesh.py", line 367, in create
    gmsh.open(geoFilePath)
  File "C:\repositories\b-n\venv\Lib\site-packages\gmsh.py", line 341, in open
    raise Exception(logger.getLastError())
Exception: 'C:\Users\OZY~1.OZK\AppData\Local\Temp\tmpuedlddtu\tempGeometry.geo', line 0: syntax error (})

I also get the following message every time I run my script;

Could not import Matplotlib backends. Probarbly due to missing Qt.

I don't think it's relevant though

Error in beam2ts()

There is an error in the formulation of beam2ts() which lead to an error when trying to use the function.

Definition looks like this:

def beam2ts(ex,ey,ep,ed,eq=None,np=None):

But since "np" already is used as an alias for numpy all calculations done by the function lead to errors, since "np" now is either "None" or an integer.

There is also a row (calculation of 'v') which tries to use "np.np.power" which needs to be corrected to just "np.power".

Hope this can be adjusted in an upcoming release.

Below is the working code, swapping "np" to "nep", where it is used to describe the number of evaluation points:

def beam2ts(ex,ey,ep,ed,eq=None,nep=None):
"""
Compute section forces in two dimensional beam element (beam2e).

Parameters:

    ex = [x1, x2]
    ey = [y1, y2]       element node coordinates

    ep = [E,G,A,I,ks]   element properties,
                          E:  Young's modulus
                          G:  shear modulus
                          A:  cross section area
                          I:  moment of inertia

    ed = [u1, ... ,u6]  element displacements

    eq = [qx, qy]       distributed loads, local directions 

    nep                 number of evaluation points ( default=2 )
    
Returns:
      
    es = [[N1,V1,M1],   section forces, local directions, in 
          [N2,V2,M2],   n points along the beam, dim(es)= n x 3
          ..........]  

    edi = [[u1,v1,teta1],   element displacements, local directions,
           [u2,v2,teta2],   and rotation of cross section at
           .............]   in n points along the beam, dim(es)= n x 2

(Note! Rotation of the cross section is not equal to dv/dx for Timoshenko beam element)

    eci = [[x1],    local x-coordinates of the evaluation 
           [x2],    points, (x1=0 and xn=L)
           ....]

"""
EA = ep[0]*ep[2]
EI = ep[0]*ep[3]
GAK = ep[1]*ep[2]*ep[4]
alfa = EI/GAK

b = np.mat([
    [ex[1]-ex[0]],
    [ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(2)

qx = 0.
qy = 0.
if eq != None:
    qx = eq[0]
    qy = eq[1] 
  
ne = 2

if nep != None:
    ne = nep
    
C = np.mat([
    [ 0., 0.,              0.,   1., 0., 0.],
    [ 0., 0.,              0.,   0., 0., 1.],
    [ 0., 6*alfa,          0.,   0., 1., 0.],
    [ L,  0.,              0.,   1., 0., 0.],
    [ 0., L**3,            L**2, 0., L,  1.],
    [ 0., 3*(L**2+2*alfa), 2*L,  0., 1., 0.]
])

G = np.mat([
    [ n[0], n[1], 0., 0.,   0.,   0.],
    [-n[1], n[0], 0., 0.,   0.,   0.],
    [ 0.,   0.,   1., 0.,   0.,   0.],
    [ 0.,   0.,   0., n[0], n[1], 0.],
    [ 0.,   0.,   0.,-n[1], n[0], 0.],
    [ 0.,   0.,   0., 0.,   0.,   1.]
])

M = np.ravel(C.I*(G*np.asmatrix(ed).T-np.mat([0., 0., 0., -qx*L**2/(2*EA), qy*L**4/(24*EI)-qy*L**2/(2*GAK), qy*L**3/(6*EI)]).T))
C2 = np.mat([M[0], M[3]]).T
C4 = np.mat([M[1], M[2], M[4], M[5]]).T

x = np.asmatrix(np.arange(0., L+L/(ne-1), L/(ne-1))).T
zero = np.asmatrix(np.zeros([len(x)])).T
one = np.asmatrix(np.ones([len(x)])).T

u = np.concatenate((x,one),1)*C2-qx/(2*EA)*np.power(x,2)
du = np.concatenate((one,zero),1)*C2-qx*x/EA

v = np.concatenate((np.power(x,3),np.power(x,2),x,one),1)*C4+qy/(24*EI)*np.power(x,4)-qy/(2*GAK)*np.power(x,2)
dv = np.concatenate((3*np.power(x,2),2*x,one,zero),1)*C4+qy*np.power(x,3)/(6*EI)-qy*x/GAK

teta = np.concatenate((3*(np.power(x,2)+2*alfa*one),2*x,one,zero),1)*C4+qy*np.power(x,3)/(6*EI)
dteta = np.concatenate((6*x,2*one,zero,zero),1)*C4+qy*np.power(x,2)/(2*EI)

N = EA*du
M = EI*dteta
V = GAK*(dv-teta)

es = np.concatenate((N,V,M),1)
edi = np.concatenate((u,v,teta),1)
eci = x

if np != None:
    return es,edi,eci
else:
    return es

[Question] Can you use this library for Python 3.10?

seput.py does not contain Python 3.10

calfem-python/setup.py

Lines 65 to 72 in b9ea36d

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],

Convert VTK file to OBJ with Meshio

Hi, congrats on this nice library, I think it stands out among other open source libs for FEA with its simplicity and "engineer" friendly API.

I try to work further with a meshed elevation profile for CFD analysis with my collaborators and I would need to convert the VTK output file of the mesh into OBJ or STL files. I thought Meshio is the solution but unfortunately it is not capable of reading the produced VTK file by CALFEM as it is POLY DATA.

See the error message extract as below:
meshio._exceptions.ReadError: Only VTK 'UNSTRUCTURED_GRID', 'STRUCTURED_POINTS', 'STRUCTURED_GRID', 'RECTILINEAR_GRID' supported (not POLYDATA).

Could you suggest a work around how to export this VTK into OBJ or STL file?

See an example attached about a terrain.
Screenshot 2021-05-28 at 11 14 20

Exporting data

After creating mesh, is there any way to export the lines or polygons forming the mesh? Say, the simple quad mesh in the attached image.
I can export the coordinates of the nodes seperately, but that is not helping my analysis.
Screenshot 2024-03-04 002903

What is the license of calfem-matlab?

Dear developers of calfem-matlab and calfem-python,

I adapted some functions (among others eldisp2.m beam2crd.m beam2s.m) from matlab to python/matplotlib for the visualiation of OpenSees finite element framework. Can we use those translated functions in OpenSeesPy github repository?
https://github.com/OpenSeesPy-pip/openseespy-pip
https://github.com/zhuminjie/OpenSeesPyDoc

I know that calfem-python has the MIT license, however for example beam2crd.m (from calfem-matlab) has not been ported in the official calfem-python, yet. Actually I also ported beam2crd.m in my fork of calfem-python.

Should I ask for agreement to the authors of particular functions to be able to modify and use interesting parts of calfem-matlab which are not present in calfem-python?

Thank you!

Redesigning tutorial/code examples

Dear Calfem for Python developers,

Thank you for your great effort in providing a simple yet intuitive program for the finite element method. This is very helpful for me to re-learn and tutoring FEM. To gain more adoption, I am proposing the new redesign of tutorial or code examples in the Calfem-for Python documentation. What I am proposing is:

  1. Use existing python example files in examples directory inside of writing rst file from scratch.This can be achieved by using literalinclude in rst file.
  2. Using jupyter-notebook if possible. This can be achieved using nbsphinx extension.

Both methods ensure that the tutorial or code examples are from the most recent example version. Also, we don't need to update rst file once we modified the original examples.

I believe documentation especially tutorial is a crucial part of software development to gain market share. I have been able to convert the current tutorial to above approaches and will make PR if this proposal is accepted.

Let me know your opinion.

np.matrix PendingDeprecationWarning when running Python 3.7.3

When running calfem on python 3.7.3 I get a deprecation warning for the use of np.matrix

in \calfem\core.py
M=np.ravel(C.I*(Gnp.asmatrix(ed).T-np.matrix([0., 0., 0., -qxL2/(2EA), qyL4/(24EI), qyL**3/(6*EI)]).T))
A=np.matrix([M[0],M[3]]).T
B=np.matrix([M[1],M[2],M[4],M[5]]).T

C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\calfem\core.py:361:
PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.

Problem with combinaison of blocks

Hello,
I am trying to combine 6 blocks with common faces between blocks. I have a problem when I try to mesh with an error like "Incompatible surface 28 in transfinite volume 5". The problem seems linked to points ID but I can't find a solution. My exemple is attached:

beam_block.zip

Could you help me with this problem, please?
Thank you in advance

Feature request: `calfem.__version__`

It is common practice in Python to have a version in parent coding structure. For example:

import numpy
numpy.__version__ # print version, e.g, '1.21.5'
import scipy
scipy.__version__

I would like to request that feature in Calfem so that I can do:

import calfem
calfem.__version__

That feature is beneficial when teaching or collaborating, that is to make we are at the same version.
I think it is easy to implement (adding lines in setup.py, @jonaslindemann ?).

Question regarding Licence & commercial usage

The licence is MIT, see here https://github.com/CALFEM/calfem-python/blob/master/LICENSE

image

With MIT, commercial usage is permitted. So why is this line in the README:

Unlike MATLAB, which have expensive licenses, Python is free to use and distribute both for personal and commercial use. This is the python version of CALFEM for scientific purposes/research.

Can you tell me if it is possible to use this code for commercial use?

Inconsistent comments in the documentation

Students discovered an inconsistency in the documentation, under the mesh generation chapter, where the mesh properties are described it says:

mesh.elType = 3          # Degrees of freedom per node.
mesh.dofsPerNode = 1     # Factor that changes element sizes.
mesh.elSizeFactor = 0.15 # Element size Factor

But it should say something like

mesh.elType = 3         # Element type is quadrangle.
mesh.dofsPerNode = 1      # Degrees of freedom per node.
mesh.elSizeFactor = 0.15 # Factor that changes element sizes.

I know it's only a comment but it's important since the software is used for teaching, and so the users must get correct information.

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.