Thank you! It's in (only slightly updated). I have also added tests for the two new diffusion examples.
Cheers, r.
On 11/02/2012 03:57 PM, Bjarke Dalslet wrote:
Ok, I think I fixed the style.
Have a nice weekend!
-Bjarke
On 1 November 2012 17:46, Robert Cimrman cimr...@ntc.zcu.cz wrote:
On 11/01/2012 04:19 PM, Bjarke Dalslet wrote:
Ah yes, the power source is the same one as in examples/diffusion/poisson_**parametric_study.py. BTW, is there a mistake in that files header? I believe the strong form should be $c\nabla^2 t=f$ and not $c\nabla t=f$.
Yes, there is a typo, thanks for spotting that! It is fixed now.
I put it in the periodic boundary example anyway as it was a good way to
visualize the periodic boundary condition. I have attached the files (.geo, .mesh and .py) and a patch.
Wow, I wish I mastered gmsh in such a way :)
IMHO this example should have the 'quasistatic' time solver option set to False. When it is True, an equilibrium is computed already for t = 0, so the next few time steps do nothing until you set the power off. With False, a nice time evolution is obtained, as can be seen when the color range is fixed by running:
./postproc.py cylinder_in_box.??.vtk -b --ranges=T,0,4.3
Then I have some few recommendations (do not get scared :)):
- Replace the periodic boundary condition definition by the short syntax version, so that all keywords use the same:
epbcs = { # In the y-direction 'periodic_y' : (['y+', 'y-'], {'T.0' : 'T.0'}, 'match_y_plane'), # and in the z-direction. Due to the symmetry of the problem, this periodic # boundary condition is actually not necessary, but we include it anyway. 'periodic_z' : (['z+', 'z-'], {'T.0' : 'T.0'}, 'match_z_plane'), }
Try to follow our coding style [1], which is basically what PEP-0008 says (lines max. 79 characters, spaces around '=' in assignment except keyword arguments, spaces behing commas...). The code should look like poisson_field_dependent_**material.py does now. It really improves the readability for others. [2] might help here, with small tweaks mentioned below. It's not perfect, but gets most things right.
Instead of np.ones(len(coors[:,0]))*0, use np.zeros(), or np.zeros_like().
Also, in SfePy, we use nm for numpy abbreviation, as it started before np was declared standard by numpy guys. So, please, use nm for the moment. We may some day mass-replace all occurrences of nm. to np., but...
That's about it - I could have made the above changes myself, but by doing it yourself you might get it into your ways :) It's a nice example btw.
Cheers & thanks for contributing! r.
[1] http://docs.sfepy.org/doc-**devel/developer_guide.html#**coding-stylehttp://docs.sfepy.org/doc-devel/developer_guide.html#coding-style [2] http://pypi.python.org/pypi/**PythonTidy/http://pypi.python.org/pypi/PythonTidy/
tweaks for [2]:
COL_LIMIT = 79 DICT_COLON = ' : ' ADD_BLANK_LINES_AROUND_**COMMENTS = False MAX_SEPS_FUNC_DEF = 50 # 2007 May 24 PARENTHESIZE_TUPLE_DISPLAY = False # 2010 Mar 10
- Bjarke