Dear Robert,
I have a 2D body of hyperelastic material which contracts and I would like
to compute the total force developed by the body from the cauchy stress. I
am trying to follow some of your indications I found in this group, but I
still couldn't make it works. Could you please help me to fix the problem?
I am getting the following error:
key = (region.name, integral.order, integration)
AttributeError: 'dict' object has no attribute 'name'
I am trying to do the following, inside stress_strain post-processing
function:
def stress_strain(out, problem, state, extend = False ):
from sfepy.base.base import Struct
from sfepy.mechanics.tensors import StressTransform
from sfepy.mechanics.tensors import transform_data
from sfepy.discrete.common.mappings import get_normals
ev = problem.evaluate
field = problem.fields['displacement']
region = problem.domain.regions['Gamma']
integral = problem.integrals['i2']
n = get_normals(field,integral,regions)
stress = ev('dw_tl_fib_a.1.Omega(f1.fmax, f1.eps_opt, f1.s, f1.fdir,
f1.act, v, u )',mode='qp', term_mode= 'stress');
F = ev('ev_def_grad.1.Omega(u)',mode='el_avg');
transform = StressTransform(F)
Cstress = transform.get_cauchy_from_2pk(stress)
T = Cstress*n;
Force = ev('ev_surface_integrate.2.Gamma(T)')
And here it is part of the problem configuration file.
fields = {
'displacement': ('real', 'vector', 'Omega', 1),
}
materials = {
'solid' : (None, 'get_elastic_pars'),
'load' : (None, 'linear_tension'),
'f1' : 'get_pars_fibres1',
}
variables = {
'u': ('unknown field', 'displacement', 0),
'v': ('test field', 'displacement', 'u'),
}
regions = {
'Omega' : 'all',
'Fix1' : ('vertices in x < %.10f' % (fix_point + eps2), 'facet'),
'Fix2' : ('vertices in x > %.10f' % (fix_point - eps2), 'facet'),
'Fix' : ('r.Fix1 *v r.Fix2', 'facet'),
'Gamma' : ('vertices of surface','edge'),
}
ebcs = {
'fixb' : ('Fix', {'u.all' : 0.0}),
}
integrals = {
'i1' : ('v', 1),
'i2' : ('s', 2),
}

In examples/large_deformation/hyperelastic.py a rotation by displacements is applied. By using a similar function the vectors defining the force couples could be defined for dw_surface_ltr (IMHO). Does it make sense?
r.
----- Reply message -----
From: "Andre Smit" <freev...(a)gmail.com>
To: <sfepy...(a)googlegroups.com>
Subject: Torque
Date: Sat, Dec 18, 2010 05:10
What is the best way to apply a torque load to a model?
--
Andre
--
You received this message because you are subscribed to the Google Groups "sfepy-devel" group.
To post to this group, send email to sfepy...(a)googlegroups.com.
To unsubscribe from this group, send email to sfepy-devel...(a)googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.

Hi,
I have just updated the time stepping solvers in sfepy for interactive use, as
demonstrated in the new example [1]. For basic use, ignore the probing code -
the time stepper can be used as simply as:
tss = SimpleTimeSteppingSolver({'t0' : 0.0, 't1' : 100.0, 'n_step' : 11},
problem=problem)
tss.init_time()
for step, time, state in tss():
pass
r.
[1] http://sfepy.org/doc-devel/examples/diffusion/time_poisson_interactive.html

Hi,
I have a problem based on "../sfepy/examples/multi_physics/biot.py".
In the attached scripy 'block2.py', I have calculated the stress and strain
according to the displacement, at the 111 and 112 lines you can see it.
Now I want to output the K of every cell, I gave a value of k at the 64
line in this script, it is a 3*3 array.
I don't know which function or equation to use, so I was stucked at the 113
line.
if I change the K value, will where be some difference results?
Thank you advance
K.

Hi,
My mesh is defined in mm. With
units = ['mm', 's', 'kg', 'C']
the matching units for density and force are Tg/m**3 and mNewton,
respectively.
I would like to determine the linear elastic displacement of the meshed
object by gravity, using the linear volume force term
t2 = Term.new('dw_volume_lvf(f.val, v)', integral, omega, f=f, v=v)
in which the force vector f.val is obtained from function get_gravity.
def get_gravity(ts, coors, mode=None, equations=None, term=None,
problem=None, **kwargs):
if mode == 'qp': # define material parameters in quadrature points
fx = nm.zeros((coors.shape[0], 1, 1))
fy = nm.zeros((coors.shape[0], 1, 1))
fz = nm.tile(-2.285e-2, (coors.shape[0], 1, 1)) # constant vertical force
in mN/mm3
val = nm.concatenate((fx, fy, fz), axis=1) # concatenate force components
return {'val': val}
With gravity g = 9.81 m/s**2 and density rho = 2.329e-6 Tg/m**3, the
constant volume force 2.285e-2 mNewton/mm**3 is obtained as the product of
gravity and density.
Is it correct that f.val in the linear volume force term is defined in
force per unit volume?
And another newbie question:
Is it correct that a first order integral is used for the linear volume
force term, because of the linear relation between force and volume? Or is
a higher integral order needed, due to the dimensions of the mesh?
Kind regards,
Radko

