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

I am currrently looking for FEM packages to help me solve a system of
beams and columns, basically a collection of 1D bernoulli/timoshenko
line elements.
I started reading SfePy docs and i am getting the idea that doing the
above is not really possible here, am i right?
Are only 2D area elements permitted in SfePy?
Or is there any direct support for solving 1D line elements too..
Cheers
Nimish

I have made an inline instalation of sfepy-2013.3 on fedora22 , I run the
tests and I have only 3 failed, they maybe related to the parallel option
since I don't have instaled that option. I have python 2.7.10, mayavi
4.4.3, VTK 6.1.0, Qt 4.8.6
Either on the python or ipython window when I try to import:
*from sfepy.postprocess.viewer import Viewe*r
I get the following message,
*cannot set toolkit to wx because it has already been set to qt4*
and of course any postprocessing will fail

Hello Robert,
I am trying to simulate a rectangular block with the fixed bottom and
loaded at the top by an area force.
I have following doubts. Please clarify
1.How to consider the area force.
2.Which elastic equation should I use? I am not finding any equation for
area loads.
3.I'm sharing my problem description file. Kindly look into it and help me
understand. I am very new to SfePy.
from sfepy.mechanics.matcoefs import lame_from_youngpoisson
from sfepy.discrete.fem.utils import refine_mesh
from sfepy import data_dir
# Tell SfePy to use our .mesh file
filename_mesh = data_dir + '/meshes/3d/block.mesh'
# Tell SfePy where u want to save the output
output_dir = '.'
# Material parameters.
young = 200000.0 # Young's modulus [MPa]
poisson = 0.26 # Poisson's ratio
options = {
'output_dir' : output_dir,
}
#Regions are used to define the boundary conditions, the domains of terms
and materials etc.
regions = {
'Omega' : 'all',
'Bottom' : ('vertices in (y=0)', 'facet'),
'Top':('vertices in (y=1)', 'facet'),
}
#Define constitutive parameters (e.g. stiffness, permeability, or
viscosity),
#Also other non-field arguments of terms (e.g. known traction or volume
forces).
materials = {
'Steel' : ({
'lam' : lame_from_youngpoisson(young, poisson)[0],
'mu' : lame_from_youngpoisson(young, poisson)[1],
},),
'Load' : ({'.val' : [0.0, -5.0,0.0]},),
}
#FE field.Here 'real' is datatype,'3' is dof per node, field is defined
over omega & '1' is approximation order
fields = {
'displacement': ('real', '3', 'Omega', 1),
}
#Here we use linear elastic spring equation
equations = {
'balance_of_forces' :
"""dw_lin_elastic_iso.2.Omega(Steel.lam, Steel.mu, v, u )
= dw_point_load.0.Top(Load.val, v)""",
}
# Specify the variables that use the FE approximation given by the
specified field
variables = {
'u' : ('unknown field', 'displacement', 0),
'v' : ('test field', 'displacement', 'u'),
}
#Since the bottom is fixed corresponding nodal displacement are zero
ebcs = {
'Fixed' : ('Bottom', {'u.all' : 0.0}),
}
#In SfePy, a non-linear solver has to be specified even when solving a
linear problem.
#The linear problem is/should be then solved in one iteration of the
nonlinear solver
solvers = {
'ls' : ('ls.scipy_direct', {}),
'newton' : ('nls.newton', {
'i_max' : 1,# Number of iterations
'eps_a' : 1e-6,
}),
}
Thanks in advance,
Nayan M

