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 tried to solve the examples/diffusion/poisson_short_syntax.py using
simple.py. The solution completes by when I try to visualize cylinder.vtk
with postproc.py, I get the following error:
Exception:
In C:\Python27\lib\site-packages\mayavi\sources\vtk_xml_file_reader.py: 86
AttributeError: 'AlgorithmOutput' object has no attribute 'point_data' (in
get_all_attributes)
The above error is in a dialog box. when I click ok, the postproc window
opens with no geometry shown. I have tried visualizing the vtk file in
paraview and that shows a reasonabel t profile.
Additionally, the error log is in the attached file. Please tell me how to
solve this problem.

Hello,
I downloaded the sfepy source code from git and installed it using the
Visual C++ compiler. After installing, I ran the tests and 4 of them
failed. I then ran those tests in debug mode and the output is attached.
Please tell me how to solve this problem.
Best regards,
Nikhil

Hi Nicolas,
you need only to return your values in 'qp' mode (and make them floats). It
runs ok with those:
def get_heat_Coeff(ts, coors, mode=None, **kwargs):
if mode != 'qp': return
file=open('heat_Coeff.dat', 'r')
tab=[]
tab=file.readlines()
file.close()
length=len(tab)
for i in range(length):
tab[i] = float(tab[i].strip())
val=nm.asarray(tab)
val.shape = (coors.shape[0], 1, 1)
return {'h' : val}
def get_exchange(ts, coors, mode=None, **kwargs):
if mode != 'qp': return
file=open('exchange.dat', 'r')
tab=[]
tab=file.readlines()
file.close()
length=len(tab)
for i in range(length):
tab[i] = float(tab[i].strip())
val=nm.asarray(tab)
val.shape = (coors.shape[0], 1, 1)
return {'g' : val}
BTW. make sure that the order of the values corresponds to the ordering of the
quadrature point coordinates in coors argument.
r.
On 07/04/2016 03:27 PM, Nicolas DELAN wrote:
> Hi,
>
> I have some problem with my case:
>
> I have followed your instructions and i was inspired by the get_pars
> function of the following example case :
> http://sfepy.org/doc-devel/examples/diffusion/poisson_functions.html
>
> But with me it don't works, the coors type returned is 'none' so the
> coors.shape returned nothing. Stangely i have understand that the .py
> configuration file is readed several time by sfepy, the first time coors is
> recognised and i can print the coordinates. The second time, coors become a
> none type variable and i don't understand why.
>
> Also could you take a look at my case ?
>
> I have attached my files to this post.
>
>

Hello,
I have to formulate this equation in sfepy:
<https://lh3.googleusercontent.com/--SRvfhvrVes/V3UtQhHns_I/AAAAAAAAVVI/URP8…>
So with \partialOmega = gamma:
"""dw_laplace.i.Omega(c,s, t ) + dw_volume_dot.i.Gamma( h , t, s)
=dw_surface_dot.i.Gamma(g, s )"""
My question is: alpha and g are constants of the surface of the airfoil, i
have two files that contains the values of them for each point of the
surface (we are in a 2D problem).
But i don't know how to define h and alpha in the configuration file as
variables of the domain gamma with some ebcs conditions ?