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.
The error looks like some permission problem - could you try removing the
build/ directory completely, and also running
python setup.py clean
- the above should succeed. If not, try removing the whole sfepy/ directory,
and start from a new one, that you unpack as you, not as a root or another user...
r.
On 06/19/2017 04:11 AM, Deepak Pawar wrote:
> Hello Robert
>
> I tried the python setup.py build_ext --inplace
>
> But things doesn't work out.
> I know i am doing some stupid mistake but couldn't figure out.
>
> Need ur comments
>
> PFA
>
> Thanks
>
> On Mon, Jun 19, 2017 at 3:15 AM, Robert Cimrman <cimrman3(a)ntc.zcu.cz> wrote:
>
>> Hi!
>>
>> it looks that you did not build the extension modules of sfepy - try
>> running
>>
>> python setup.py build_ext --inplace
>>
>> before running simple.py.
>>
>> r.
>>
>> On 06/18/2017 08:15 AM, deepakpawar.2310(a)gmail.com wrote:
>>
>>> Hii
>>>
>>> New user at sfepy
>>>
>>> Any comment on the following error ?
>>>
>>>
>>>
>>> pawar@pawar:~/sfepy$ ./simple.py
>>> Traceback (most recent call last):
>>> File "./simple.py", line 21, in <module>
>>> from sfepy.applications import PDESolverApp
>>> File "/home/pawar/sfepy/sfepy/applications/__init__.py", line 3, in
>>> <module>
>>> from .pde_solver_app import PDESolverApp, solve_pde,
>>> assign_standard_hooks
>>> File "/home/pawar/sfepy/sfepy/applications/pde_solver_app.py", line
>>> 7, in <module>
>>> from sfepy.discrete import Problem
>>> File "/home/pawar/sfepy/sfepy/discrete/__init__.py", line 9, in
>>> <module>
>>> from .variables import Variables, Variable, FieldVariable,
>>> create_adof_conns
>>> File "/home/pawar/sfepy/sfepy/discrete/variables.py", line 14, in
>>> <module>
>>> import sfepy.linalg as la
>>> File "/home/pawar/sfepy/sfepy/linalg/__init__.py", line 2, in <module>
>>> from .extmods.crcm import rcm, permute_in_place
>>> ImportError: No module named crcm
>>> _______________________________________________
>>> SfePy mailing list
>>> sfepy(a)python.org
>>> https://mail.python.org/mm3/mailman3/lists/sfepy.python.org/
>>>
>>>
>>
>
>
Hii
New user at sfepy
Any comment on the following error ?
pawar@pawar:~/sfepy$ ./simple.py
Traceback (most recent call last):
File "./simple.py", line 21, in <module>
from sfepy.applications import PDESolverApp
File "/home/pawar/sfepy/sfepy/applications/__init__.py", line 3, in <module>
from .pde_solver_app import PDESolverApp, solve_pde, assign_standard_hooks
File "/home/pawar/sfepy/sfepy/applications/pde_solver_app.py", line 7, in <module>
from sfepy.discrete import Problem
File "/home/pawar/sfepy/sfepy/discrete/__init__.py", line 9, in <module>
from .variables import Variables, Variable, FieldVariable, create_adof_conns
File "/home/pawar/sfepy/sfepy/discrete/variables.py", line 14, in <module>
import sfepy.linalg as la
File "/home/pawar/sfepy/sfepy/linalg/__init__.py", line 2, in <module>
from .extmods.crcm import rcm, permute_in_place
ImportError: No module named crcm
Hi,
currently, when setting the Dirichlet boundary conditions (ebcs) by a function,
the function should return a 1D array with all values of the first component,
then of the second one etc. concatenated together (= DOF-by-DOF ordering).
Passing a 2D array has been silently ignored, but now with numpy 1.13 out, this
lead to #404 [1].
It is not a hard-to-fix bug, but I would also like to make the behaviour of the
boundary conditions setting functions consistent with the material parameters
setting functions, and change the ordering from DOF-by-DOF to node-by-node,
e.g. all components in the first node, all components in the second node, etc.
Example: having in 3 nodes the values (2 DOFs per node)
[[1, 2],
[3, 4],
[5, 6]]
the old behaviour required the function to return [1, 3, 5, 2, 4, 6], while the
new version will require either [1, 2, 3, 4, 5, 6], or directly
[[1, 2],
[3, 4],
[5, 6]]
that will be ravelled automatically. So, with the new behaviour, the returned
vector values would have the same shape as the `coors` argument (the
coordinates) that are passed into the setting functions. IMHO this is much
easier to get right for users.
Any thoughts?
Cheers,
r.
[1] https://github.com/sfepy/sfepy/issues/404