Hi,
The following code is used in example
linear_elasticity/material_nonlinearity.py to evaluate the Cauchy strain
during post processing:
strain = problem.evaluate('ev_cauchy_strain.i.Omega(u)', mode='el_avg')
out['cauchy_strain'] = Struct(name='output_data', mode='cell', data=strain, dofs=None)
Using ParaView to visualize the result on a tetrahedral mesh from VTK
output, I find the strain to have 8 decomposition components with arbitrary
names 1 through 8.
Is it possible to obtain the strain as a vector in Cartesian components?
Regards,
Radko

Hi,
I'm trying to solve a non-linear Poisson type equation where the diffusion
coefficient/conductivity depends on the field variable. Logically, I've
tried basing this part of my code on the
poisson_field_dependent_material.py case and, of course, it works nicely in
"simple" mode but I can't figure out how to pass the value to my material
variable "cond" in interactive mode (I require interactive mode for reasons
stated in this post
<https://groups.google.com/forum/#!topic/sfepy-devel/es64x4YFEiU>). I
define the same get_conductivity function as per
poisson_field_dependent_material.py, then declare the function as
conductivity_fun = Function('conductivity_fun', get_conductivity)
get_conductivity returns a dictionary key/value pair {'val' : val} so I
figured to call the function as per
cond = Material('cond', conductivity_fun)
should work, but it results in this error:
Traceback (most recent call last):
File "examples/diffusion/myPoisson/myPoissonInteractive.py", line 185, in
<module>
main()
File "examples/diffusion/myPoisson/myPoissonInteractive.py", line 116, in
main
cond = Material('cond', conductivity_fun,) #val= 2.0)
File
"/usr/local/lib/python2.7/dist-packages/sfepy-2016.3_git_94dff5a051dbd2bf6bd56fce936d75878edef9e8-py2.7-linux-x86_64.egg/sfepy/discrete/materials.py"
, line 148, in __init__
% self.name
TypeError: not enough arguments for format string
I've also tried passing a function handle to cond ('conductivity_fun'), and
all the possible combinations of function names that I can think of, but
this error persists. I've looked at the function documentation
<http://sfepy.org/doc-devel/users_guide.html#functions> but unfortunately
this hasn't clarified things for me as this issue pertains specifically to
the interactive problem specification.
Thank you for your help.
Regards,
David

<https://lh3.googleusercontent.com/-nqPKBodss14/WEbGCb-rgXI/AAAAAAAAA70/sQ8d…>
Hi,
I have a non-linear form of the Poisson equation where the "diffusion"
coefficient depends on the derivatives of the state variable (see image).
There are no Dirichlet-type boundary conditions (i.e. no ebcs) so I really
need to specify a good initial guess at the solution.
My questions are:
1) How are initial guesses passed to the solver? From the documentation,
it doesn't seem like initial guesses can be directly passed to the
nls.newton solver as an argument (though they are an argument of the
subroutine __call__).
2) In what form should the initial guess vector/array be written? Can a
function be passed? Do numerical values have be be specified at the mesh
nodes?
Thanks for any help on this matter.
D

Hello,
I have created an ipython profile for sfepy, i have edited the file ~/.ipython/profile_sfepy/ipython_config.py
addinging the suggested lines in the installation manual. My system is
Fedora 24
Igot the following errors:
IPython profile: sfepy
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-3df2942fcc0c> in <module>()
----> 1 from sfepy.base.base import *
ImportError: No module named sfepy.base.base
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-7107ce501ecc> in <module>()
----> 1 from sfepy.discrete import *
ImportError: No module named sfepy.discrete
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-4cb6370fc83c> in <module>()
----> 1 from sfepy.discrete.fem import *
ImportError: No module named sfepy.discrete.fem
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-774ff483fc4b> in <module>()
----> 1 from sfepy.applications import solve_pde
ImportError: No module named sfepy.applications
Is it possible to correct those errors?
I'll appreciate any help.
Hugo

Hello every body,
I just have installed in place Sfepy-2015.4 on fedora 24, seems that every
thing went fine during the installation, but when I run the tests, more
than 50 test failed, in particular when I run the
examples/diffusion/poisson_short_suntax.py I got the following last message:
File "/usr/lib/python2.7/site-packages/scikits/umfpack/_umfpack.py", line
776, in umfpack_dl_symbolic
return __umfpack.umfpack_dl_symbolic(n_row, n_col, Ap, Ai, Ax, Control,
Info)
TypeError: in method 'umfpack_dl_symbolic', argument 1 of type
'SuiteSparse_long'
I really will appreciate any help
Hugo