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,
SfePy can now uniformly refine tetrahedral meshes using Domain.refine().
It's quite simple to try - look at 'tests/test_domain.py'. It uses an
algorithm from [1], that prevents spoiling element quality in subsequent
refinements.
r.
[1] Juergen Bey: Tetrahedral grid refinement, Computing 55 (1995), no. 4, 355--378
I am pleased to announce release 2011.1 of SfePy.
Description
-----------
SfePy (simple finite elements in Python) is a software for solving systems
of coupled partial differential equations by the finite element method.
The code is based on NumPy and SciPy packages. It is distributed under the
new BSD license.
Home page: http://sfepy.org
Mailing lists, issue tracking: http://code.google.com/p/sfepy/
Git (source) repository: http://github.com/sfepy
Documentation: http://docs.sfepy.org/doc
Highlights of this release
--------------------------
- discontinuous approximations
- user-defined material nonlinearities
- improved surface approximations
- speed-up mesh reading
- extensive clean-up - less code
For more information on this release, see
http://sfepy.googlecode.com/svn/web/releases/2011.1_RELEASE_NOTES.txt
(full release notes, rather long and technical).
Best regards,
Robert Cimrman and Contributors (*)
(*) Contributors to this release (alphabetical order):
Vladimï¿År Lukeï¿Å, Andre Smit, Logan Sorenson
Cool!
I write from my phone, so I do not have the sources at hand, but I have a few remarks nevertheless:
- to get nodes in a given region, you should use Field.get_dofs_in_region() as in tests/test_laplace_unit_disk.py, since region.all_vertices are just the vertex nodes, while higher order approximations have also edge, face, and bubble nodes depeding on order.
- the same for connectivities and coordinates - those of the mesh contain just the mesh, you need field connectvities, coordinates: Field.aps[ig].econn, Field.coors, ig is the element group.
- to get stress in nodes, look at sfepy primer by Andre. There is also Variable.data_from_qp(), used e.g. in schroedinger.py
I am no completely sure what your functions aim to do (docstrings :)), so that's my response for now, hope that helps.
r.
----- Reply message -----
From: "Peter M. Clausen" <petermich...(a)googlemail.com>
To: <sfepy...(a)googlegroups.com>
Subject: compute_nodal_normals and higher order elements
Date: Tue, Mar 15, 2011 02:17
Hi again
I'm just playing around right now getting to know sfepy better - and I
like it the more I see.
Attached is a hack of an simple Optimality Criteria method: Move nodes
outward with large stress, inwards with low stress. Some first
implementation of a simple mesh smoothing, which currently only works
for inner nodes.
Then I wanted to check what happens with a 2nd degree field (Quadratic
elements, right?). And here the compute_nodal_normals fails:
Traceback (most recent call last):
File "../../simple.py", line 113, in <module>
main()
File "../../simple.py", line 110, in main
app()
File "/opt/sfepy/sfepy-release-2011.1_beta/sfepy/sfepy/applications/application.py",
line 33, in call_parametrized
for aux in generator:
File "linear_elastic_tractions_beam_oc.py", line 179, in shape_oc
normals = compute_nodal_normals(top_nodes, top_reg, disp_field)
File "/opt/sfepy/sfepy-release-2011.1_beta/sfepy/sfepy/fem/utils.py",
line 42, in compute_nodal_normals
mask[econn] += 1
IndexError: index 582 out of bounds 0<=index<525
I guess the problem is the extra nodes appended due to the higher
order elements, but I kind of get stuck in debugging the routine...
I am also not quite sure what to expect - I mean, the regions are
'simple' corner nodes, but I would actually like to also get the
higher order nodes in the regions as well. Should I initialize the
regions differently or ...?
Best regards
Peter
--
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.
Strange. Does it always segfault on the same file? Were the sfepy extensions compiled when you run the command?
It could be a doxygen issue, yes.
r.
----- Reply message -----
From: "Peter M. Clausen" <petermich...(a)googlemail.com>
To: <sfepy...(a)googlegroups.com>
Subject: time for 2011.1...
Date: Tue, Mar 15, 2011 02:14
Hi
I have an issue (which I think does not have anything to do with
sfepy) that I cant build htmldocs on my 32-bit ubuntu 10.10 box
(Speicherzugriffsfehler[DE]=Seg. Fault[En])
$ make htmldocs
....
Generating docs for namespace sfepy::homogenization::phono
make: *** [htmldocs] Speicherzugriffsfehler
Just for the record. On Ubuntu 64-bit 10.04 it works OK.
/Peter
--
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 again
I'm just playing around right now getting to know sfepy better - and I
like it the more I see.
Attached is a hack of an simple Optimality Criteria method: Move nodes
outward with large stress, inwards with low stress. Some first
implementation of a simple mesh smoothing, which currently only works
for inner nodes.
Then I wanted to check what happens with a 2nd degree field (Quadratic
elements, right?). And here the compute_nodal_normals fails:
Traceback (most recent call last):
File "../../simple.py", line 113, in <module>
main()
File "../../simple.py", line 110, in main
app()
File "/opt/sfepy/sfepy-release-2011.1_beta/sfepy/sfepy/applications/application.py",
line 33, in call_parametrized
for aux in generator:
File "linear_elastic_tractions_beam_oc.py", line 179, in shape_oc
normals = compute_nodal_normals(top_nodes, top_reg, disp_field)
File "/opt/sfepy/sfepy-release-2011.1_beta/sfepy/sfepy/fem/utils.py",
line 42, in compute_nodal_normals
mask[econn] += 1
IndexError: index 582 out of bounds 0<=index<525
I guess the problem is the extra nodes appended due to the higher
order elements, but I kind of get stuck in debugging the routine...
I am also not quite sure what to expect - I mean, the regions are
'simple' corner nodes, but I would actually like to also get the
higher order nodes in the regions as well. Should I initialize the
regions differently or ...?
Best regards
Peter
Well, you should probably install the whole enthought tool suite to run that example. That is what I install.
Its called ets on gentoo...
r.
----- Reply message -----
From: "Peter M. Clausen" <petermich...(a)googlemail.com>
To: <sfepy...(a)googlegroups.com>
Subject: time for 2011.1...
Date: Sat, Mar 12, 2011 21:30
Hi
OK, I was missing enthought.traits but now I get:
clausen@pmc-server1:/data/opt/sfepy/sfepy-release-2011.1_beta/sfepy$
python examples/standalone/interactive/linear_elasticity.py
Traceback (most recent call last):
File "examples/standalone/interactive/linear_elasticity.py", line
12, in <module>
from sfepy.postprocess import Viewer
File "/data/opt/sfepy/sfepy-release-2010.4/lib/python2.6/site-packages/sfepy/postprocess/__init__.py",
line 1, in <module>
from viewer import Viewer, ViewerGUI
File "/data/opt/sfepy/sfepy-release-2010.4/lib/python2.6/site-packages/sfepy/postprocess/viewer.py",
line 8, in <module>
from enthought.tvtk.pyface.scene_editor import SceneEditor
ImportError: No module named tvtk.pyface.scene_editor
What am I missing?
Cheers
Peter
2011/3/12 osman <os...(a)fuse.net>:
> On Sat, 2011-03-12 at 01:50 -0500, Logan Sorenson wrote:
>> Hi All,
>>
>> I see the same thing over here. Running the linear_elasticity example produces:
>>
>> logan@quantumdot:~/projects/sfepy/sfepy_rc$ python
>> examples/standalone/interactive/linear_elasticity.py
>> Traceback (most recent call last):
>> File "examples/standalone/interactive/linear_elasticity.py", line 5,
>> in <module>
>> from sfepy.base.base import IndexedStruct
>> ImportError: No module named sfepy.base.base
>>
>> Based on some the other code in examples/standalone, I think the
>> linear_elasticity.py needs the following lines:
>>
>> import sys
>> sys.path.append('.')
>>
>> After that, the test_install.py script finishes.
>>
>> However, I get a mismatch for the schroedinger hydrogen example:
>>
>> ./schroedinger.py --2d --hydrogen
>> comparing: (8.73e-04% -0.01984415
>> ! ...: False
>>
>> I'll look more into it and report back.
>>
>> HTH!
>> Logan
>
> Thanks Logan. That solved the problem on my machine too.
>
> Osman
>
> --
> 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.
>
>
--
--
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.
Thanks for chiming in!
Could you provide a pdf with the theoretical background? I guess I can decipher what the code does, but I do not think others are that familiar with sfepy.
r.
----- Reply message -----
From: "Vladimír Lukeš" <vlu...(a)kme.zcu.cz>
To: <sfepy...(a)googlegroups.com>
Subject: Sensitivity calculation with sfepy
Date: Sun, Mar 13, 2011 19:21
Hi Peter
I use sensitivity calculation in Sfepy for acoustic problems. The theory
is based on two-scale homogenization, so I need to solve two
sensitivities at different scales, macro and micro. See attached files.
It involves also the tests that compares results with finite differences.
Regards
Vladimir
On 03/12/2011 02:35 PM, Peter M. Clausen wrote:
> Hi
>
> My objective is to survey different methods of sensitivity calculation
> w.r.t. geometry changes (shape and topology optimization) and after
> looking into many open source FE-codes I believe that Sfepy might be
> the right choice for me - I love Python, but I am not sure I really
> grasp the whole structure of Sfepy. I am a structural mechanics guy so
> I'm starting out with the easiest for me - a simple beam with a
> traction load.
>
> I am going to ask a lot of questions in the near future. I hope the
> questions are not too stupid...
>
> 1. Structure of Sfepy
>
> 1.1. Debugging in Eclipse
> I found it very helpfull to debug in eclipse. I found it pretty easy
> to set up (on Ubuntu 10.04 at least).
>
> 1.2. Setting up the system matrix
> I am used to classic structural FE-codes where the typical setup
> (simplified) is:
> forall elements:
> ...
> setup element matrix
> insert in system matrix
> ...
>
> Now, in sfepy I cant really figure out where this element loop is,
> probably not really there. Of course I assume the 'assembling matrix
> graph...' is pretty much what I am looking for, but I dont really get
> it. Any explanation or reference would help me.
>
>
> 2. More loadcases (different tractions)
>
> I want to use adjoint sensitivity calculation where I need to solve
> the system once more with a different load (or even a couple of
> times). What is the easiest way to add loads? In first implementation
> performance is not really important, but the beautiful solution is of
> course to keep the inverted system matrix and simply solve for a new
> right hand side.
>
> Thanks
>
> Best regards
>
> Peter
>
--
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
My objective is to survey different methods of sensitivity calculation
w.r.t. geometry changes (shape and topology optimization) and after
looking into many open source FE-codes I believe that Sfepy might be
the right choice for me - I love Python, but I am not sure I really
grasp the whole structure of Sfepy. I am a structural mechanics guy so
I'm starting out with the easiest for me - a simple beam with a
traction load.
I am going to ask a lot of questions in the near future. I hope the
questions are not too stupid...
1. Structure of Sfepy
1.1. Debugging in Eclipse
I found it very helpfull to debug in eclipse. I found it pretty easy
to set up (on Ubuntu 10.04 at least).
1.2. Setting up the system matrix
I am used to classic structural FE-codes where the typical setup
(simplified) is:
forall elements:
...
setup element matrix
insert in system matrix
...
Now, in sfepy I cant really figure out where this element loop is,
probably not really there. Of course I assume the 'assembling matrix
graph...' is pretty much what I am looking for, but I dont really get
it. Any explanation or reference would help me.
2. More loadcases (different tractions)
I want to use adjoint sensitivity calculation where I need to solve
the system once more with a different load (or even a couple of
times). What is the easiest way to add loads? In first implementation
performance is not really important, but the beautiful solution is of
course to keep the inverted system matrix and simply solve for a new
right hand side.
Thanks
Best regards
Peter
Hi Peter,
the assembling works basically just like you wrote. It starts either by Equations.eval_residuals() or Equations.eval_tangent_matrices() and has the following structure:
for equation in equations:
for term in equation:
out = evaluate element residuals or matrices
assemble out into the residual vector or tangent matrix
This is the same for both linear and nonlinear problems.
The matrix graph assembling serves only to preallocate the sparse matrix structure as governed by the element connectivity.
As for different load cases, your problem is static and linear, right? So the easiest way is to use an artficial time stepping and to change the load in each time step. If you set the 'problem' attribute of the nonlinear solver to 'linear', the matrix will be assembled and factorized before the time steps. Look at the time-dependent examples sfepy/diffusion/time_poisson.py or examples/linear_elasticity/linear_elastic/dynamic.py.
Another possibility is to write the loading loop yourself using sfepy as a library. This is much more powerful as it allows you to do anything you need (if it is implemented), but you need to know what you are doing...
Does this help? I see I should write an article about sfepy "architecture".
r.
----- Reply message -----
From: "Peter M. Clausen" <petermich...(a)googlemail.com>
To: <sfepy...(a)googlegroups.com>
Subject: Sensitivity calculation with sfepy
Date: Sat, Mar 12, 2011 14:35
Hi
My objective is to survey different methods of sensitivity calculation
w.r.t. geometry changes (shape and topology optimization) and after
looking into many open source FE-codes I believe that Sfepy might be
the right choice for me - I love Python, but I am not sure I really
grasp the whole structure of Sfepy. I am a structural mechanics guy so
I'm starting out with the easiest for me - a simple beam with a
traction load.
I am going to ask a lot of questions in the near future. I hope the
questions are not too stupid...
1. Structure of Sfepy
1.1. Debugging in Eclipse
I found it very helpfull to debug in eclipse. I found it pretty easy
to set up (on Ubuntu 10.04 at least).
1.2. Setting up the system matrix
I am used to classic structural FE-codes where the typical setup
(simplified) is:
forall elements:
...
setup element matrix
insert in system matrix
...
Now, in sfepy I cant really figure out where this element loop is,
probably not really there. Of course I assume the 'assembling matrix
graph...' is pretty much what I am looking for, but I dont really get
it. Any explanation or reference would help me.
2. More loadcases (different tractions)
I want to use adjoint sensitivity calculation where I need to solve
the system once more with a different load (or even a couple of
times). What is the easiest way to add loads? In first implementation
performance is not really important, but the beautiful solution is of
course to keep the inverted system matrix and simply solve for a new
right hand side.
Thanks
Best regards
Peter
--
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.