22 Jun
2023
22 Jun
'23
2:20 a.m.
Hi! I have a tetrahedral mesh and know the nodal displacements of the mesh from an external software. I now want to calculate the element' strains and thought I give sfepy a go. However, the learning curve is very steep and I struggle a bit with this - I thought - easy task.
I thought I basically need this function here: https://sfepy.org/doc-devel/primer.html#post-processing but how do I initially setup the problem and set the already solved displacement vector?
This is what I got so far:
import numpy as np
from sfepy.discrete.fem import Mesh, FEDomain
from sfepy.discrete import Problem
# Given: mesh and nodal displacements
mesh = Mesh.from_file('the_mesh.vtk')
u_vec = np.random.random((mesh.n_nod, 3)) # here I would insert the
actual displacements. Use random numbers for testing
domain = FEDomain('domain', mesh)
omega = domain.create_region('Omega', 'all')
# ???
pb = Problem('elasticity', domain=domain, ...) # ???
# ???
strain = pb.evaluate('ev_cauchy_strain.2.Omega(u)', mode='el_avg')
Am I on the right track here? Thanks in advance!
Best, Sebastian