Hi Madhu,
How did you install sfepy?
r.
On 11/19/2015 07:18 PM, Madhu Mahadevappa wrote:
> Dear Robert,
> Thank you very much for the reply. I'm Using Canopy. Please let me know
> how and where to find the SfePy directory? I'm sorry if it is a stupid
> question.
>
> Regards,
> Madhu
>
> On Thursday, 19 November 2015 15:23:43 UTC+5:30, Robert Cimrman wrote:
>>
>> Hello Madhu,
>>
>> Try using sfepy in-place build [1]. This example is in SfePy, so you can
>> run it
>> simply by (in the sfepy source directory):
>>
>> python simple.py examples/linear_elasticity/its2D_2.py
>>
>> But feel free to copy it elsewhere (as long as you stay in the sfepy
>> source
>> directory when running commands.
>>
>> You can also use your file, but correct the path, if both the example and
>> the
>> mesh are in the same directory:
>>
>> filename_mesh = 'its2D.mesh'
>>
>> The syntax error is strange - how/where did you run the command? Also, do
>> not
>> mix \ and / characters in paths.
>>
>> Does that help?
>>
>> r.
>> [1] http://sfepy.org/doc-devel/installation.html#in-place-build
>>
>> On 11/18/2015 07:00 PM, Madhu Mahadevappa wrote:
>>> Hello,
>>> I'm Madhu and very new to Sfepy, learning this for my Master Thesis.
>> I'm
>>> trying to run the example given in the primer but getting an
>> error.Please
>>> help me with this.
>>> 1. I'm trying to invoke SfePy with the command 'E:|Solution/simple.py
>>> its2D.py' . My Problem definition file and .mesh file are located in my
>> E
>>> drive with a folder named Solution. When I run this, I'm getting the
>>> following error
>>> ""
>>> E:\Solution/simple.py its2D.py
>>> ^
>>> SyntaxError: invalid syntax
>>>
>>> ""
>>> 2. I have attached both the problem definition file and .mesh file I
>> have
>>> been trying from past 2 days to rectify but I couln't. Kindly help me.
>>>
>>> Regards,
>>> Madhu
>>>
>>
>>
>

Hello,
I'm Madhu and very new to Sfepy, learning this for my Master Thesis. I'm
trying to run the example given in the primer but getting an error.Please
help me with this.
1. I'm trying to invoke SfePy with the command 'E:|Solution/simple.py
its2D.py' . My Problem definition file and .mesh file are located in my E
drive with a folder named Solution. When I run this, I'm getting the
following error
""
E:\Solution/simple.py its2D.py
^
SyntaxError: invalid syntax
""
2. I have attached both the problem definition file and .mesh file I have
been trying from past 2 days to rectify but I couln't. Kindly help me.
Regards,
Madhu

I just updated sfepy to the latest master (previous version was about 1
year old) and I'm having trouble evaluating an FEM model that was working
with the old version. The full script is pretty long so I will try to
summarize here. It seems that a region of facet type is no longer able to
evaluate it's material properties where the material properties were
defined on other related regions of cell type.
Robert, do you know off hand of any changes to Region or Material that may
have broken this? Otherwise, I can try to reproduce it in a simpler use
case, for debugging.. anyway here is a description of whats happening:
A material is defined as follows:
self.matP = Material('elecProps', kind='stationary', values={'sigma' : {
'BloodPool' : sigma_blood,
'Tissue' : sigma_tissue}})
One of the terms is as follows:
probeFlux = Term.new('dw_surface_integrate(elecProps.sigma, s)',
self.integral, self.probeSurf, elecProps=self.matP, s=self.s)
where self.probeSurf is defined as follows (it contains no cells, only
facets):
self.probeSurf = self.domain.create_region('ProbeSurf', 'r.Probe *f
r.Tissue', kind='facet', parent='Tissue')
When I run the full script I get the following backtrace:
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/problem.pyc in
solve(self, state0, nls_status, ls_conf, nls_conf, force_values, var_data)
1012 self.equations.set_data(var_data, ignore_unknown=True)
1013
-> 1014 self.update_materials()
1015 state0.apply_ebc(force_values=force_values)
1016
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/problem.pyc in
update_materials(self, ts, mode, verbose)
528 self.update_time_stepper(ts)
529 self.equations.time_update_materials(self.ts, mode=mode,
--> 530 problem=self,
verbose=verbose)
531
532
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/equations.pyc in
time_update_materials(self, ts, mode, problem, verbose)
318 """
319 self.materials.time_update(ts, self, mode=mode,
problem=problem,
--> 320 verbose=verbose)
321
322 def setup_initial_conditions(self, ics, functions=None):
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/materials.pyc in
time_update(self, ts, equations, mode, problem, verbose)
55 for mat in self:
56 if verbose: output(' ', mat.name)
---> 57 mat.time_update(ts, equations, mode=mode,
problem=problem)
58 if verbose: output('...done in %.2f s' % (time.clock() -
tt))
59
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/materials.pyc in
time_update(self, ts, equations, mode, problem)
304
305 for key, term in self.iter_terms(equations):
--> 306 self.update_data(key, ts, equations, term,
problem=problem)
307
308 self.update_special_data(ts, equations, problem=problem)
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/materials.pyc in
update_data(self, key, ts, equations, term, problem)
220 data = self.function(ts, coors, mode='qp',
221 equations=equations, term=term,
problem=problem,
--> 222 **self.extra_args)
223
224 self.set_data(key, qps, data)
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/functions.pyc in
__call__(self, *args, **kwargs)
32 _kwargs = dict(kwargs)
33 _kwargs.update(self.extra_args)
---> 34 return self.function(*args, **_kwargs)
35
36 def set_function(self, function, is_constant=False):
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/functions.pyc in
get_constants(ts, coors, mode, term, problem, **kwargs)
112 region = problem.domain.regions[rkey]
113 rval = nm.array(rval, dtype=nm.float64,
ndmin=3)
--> 114 ii =
term.region.get_cell_indices(region.cells)
115 matdata[ii] = rval
116
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/common/region.pyc in
get_cell_indices(self, cells, true_cells_only)
600 to facets are returned if the region itself contains no
cells.
601 """
--> 602 fcells = self.get_cells(true_cells_only=true_cells_only)
603
604 ii = nm.searchsorted(fcells, cells)
/usr/local/lib/python2.7/dist-packages/sfepy/discrete/common/region.pyc in
get_cells(self, true_cells_only)
579 msg = 'region %s has not true cells! (has kind:
%s)' \
580 % (self.name, self.kind)
--> 581 raise ValueError(msg)
582
583 else:
ValueError: region ProbeSurf has not true cells! (has kind: facet)

Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as
you done in the paper: "Modelling heart tissue using a composite muscle
model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=rep... and
I was wondering if is easy to implemented in sfepy and/or if there is some
predefined term in Sfepy, since for example the term "dw_tl_fib_a" doesn't
include the "exp{k min(0;de/dt}}" that appears in the paper.
Thank you very much for your help :)