Git Product home page Git Product logo

sfepy's Introduction

CI

SfePy (Simple finite elements in Python)

SfePy [1] is a software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 1D, 2D and 3D. It can be viewed both as black-box PDE solver, and as a Python package which can be used for building custom applications. The word "simple" means that complex FEM problems can be coded very easily and rapidly. Its source code can be found on github [2].

SfePy is based primarily on NumPy [3] and SciPy [4]. See the INSTALL file for installation instructions or refer to [1].

  • License: New BSD License, see the LICENSE file.
  • Authors: Robert Cimrman and Contributors, see the AUTHORS file.

How to start

SfePy uses so called "problem definition files" (also referred to as "input files" or "problem description files"") that describe the partial differential equations (PDEs), boundary conditions, function spaces and other ingredients of the finite element (FE) formulation of a PDE-related problem, see [1]. The PDEs are given in weak formulation as usual in the FE context, see [5], where each equation is composed of one or more terms. To see which terms are available consult doc/sfepy_manual.pdf, or see them online [6].

In order to solve a problem, a problem description file has to be created. There is also an interactive solution support for advanced users [7]. When starting to solve a new problem, it is best to have a look at example problem definition files in the sfepy/examples/ directory - copy the one that is similar to the problem at hand, and modify it.

While a problem definition file describes a mathematical problem, it does not contain a discretized solution domain (a FE mesh). The FE mesh must be provided in another file in one of the supported formats, notably the legacy VTK format [8]. SfePy does not provide meshing tools, but it can use a number of standard formats. The results are almost exclusively stored in legacy VTK files, or custom HDF5 files. Many standard open-source tools can be used to display the VTK files, namely paraview [9] or pyvista [10]. The latter is supported directly within SfePy.

Once an input file and a corresponding mesh file are prepared, the solution of the problem can be sought, see the documentation.

References

[1](1, 2, 3) https://sfepy.org - main SfePy development site (releases, mailing lists, wiki, issue tracking, downloads, documentation, examples)
[2]https://github.com/sfepy - master git repository
[3]http://numpy.org
[4]http://scipy.org
[5]http://en.wikipedia.org/wiki/Weak_formulation
[6]https://docs.sfepy.org/doc/terms_overview.html
[7]https://docs.sfepy.org/doc/tutorial.html#interactive-example-linear-elasticity
[8]http://www.vtk.org/VTK/img/file-formats.pdf
[9]http://paraview.org/
[10]https://docs.pyvista.org/

sfepy's People

Contributors

alkalinin avatar antonykamp avatar bjarkedalslet avatar brylie avatar bubulk avatar burnpanck avatar certik avatar flothesof avatar freevryheid avatar gladk avatar heczis avatar jalogik avatar livoire13 avatar logansorenson avatar lokik avatar olivierverdier avatar osmanfb avatar ostueker avatar peppe988 avatar rc avatar rmcgibbo avatar ryangt avatar takluyver avatar taldcroft avatar vc12345679 avatar vlukes avatar vondrejc avatar yosefm avatar zitkat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sfepy's Issues

support 64bit platforms

resolve problem with 32/64 bit indices entering into extension modules in C

Migrated from http://code.google.com/p/sfepy/issues/detail?id=5


earlier comments

robert.cimrman said, at 2008-02-04T16:59:02.000Z:

64 bit version runs, but I am now getting problems on 32 bits. r.

robert.cimrman said, at 2008-02-04T17:43:03.000Z:

should work now, test it please.

ondrej.certik said, at 2008-02-04T17:44:28.000Z:

Indeed it works now.

ondrej.certik said, at 2008-02-04T17:47:36.000Z:

ok, but the comment #3 didn't make it. Opening again, until it works reliably.

ondrej.certik said, at 2008-02-04T17:48:41.000Z:

ok, it just took longer. I think it's fixed. :)

ondrej.certik said, at 2008-02-04T17:59:19.000Z:

Oops, I've mistaken the issue 5 for the issue 3.

Anyway, this works now too. Thanks for the fix!

automatic mesh generation

Attached find a first draft of the mesh utils patch.

Usage

Study convert.py, that shows a simple example:

$ python convert.py
General geometry information:
points: 7
lines: 18
surfaces: 20
volumes: 8
Physical entities:
surfaces (boundary conditions):
1: surface numbers [15, 29, 39, 53, 63, 77, 87, 100]
volumes (regions):
100: volume numbers [1, 2, 3, 4, 5, 6, 7, 8]
Generating mesh using /usr/bin/tetgen -pQAq1.000000 -a0.300000 tmp/t.poly
Reading mesh from tetgen...
nodes: 100% |###########################################| Time:
00:00:00
elements: 100% |########################################| Time:
00:00:00
BC: 100% |##############################################| Time:
00:00:00
nodes: 330
elements: 1224
Writing mesh to tmp/t12.msh: 100% |#############################| Time:
00:00:00

You need gmsh and tetgen executables to have installed. It takes
database/t1.geo.sphere-tri, runs it through tetgen, parses the result back,
and writes the mesh to tmp/t12.msh, which is and input file for gmsh.

Now I need to write a new output function to export to the .mesh format.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=17


earlier comments

ondrej.certik said, at 2008-02-07T23:38:19.000Z:

License note: I relicense all my code to new BSD. And the progressbar is relicensed too by it's author. There are some old license headers, that should be fixed.

robert.cimrman said, at 2008-02-08T14:37:22.000Z:

So I will move the progressbar into sfe/base/, ok?

Afternoon is here = maintenance of our network, my e-mails stop working...

ondrej.certik said, at 2008-02-08T14:41:57.000Z:

Yes. And fix it's license according to:

No problem. Sure I can license it under BSD.

I hereby relicense my progressbar module under BSD license. The LGPL
is still valid so anyone can use it under either LGPL or BSD licenses.

You can include this copyright notice in this version:

progressbar - Text progressbar library for python
Copyright (c) 2008 Nilton Volpato

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

a. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
b. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
c. Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

Thanks,
-- Nilton

robert.cimrman said, at 2008-02-08T15:00:41.000Z:

done.

ondrej.certik said, at 2008-02-14T23:09:31.000Z:

I noticed you committed the patch. We need to change it's license (it's using GPL) - I as the author can easily do that - let's use the same license as sfepy, i.e. BSD.

And also more refactoring is needed, before this issue can be closed.

robert.cimrman said, at 2008-02-15T16:29:33.000Z:

Ondrej came to my place, it is done.

test_io fails

$ ./runTests.py tests/test_io.py --debug
<<< tests/test_io.py
sfe: warning: other missing: ['fileName_mesh', 'field_[0-9]+|fields',
'ebc_[0-9]+|ebcs', 'fe', 'equations', 'region_[0-9]+|regions',
'variable_[0-9]+|variables', 'material_[0-9]+|materials',
'integral_[0-9]+|integrals', 'solver_[0-9]+|solvers', 'functions',
'modules', 'epbc_[0-9]+|epbcs', 'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+|nbcs',
'options']
sfe: warning: left over: ['nm', 'sp', 'TestCommon', 'op']
>>> test instance prepared (2 test(s))
... {'A': 0, 'B': {'C': [0, 1], 'D': {'E': {'F': {'G': 2.0}}}}}
... saving into output-tests/dict.h5...
>>> <type 'exceptions.NameError'>
Traceback (most recent call last):
File "./runTests.py", line 222, in <module>
main()
File "./runTests.py", line 210, in main
stats = runTest( testFileName, options )
File "./runTests.py", line 111, in runTest
ok, nFail, nTotal = test.run( options.debug )
File "/home/ondra/sfepy/sfe/base/testing.py", line 38, in run
ret = testMethod()
File "tests/test_io.py", line 55, in test_recursiveDictHDF5
writeDictHDF5( fileName, test )
File "/home/ondra/sfepy/sfe/base/ioutils.py", line 330, in writeDictHDF5
fd = pt.openFile( fileName, mode = "w",
NameError: global name 'pt' is not defined

if the problem is in not installing some module, it should say so, instead
of rising the NameError exception.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=37


earlier comments

robert.cimrman said, at 2008-06-12T12:00:35.000Z:

tests/test_io.py +++ test_recursiveDictHDF5: ok +++ test_sparseMatrixHDF5: ok

Do you have pytables? I will update the test to be skipped if it is missing.

ondrej.certik said, at 2008-06-12T12:06:43.000Z:

I think I didn't have them installed.

robert.cimrman said, at 2008-06-12T13:47:23.000Z:

And now you do not need to...

Schrodinger equation solver doesn't work in the latest sfepy

Schrodinger equation solver doesn't work in the latest sfepy:

$ ./schroedinger.py -s
sfe: warning: other missing: ['functions', 'modules', 'epbc_[0-9]+|epbcs',
'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+|nbcs']
sfe: warning: left over: ['funV', 'solver_2']
sfe: reading mesh...
nodes: 100% |############################################| Time:
00:00:00
elements: 100% |#########################################| Time:
00:00:00
sfe: ...done in 1.20 s
sfe: setting up domain edges...
sfe: ...done in 0.89 s
sfe: setting up domain faces...
sfe: ...done in 0.66 s
sfe: creating regions...
sfe: leaf Omega region_1000
sfe: leaf Surface region_2
sfe: ...done in 1.04 s
sfe: equation "rhs":
sfe: dw_mass_scalar.i1.Omega( v, Psi )
sfe: equation "lhs":
sfe: dw_laplace.i1.Omega( m.val, v, Psi )
+ dw_mass_scalar_variable.i1.Omega( matV.V, v, Psi )
sfe: describing geometries...
sfe: ...done in 0.16 s
sfe: setting up dof connectivities...
sfe: ...done in 0.00 s
sfe: matrix shape: (7964, 7964)
sfe: assembling matrix graph...
sfe: ...done in 0.10 s
sfe: matrix structural nonzeros: 117024 (1.85e-03% fill)
sfe: updating materials...
sfe: m
sfe: matV
sfe: ...done in 0.01 s
sfe: assembling lhs...
sfe: setting up dof connectivities...
sfe: ...done in 0.00 s
Traceback (most recent call last):
File "./schroedinger.py", line 317, in <module>
main()
File "./schroedinger.py", line 312, in main
evp = solveEigenProblem1( conf, options )
File "./schroedinger.py", line 211, in solveEigenProblem1
dwMode = 'matrix', tangentMatrix = pb.mtxA )
File "/home/ondra/sfepy/sfe/fem/evaluate.py", line 186, in evalTermOP
chunkSize = problem.domain.shape.nEl, *_kwargs )
File "/home/ondra/sfepy/sfe/fem/evaluate.py", line 237, in evalTerm
chunkSize, groupCanFail = False, *_kwargs )
File "/home/ondra/sfepy/sfe/fem/evaluate.py", line 173, in assembleMatrix
*_args ):
File "/home/ondra/sfepy/sfe/terms/termsMass.py", line 129, in call
fargs = self.buildCFunArgs( state, ap, vg, *_kwargs )
File "/home/ondra/sfepy/sfe/terms/termsMass.py", line 172, in buildCFunArgs
modeIn = 'vertex' )
File "/home/ondra/sfepy/sfe/terms/cache.py", line 178, in call
self.update( key, groupIndx, ih, **kwargs )
File "/home/ondra/sfepy/sfe/terms/cachesBasic.py", line 350, in update
matQP = self.data[key][ckey][ih].reshape( vshape )
ValueError: total size of new array must be unchanged

Migrated from http://code.google.com/p/sfepy/issues/detail?id=39


earlier comments

ondrej.certik said, at 2008-06-11T15:25:29.000Z:

Whatever the problem is, let's make sfepy more robust to raise a meaningful exception at the right place. + a test for it.

ondrej.certik said, at 2008-06-11T23:00:07.000Z:

I used "hg bisect" and here is what I got:

The first bad revision is:
changeset: 180:c73e7db416dd
user: Robert Cimrman [email protected]
date: Tue May 06 18:03:32 2008 +0200
summary: fixed MatInQPDataCache to work with diffusion tensor in vertices, in

well, I think it doesn't need any more comments. :) Do you know how to fix it?

ondrej.certik said, at 2008-06-11T23:12:15.000Z:

This patch makes it run with the latest sfepy:

diff --git a/sfe/terms/cachesBasic.py b/sfe/terms/cachesBasic.py
--- a/sfe/terms/cachesBasic.py
+++ b/sfe/terms/cachesBasic.py
@@ -341,7 +341,7 @@ class MatInQPDataCache( DataCache ):

         # dq_state_in_qp() works for vectors -> make a view of
         # shape (nEl, nQP, nRow * nCol, 1).
  •        vshape = shape[0:2] + (nm.prod( mat.shape[1:] ), 1)
    
  •        vshape = shape[0:2] + (mat.shape[1], 1)
    

print self

print self.shape, ckey

print vshape

Could you please explain me (or even better in the comments in the sources) what is
this supposed to do? And then let's write a test for this, as clearly it can be
broken sometimes.

robert.cimrman said, at 2008-06-12T11:20:30.000Z:

I will check it. The problem is that the tests do not cover special solvers as schroedinger.py - I will make a test veryfing if it runs.

robert.cimrman said, at 2008-06-12T11:58:29.000Z:

Fixed (the input files).

Explanation: MatInQPDataCache is a class that can, for example, interpolate material
data from vertices into Gauss points of the elements. The changeset 180 broadened the
possible input data shapes, but I forgot to fix also the schreodinger input files.

Test it please.

ondrej.certik said, at 2008-06-12T13:29:10.000Z:

Works well now. Thanks!

make the genDocXML + convert_doc work

  • finish the work on genDocXML to generate xml correctly
  • improve convert_doc to generate the same pdf documentation as genDoc
  • improve convert_doc to generate HTML

    Migrated from http://code.google.com/p/sfepy/issues/detail?id=25


    earlier comments

    ondrej.certik said, at 2008-02-24T20:08:26.000Z:

    XML -> pdf works now. I committed it directly to our repo. Sfepy needs a little cleanup anyway, so let's clean it up when it works.

Usage:

$ ./gen

and a file "tmp/t.pdf" is generated. Look into "./gen" for details.

robert.cimrman said, at 2008-02-25T09:09:56.000Z:

Looks good. I see some glitches only in tables (the alignment character '&' is printed - it seems that '&' gets translated into '\&') and in lines where a regular text and a math text is mixed (the regular one is wrongly typeset in math mode - 'termDefinition' needs to be improved). Nice work!

ondrej.certik said, at 2008-02-25T11:59:55.000Z:

Yep, those are known problems, which I didn't fix yet. I'll work on it today. In the meantime, try to help me find a good name for it:

http://code.google.com/p/sympy/issues/detail?id=717#c18

ondrej.certik said, at 2008-02-25T21:07:54.000Z:

OK, so the code in the sfepy hg is always copied from:

http://code.google.com/p/prettydoc/

and everything is now fixed, except the tables, which I fix soon. Maybe you will not
like some of the formatting, but as the genDocsXML is concerned, it's only job is to
create tmp/terms.xml. We can then customize the output in prettydoc, see this issue
for that:

http://code.google.com/p/prettydoc/issues/detail?id=3

ondrej.certik said, at 2008-02-26T00:26:18.000Z:

I fixed the tables too, plus I implemented customizations, so I put a SfePy specific customization to a separate file script/sfepyconverter.py, see ./gen how it works.

Please try it and comment. If you don't like some particular output, this should be
fixed in the custom file script/sfepyconverter.py

Only stuff, that is common to all projects should come to prettydoc.

I created a new issue 28 for the html printing.

Now please help me refine the customization + xml generation, so that we get the same
output. Then let's get rid of the old genDocs?

robert.cimrman said, at 2008-02-26T09:17:05.000Z:

I have fixed convert_doc.py to work with Python 2.4 - where should I commit to? Into prettydoc? How should be the files copied around?

For the moment, I attach the patch here.

ondrej.certik said, at 2008-02-26T10:51:59.000Z:

I use python2.4.....

Anyway, if it's a fix to convert_doc.py, fix it in prettydoc and make sure all tests
run. Then copy convert_doc.py to sfepy verbatim.

That's my suggested way how to work with this. Any local modifications go to the
file sfepyconverter.py as explained.

robert.cimrman said, at 2008-02-26T11:00:18.000Z:

Strange... without the patch, this is what I get:

$ script/convert_doc.py --converter=script/sfepyconverter.py:SfePyDocConverter
tmp/t.xml tmp/t.tex
Traceback (most recent call last):
File "script/convert_doc.py", line 1058, in ?
main()
File "script/convert_doc.py", line 1033, in main
mod = import(mod_name)
ImportError: No module named script/sfepyconverter

with Python 2.4.4

ondrej.certik said, at 2008-02-26T12:23:38.000Z:

Weird. Maybe Debian's python 2.4 is different from gentoo's.

Anyway, it's in prettydoc now too. Please try to run prettydoc tests, as described on
prettydoc webpage and see if all is ok now.

robert.cimrman said, at 2008-02-26T12:49:23.000Z:

Ran 5 tests in 6.001s

OK

The generated files look ok.

robert.cimrman said, at 2010-04-26T13:42:19.000Z:

This is now obsolete since the documentation is generated by sphinx.

mark static materials

For time-dependent problems, materials are updated in each time step, no
matter if their coefficients depend on time or not. This is costly for
non-trivial materials.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=40


earlier comments

robert.cimrman said, at 2008-07-02T14:21:34.000Z:

done in http://hg.sympy.org/sfepy/rev/6bca1f5bcd03

issues mailinglist

Could you please create a mailinglist for issues changes?

I'd like to subscribe to it, as I expect a lot of them will be created soon. :)

Migrated from http://code.google.com/p/sfepy/issues/detail?id=3


earlier comments

robert.cimrman said, at 2008-02-04T12:27:38.000Z:

done: [email protected]

ondrej.certik said, at 2008-02-04T14:48:43.000Z:

The list doesn't seem to receive the messages. Let's close this issue when the messages start getting to the list.

robert.cimrman said, at 2008-02-04T14:56:40.000Z:

added codesite-noreply to the group

robert.cimrman said, at 2008-02-04T17:46:40.000Z:

and let it post...

iterative sparse linear solvers

Using a direct sparse linear solver (umfpack) is very convenient as it can
solve any nonsingular system very quickly. If the LU-decomposed matrix fits
into memory, that is.

-> Iterative solvers are needed. First, let us try PETSc, via petsc4py.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=18


earlier comments

robert.cimrman said, at 2008-02-25T09:32:56.000Z:

Revision 65(341c69bf86f3) partially solved this, as all iterative solvers of Scipy are now accessible. The next step is Petsc.

robert.cimrman said, at 2008-05-07T14:30:18.000Z:

Revision 170(8544e03cb008) made PyAMG solvers accessible. Shall we close this? PETSc can wait.

ondrej.certik said, at 2008-05-07T14:38:33.000Z:

Let's close it.

test 2D/3D - read mesh file header

2D/3D geometry?

dim = meshio.read_dim(...)

Migrated from http://code.google.com/p/sfepy/issues/detail?id=46


earlier comments

robert.cimrman said, at 2008-07-03T10:05:19.000Z:

implemented:

from sfepy.fem.meshio import MeshIO
dim = MeshIO.anyFromFileName( fileName ).read_dimension()

for .mesh, .vtk

tested via tests/test_meshio.py

verify it please, and then close the issue :)

robert.cimrman said, at 2008-07-22T10:09:18.000Z:

This works now.

new input syntax for boundary conditions

This is motivated by needing different sets of boundary conditions for
various subproblems of a single computation, namely solving the subproblems
for the corrector functions of micro-problems related to a homogenization
of porous media.

EBC = essential BC

old syntax:
ebc = {
'Corners' : (('fixed_u', (0, 1, 2), 0.0 ),),
'EBCGammaI' : (('fixed_p_zero', (8,), 0.0),), # % variantI
'EBCGamma' : (('fixed_p_one', (8,), 1.0),), # % variant
}

new syntax (similar to regions, solvers, ...):
ebc_1 = {
'name' : 'fixed_u',
'region' : 'Corners',
'dofs' : (0, 1, 2),
'value' : 0.0
}
ebc_2 = {
'name' : 'fixed_p_zero',
'region' : 'EBCGammaI',
'dofs' : (8,),
'value' : 0.0
}
ebc_3 = {
'name' : 'fixed_p_one',
'region' : 'EBCGamma',
'dofs' : (8,),
'value' : 1.0
}

The used EBC could then be selected by their names and combined at wish.

Similarly should be updated also LCBC (linear combination BC) and EPBC
(periodic BC).

Migrated from http://code.google.com/p/sfepy/issues/detail?id=19


earlier comments

robert.cimrman said, at 2008-02-18T14:12:49.000Z:

Also: order of EBC application will be given by the lexicographical ordering of their definition names ('ebc_0' < 'ebc_020' < 'ebc_10').

robert.cimrman said, at 2008-02-18T15:47:43.000Z:

Implemented as discussed above.

show members in sfepy and sfepy-issues mailinglists

Let's turn on the members list, so that anyone can see who is subscribed?

Group settings -> Access -> Who can view members? -> Only members can view
group members list

Migrated from http://code.google.com/p/sfepy/issues/detail?id=8


earlier comments

robert.cimrman said, at 2008-02-04T18:18:03.000Z:

it was so for sfepy-devel, now it is for issues too.

ondrej.certik said, at 2008-02-04T18:42:44.000Z:

google groups has a bug, it doesn't show that I am in and thus I don't see the list. :(

ondrej.certik said, at 2008-02-04T18:44:29.000Z:

I probably screwed up my membership. I'll wait till tomorrow if things get sorted out.

Lately I am experiencing quite a lot of similar bugs in google services...

make ./runTests.py --filter-more the default?

I suggest this behavior:

$ ./runTests.py
<<< directory: tests, test files: 14
+++ test_structAdd: ok
+++ test_structIAdd: ok
+++ test_linear_terms: ok
+++ test_input: ok
+++ test_input: ok
+++ test_input: ok
+++ test_input: ok
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
+++ test_linearRigidBodyBC: ok
+++ test_linearRigidBodyBC: ok
+++ test_readMeshes: ok
+++ test_compareSameMeshes: ok
+++ test_parseEquations: ok
+++ test_parseRegions: ok
+++ test_pbc: ok
+++ test_pbc: ok
+++ test_problemCreation: ok
14 test file(s) executed in 13.56 s, 0 failure(s) of 18 test(s)

Currently the above command prints a lot of info.

I think when executing tests, it's important you run one simple command,
that doesn't print a lot of garbage, so that I can easily see - all is
ok/something went wrong (-> investigate).

Migrated from http://code.google.com/p/sfepy/issues/detail?id=13


earlier comments

robert.cimrman said, at 2008-02-05T14:07:30.000Z:

This might be better, as the test file names are visible:

{{{
$ ./runTests.py --filter-more
<<< directory: tests, test files: 14
<<< tests/test_input_kostka.py
+++ test_input: ok
<<< tests/test_input_navier_stokes.py
+++ test_input: ok
<<< tests/test_input_poisson.py
+++ test_input: ok
<<< tests/test_elasticity_small_strain.py
+++ test_linear_terms: ok
<<< tests/test_quadratures.py
+++ test_problemCreation: ok
<<< tests/test_io.py
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
<<< tests/test_parsing.py
+++ test_parseEquations: ok
+++ test_parseRegions: ok
<<< tests/test_periodic_bc_3d.py
+++ test_pbc: ok
<<< tests/test_lcbc_2d.py
+++ test_linearRigidBodyBC: ok
<<< tests/test_periodic_bc_2d.py
+++ test_pbc: ok
<<< tests/test_input_le.py
+++ test_input: ok
<<< tests/test_base.py
+++ test_structAdd: ok
+++ test_structIAdd: ok
<<< tests/test_lcbc_3d.py
+++ test_linearRigidBodyBC: ok
<<< tests/test_meshio.py
+++ test_readMeshes: ok
+++ test_compareSameMeshes: ok
14 test file(s) executed in 22.92 s, 0 failure(s) of 18 test(s)
}}}

Do you agree?

robert.cimrman said, at 2008-02-05T14:34:59.000Z:

I have commited the change (options are now --filter-none, --filter-less, --filter-more). This is imho both informative and terse enough...

ondrej.certik said, at 2008-02-05T15:16:18.000Z:

Excellent! The default behavior is now:

$ ./runTests.py
<<< directory: tests, test files: 14
<<< tests/test_base.py
+++ test_structAdd: ok
+++ test_structIAdd: ok
<<< tests/test_elasticity_small_strain.py
+++ test_linear_terms: ok
<<< tests/test_input_kostka.py
+++ test_input: ok
<<< tests/test_input_le.py
+++ test_input: ok
<<< tests/test_input_navier_stokes.py
+++ test_input: ok
<<< tests/test_input_poisson.py
+++ test_input: ok
<<< tests/test_io.py
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
<<< tests/test_lcbc_2d.py
+++ test_linearRigidBodyBC: ok
<<< tests/test_lcbc_3d.py
+++ test_linearRigidBodyBC: ok
<<< tests/test_meshio.py
+++ test_readMeshes: ok
+++ test_compareSameMeshes: ok
<<< tests/test_parsing.py
+++ test_parseEquations: ok
+++ test_parseRegions: ok
<<< tests/test_periodic_bc_2d.py
+++ test_pbc: ok
<<< tests/test_periodic_bc_3d.py
+++ test_pbc: ok
<<< tests/test_quadratures.py
+++ test_problemCreation: ok
14 test file(s) executed in 13.55 s, 0 failure(s) of 18 test(s)

Test file names should be visible, but the <<< and +++ syntax is kind of messy.

How about the following syntax:

+++ tests/test_base.py: test_structAdd: ok
+++ tests/test_base.py: test_structIAdd: ok
+++ tests/test_lcbc_3d.py: test_linearRigidBodyBC: ok
+++ tests/test_meshio.py: test_readMeshes: ok
+++ tests/test_meshio.py: ttest_compareSameMeshes: ok

or this syntax:

tests/test_base.py:
+++ test_structAdd: ok
+++ test_structIAdd: ok
tests/test_lcbc_3d.py:
+++ test_linearRigidBodyBC: ok
tests/test_meshio.py:
+++ test_readMeshes: ok
+++ ttest_compareSameMeshes: ok

ondrej.certik said, at 2008-02-05T15:23:23.000Z:

When this is resolved, let's update the examples wiki page with the final syntax, only then close this issue.

robert.cimrman said, at 2008-02-05T15:33:08.000Z:

It could be done. But how would you format the other output options then? The current implementation is very simple...

robert.cimrman said, at 2008-02-05T15:41:18.000Z:

or this?

<<< directory: tests, test files: 14
<<< tests/test_input_kostka.py
+++ test_input: ok
<<< tests/test_input_navier_stokes.py
+++ test_input: ok
<<< tests/test_input_poisson.py
+++ test_input: ok

with --filter-less:

<<< directory: tests, test files: 14
<<< tests/test_input_kostka.py

test instance prepared (1 test(s))
... solving input/kostka.py...
... input/kostka.py solved
+++ test_input: ok
all passed in 0.92 s

and with --filter-more:

<<< directory: tests, test files: 14
+++ test_input: ok
--- test_input: failed!
--- test_input: failed!
--- test_linear_terms: failed!
+++ test_problemCreation: ok
+++ test_recursiveDictHDF5: ok

ondrej.certik said, at 2008-02-05T15:48:30.000Z:

I like your first example in the comment 6 but with a substitution " " for "<<<".

I just want to quickly glance at the results and see if all is ok. All rubish, like
"<<<" makes this more difficult imho.

robert.cimrman said, at 2008-02-05T16:20:46.000Z:

try the new version - it looks ok with all the options. if you agree, could you update the example and close the issue?

ondrej.certik said, at 2008-02-05T16:28:35.000Z:

Perfect, thanks for the fix:

$ ./runTests.py
<<< directory: tests, test files: 14
tests/test_base.py
+++ test_structAdd: ok
+++ test_structIAdd: ok
tests/test_elasticity_small_strain.py
+++ test_linear_terms: ok
tests/test_input_kostka.py
+++ test_input: ok
tests/test_input_le.py
+++ test_input: ok
tests/test_input_navier_stokes.py
+++ test_input: ok
tests/test_input_poisson.py
+++ test_input: ok
tests/test_io.py
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
tests/test_lcbc_2d.py
+++ test_linearRigidBodyBC: ok
tests/test_lcbc_3d.py
+++ test_linearRigidBodyBC: ok
tests/test_meshio.py
+++ test_readMeshes: ok
+++ test_compareSameMeshes: ok
tests/test_parsing.py
+++ test_parseEquations: ok
+++ test_parseRegions: ok
tests/test_periodic_bc_2d.py
+++ test_pbc: ok
tests/test_periodic_bc_3d.py
+++ test_pbc: ok
tests/test_quadratures.py
+++ test_problemCreation: ok
14 test file(s) executed in 13.57 s, 0 failure(s) of 18 test(s)

Wiki fixed.

run-time type of term arguments

Example:

there are groups of terms like:

dw_lin_elastic: argTypes = ('material', 'virtual', 'state')
dw_lin_elastic_r: argTypes = ('material', 'virtual', 'parameter')
d_lin_elastic: argTypes = ('material', 'parameter_1', 'parameter_2')

This should be unified, as the weak form in all those cases is only one.
The first two cases even share all the code, just the argTypes differ.

I am 100% for unifying the dw_* with dw___r, it should be easy. Not so sure
about d__. Then the prefixes 'dw', 'd', etc. had to be united too, probably
to 'dw'.

Opinions?

Migrated from http://code.google.com/p/sfepy/issues/detail?id=47


earlier comments

robert.cimrman said, at 2008-07-04T10:01:11.000Z:

Unifying the dw_* with dw_*_r was trivial in terms of lines of code changed, but finding the right places was not so obvious. Anyway, all *_r terms are now gone...

The remaining terms have not been touched. Now the next step (d_* terms) would mean
more editing. Is it worth right now?

robert.cimrman said, at 2008-09-18T10:49:05.000Z:

I have found an easy way to unify all terms sharing the integral forms. For example dw_grad, dw_div, d_grad, d_div could be handled all by a single term. Now I am coding a proof-of-concept.

ondrej.certik said, at 2008-09-18T11:46:05.000Z:

Excellent!

robert.cimrman said, at 2008-09-23T17:44:58.000Z:

It's in. For a sample term with this functionality see dw_piezo_coupling and its use in input/piezo.py.

Now I will (gradually) remove unnecessary terms.

robert.cimrman said, at 2008-10-03T18:00:01.000Z:

Changeset http://hg.sympy.org/sfepy/rev/312b8baadda2 allows to unify also dw_, d_, de_, dq_, ... forms of one term. The hyperelastic terms provide the sample implementation.

I will close this issue after relevant terms are unified.

robert.cimrman said, at 2008-10-13T16:50:44.000Z:

Now, dw_stokes implements what was before in dw_grad, dw_div, d_div. See input/navier_stokes.py file for an example.

robert.cimrman said, at 2008-10-21T08:28:03.000Z:

Together with Issue 59, dw_stokes, dw_biot, and dw_biot_th encompass all former Biot- and Stokes-like terms (changeset http://hg.sympy.org/sfepy/rev/e2b43f0e4a76), let's close this.

clean-up pysparse-based solvers, dirac solver

Let us make them proper solvers in sfe/solver/

Migrated from http://code.google.com/p/sfepy/issues/detail?id=24


earlier comments

robert.cimrman said, at 2008-03-03T14:38:44.000Z:

pysparse eigenvalue solver is now in sfe/solvers/eigen.py

Usage: see input/schroed.py
solver_2 = {
'name' : 'eigen1',
'kind' : 'eig.pysparse',

'tau' : -10.0,
'epsA' : 1e-5,
'iMax' : 150,
'method' : 'qmrs',
'verbosity' : 0,
'strategy' : 1,

}

Ondrej, try it please when you can. It it is ok, remove the 'solve.py' file.

robert.cimrman said, at 2008-03-21T14:38:39.000Z:

done in changeset 98 (56aa790f6d3d)

delete the default description in issues

Could you please delete the default description when creating new issues
(if you agree)?

Go to administration -> issues

Migrated from http://code.google.com/p/sfepy/issues/detail?id=2


earlier comments

robert.cimrman said, at 2008-02-04T10:49:16.000Z:

I do not see the default description. do you mean one of:

Open Issue Status Values
Closed Issue Status Values
Predefined Issue Labels

or something else?
r.

ondrej.certik said, at 2008-02-04T11:43:37.000Z:

If you go here:

http://code.google.com/p/sfepy/issues/entry

You see this:

"
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

Please use labels and text to provide additional information.
"

I suggest to see nothing, like here:

http://code.google.com/p/sympy/issues/entry

robert.cimrman said, at 2008-02-04T12:16:33.000Z:

I see, done.

rewrite the "pytables import failed!"

Currently:

In [1]: from sfe.fem.mesh import Mesh
pytables import failed!

this is annoying and confusing.

Let's make this silent and only shout when pytables are really needed?

Migrated from http://code.google.com/p/sfepy/issues/detail?id=42


earlier comments

robert.cimrman said, at 2008-06-26T14:42:10.000Z:

done.

ondrej.certik said, at 2008-06-26T15:01:57.000Z:

Works fine now, thanks.

In [1]: from sfepy.fem.mesh import Mesh

In [2]:

support input meshes in VTK

I plan to add VTK mesh loader to remove dependence on medit to view the
bare meshes. Other formats may follow - do you have any?

r.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=6


earlier comments

ondrej.certik said, at 2008-02-04T17:49:41.000Z:

I'll send a patch with my mesh class, that also supports gmsh, tetgen and PMD.

robert.cimrman said, at 2008-02-05T09:01:52.000Z:

I am now reworking the mesh reading stuff so that new formats would be easily added. Then we integrate your class, ok?

ondrej.certik said, at 2008-02-05T10:18:29.000Z:

Excellent!

robert.cimrman said, at 2008-02-05T12:49:04.000Z:

done, added also new test file. try it please :)

ondrej.certik said, at 2008-02-05T13:30:59.000Z:

All tests pass for me, except 2, due to the issue 11.

ipapi for IPython 0.11

Recent IPython versions have undergone some major reorganization. When running ./isfepy, I get an error at

sfepy/interactive/init.py
65 ip = IPython.ipapi.get()

in ipython 0.11 and newer it should be
ip = IPython.core.ipapi.get()

sfepy/base/base.py would have the same problem

Also this ip object no longer has an IP attribute.

user's guide

I believe we need a user's guide. Same rationale as here:

http://code.google.com/p/sympy/issues/detail?id=717

Sample pages are here:

http://sympy.googlecode.com/svn/materials/usersguide/guide.html

This is a long term issue, I don't think we should work on this right now.
But in the horizon of a few months, we should fix this.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=22


earlier comments

robert.cimrman said, at 2008-02-18T12:47:04.000Z:

Yes. I have looked at the sympy guide - it looks very nice. By the time we get to this the right tools to write the docs with should be settled. I hate editing xml, so we should keep an eye on alternatives.

ondrej.certik said, at 2008-02-18T12:51:39.000Z:

Agree. We should use tools that people use though. And important here is how it looks like.

ondrej.certik said, at 2008-03-03T14:16:54.000Z:

I suggest to write our userguide in rst. The same way as in sympy, ipython and others.

Also, there should be a chapter "how to learn FEM", with the points made in:

http://groups.google.com/group/sfepy-devel/browse_thread/thread/2dc74465058fe558/

This is imho quite a high priority. Once we have all the tools for producing
documentation ready, we'll simply add a section whenever we implement something, and
that's it.

robert.cimrman said, at 2008-03-03T15:02:10.000Z:

I am fine with rst. Do you have some details regarding how the groups you listed use it? Yes, it is a high priority task.

ondrej.certik said, at 2008-03-03T16:00:17.000Z:

Well, they are just starting. For example yesterday I wrote a pdf generation code for ipython1. Well, we just go ahead, write it in rst, and maybe run it throug rst -> xml -> prettydoc

robert.cimrman said, at 2009-11-24T13:38:30.000Z:

The documentation is now at [1], and is based on sphinx. It's work in progress still...

[1] http://docs.sfepy.org/doc/

freevryheid said, at 2010-04-12T23:59:19.000Z:

On ubuntu the installation requirements should include python-dev (Header files and a static library for Python), which is not installed by default.

freevryheid said, at 2010-04-13T00:03:25.000Z:

Installation: setuptools also required

freevryheid said, at 2010-04-13T00:06:22.000Z:

Installation: gfortran also required

robert.cimrman said, at 2010-04-13T07:07:28.000Z:

OK, I will add those to the installation docs. Do you know why gfortran is needed? We have no fortran dependency...

freevryheid said, at 2010-06-17T13:43:46.000Z:

hmm - not sure why gfortran was needed? BLAS perhaps? Please disregard. Found a spello.

robert.cimrman said, at 2010-06-21T08:39:04.000Z:

Thanks, applied!

unify material parameters handling

Currently, inplace (mode 'here') materials use the dot notation, while the
function mode can bypass this, if there is a single value.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=35


earlier comments

robert.cimrman said, at 2008-05-02T12:38:49.000Z:

done.

evalTerm() and BC handling

ProblemDefinition.timeUpdate() works only if equations are set.

This is a problem as currently timeUpdate() must be called prior to calling
evalTerm() (or evalTermOP()), as it expects the BC are already set.

Thus instead of just:
problem.timeUpdate()
mtxAF = evalTermOP( dummyF, mtxTerm, problem,
dwMode = 'matrix', tangentMatrix = problem.mtxA )
one must do:
problem.setEquations( {'eq': mtxTerm} )
problem.timeUpdate()
mtxAF = evalTermOP( dummyF, mtxTerm, problem,
dwMode = 'matrix', tangentMatrix = problem.mtxA )

solution:

either: call BC updating code in evalTerm() after the term equation is set

or (better but more difficult): decouple Equations.describeGeometry and
Variables.setupDofConns() - actually the latter is only needed to update the BC

need to think also of some mechanism in evalTerm() of how to control what
has been already computed and what has not, so that it is not unnecessarily
slow. For example, the equations are actually already set and thus the
Variables.setupDofConns() call is not necessary.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=29


earlier comments

robert.cimrman said, at 2008-12-05T13:15:41.000Z:

See http://hg.sympy.org/sfepy/rev/6d896c1bfad3 for a partial solution.

robert.cimrman said, at 2010-04-01T10:05:28.000Z:

The whole problem definition building is going to change...

Mesh.fromFile raises IndexError: list index out of range

How to reproduce:

$ hg up 2aed0ddfa79e

apply this patch (to make the mesh faster to generate):

$ hg di
diff -r 2aed0ddfa79e convert.py
--- a/convert.py Thu Jun 26 13:58:01 2008 +0200
+++ b/convert.py Thu Jun 26 14:03:13 2008 +0200
@@ -24,7 +24,7 @@ def mesh():
g=geom.read_gmsh("tmp/x.geo")
g.printinfo()
geom.write_tetgen(g,"tmp/t.poly")

  • geom.runtetgen("tmp/t.poly",a=0.0003,Q=1.0,quadratic=False,
  • geom.runtetgen("tmp/t.poly",a=0.03,Q=1.0,quadratic=False,
    tetgenpath = tetgen_path)

m = Mesh.fromFile("tmp/t.1.node")

and do:

$ ./convert.py
matplotlib import failed!
General geometry information:
points: 8
lines: 12
surfaces: 6
volumes: 1
Physical entities:
surfaces (boundary conditions):
volumes (regions):
1: volume numbers [1]
Generating mesh using /usr/bin/tetgen -pQAq1.000000 -a0.030000 tmp/t.poly
sfe: reading mesh (tmp/t.1.node)...
nodes: 100% |############################################| Time:
00:00:00
elements: 100% |#########################################| Time:
00:00:00
sfe: ...done in 0.74 s
$ ipython
Python 2.4.4 (#2, Jan 3 2008, 13:53:47)
Type "copyright", "credits" or "license" for more information.

IPython 0.8.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: from sfe.fem.mesh import Mesh
matplotlib import failed!

In [2]: f = Mesh.fromFile("tmp/t.1.vtk")

sfe: reading mesh (tmp/t.1.vtk)...

IndexError Traceback (most recent call last)

/home/ondra/sfepy/<ipython console>

/home/ondra/sfepy/sfe/fem/mesh.py in fromFile(fileName, io)
356 tt = time.clock()
357 mesh = Mesh( trunk )
--> 358 mesh = io.read( mesh )
359 output( '...done in %.2f s' % (time.clock() - tt) )
360 mesh._setShapeInfo()

/home/ondra/sfepy/sfe/fem/meshio.py in read(self, mesh, **kwargs)
335 elif mode == 'points':
336 line = line.split()
--> 337 if line[0] == 'POINTS':
338 nNod = int( line[1] )
339 nod = readArray( fd, nNod, -1, nm.float64 )

IndexError: list index out of range

In [3]:

Migrated from http://code.google.com/p/sfepy/issues/detail?id=44


earlier comments

robert.cimrman said, at 2008-06-26T13:41:30.000Z:

Apart from other bugs, the generated file 'tmp/t.1.vtk' has not cell attribute matId (= the extra column in .mesh files, see also database/simple.vtk). I will fix the reader to provide default (0) in such case.

robert.cimrman said, at 2008-06-26T14:47:34.000Z:

should work now...

ondrej.certik said, at 2008-06-26T15:03:01.000Z:

Works like a charm:

In [1]: from sfepy.fem.mesh import Mesh

In [2]: f = Mesh.fromFile("tmp/t.1.vtk")
sfepy: reading mesh (tmp/t.1.vtk)...
sfepy: ...done in 1.26 s

In [3]:

Thanks for fixing this!

unify passing extra arguments to BC, material, and region functions

Current situation:
material:

  1. via 'extraArgs' in input - function is given by name only
  2. via extraMatArgs keyword argument passed to ProblemDefinition.timeUpdate()

bc: passing a global variable as keyword argument to BC function in input -
function is given by name only

region: (nodes by function mode...)

  1. positional arguments after the obligatory x, y, z in input - function
    is given with arguments
  2. same as bc may also work (not tested)

Examples and proposals will come later.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=36


earlier comments

robert.cimrman said, at 2008-12-17T15:32:54.000Z:

Instead of the "hackish" way of giving the function by its name (string) let's put in the proper function instance:


def f( standard_args ):
pass

material_1 = {
...
'function' = f,
...
}


in case one needs some extra arguments:


some_extra_args = ...

def f( standard_args, **some_extra_args ):
pass

material_1 = {
...
'function' = lambda standard_args: f( standard_args, **some_extra_args ),
...
}


The only exception would be when defining the regions:

region_1 = {
'name' : 'Inlet',
'select' : 'nodes by cinc( x, y, z, 0 )',
}

could be replaced by:

functions = {
'cinc_0' : lambda x, y, z: cinc( x, y, z, 0 ),
}

region_1 = {
'name' : 'Inlet',
'select' : 'nodes by cinc_0',
}

Note that having the new keyword 'functions' works for all the other cases (BC,
materials, ...) too.

robert.cimrman said, at 2009-09-03T14:53:26.000Z:

Implemented using the 'functions' keyword. See tests/test_functions.py for syntax.

add a fix to work both with scipy0.6.0 and svn

If one wants to work with scipy0.6.0, we I need to apply this patch:

$ hg di
diff -r e4024ff7ab0b sfe/solvers/ls.py
--- a/sfe/solvers/ls.py Tue Feb 05 13:44:32 2008 +0100
+++ b/sfe/solvers/ls.py Tue Feb 05 14:23:47 2008 +0100
@@ -1,7 +1,7 @@ from sfe.base.base import *
from sfe.base.base import *
from sfe.solvers.solvers import LinearSolver

-import scipy.splinalg.dsolve.umfpack as um
+import scipy.linsolve.umfpack as um
um.configure( assumeSortedIndices = True )

Let's add something like this into the ls.py:

if scipy.version.version == "0.6.0":
import scipy.linsolve.umfpack as um
else:
import scipy.splinalg.dsolve.umfpack as um

This is a high priority, because sfepy should work as much as possible with
the released version of scipy imho.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=10


earlier comments

ondrej.certik said, at 2008-02-05T13:35:54.000Z:

Patch fixing this issue is attached.

ondrej.certik said, at 2008-02-05T13:38:55.000Z:

Import for example using:

$ hg import ~/Desktop/Downloads/scipy.patch
applying /home/ondra/Desktop/Downloads/scipy.patch

robert.cimrman said, at 2008-02-05T13:53:18.000Z:

applied.

improve handling degrees of freedom in inputs

This is related to changes described in issues 19, 20.

DOFS are specified in both variables and e(p)bc by using tuples of
numerical values, e.g. 'dofs' : (0, 1, 2). I am now thinking about
something like this:

dofs of a variable, say 'u', are given by the field dimension and

referenced as 'u.0', 'u.1' ...

all dofs of 'u' can be referenced by 'u.all'

variable_1 = {
'name' : 'u',
'kind' : 'unknown field',
'field' : '2_displacement_Y2',
'order' : 0,
}
variable_2 = {
'name' : 'v',
'kind' : 'test field',
'field' : '2_displacement_Y2',
'dual' : 'u', # This sets the dofs for test fields.
}
variable_3 = {
'name' : 'u1',
'kind' : 'parameter field',
'field' : '2_displacement_Y1',
'like' : 'u', # This sets the dofs for parameter fields.
}

ebc_1 = {
'name' : 'ZeroSurface',
'region' : 'Y2_Surface',
'dofs' : ('u.0', 'u.1'), # or ('u.all')
'value' : 0.0,
}

It is IMHO better to read, and makes easier writing input files working
both in 2D and 3D.

I would consider also making optional the 'field' item for test and
parameter fields, as the field is given by the 'dual' and 'like' items
respectively. On the other hand, more information is better than less and
'there is only one way to do it' stuff...

Migrated from http://code.google.com/p/sfepy/issues/detail?id=23


earlier comments

robert.cimrman said, at 2008-02-25T10:16:31.000Z:

Update: new *BC syntax (I hope the final for some time) will be:

the following are equivalent (setting all 'u' dofs to 0.0 on Y2_Surface region):

ebc_1 = {
'name' : 'ZeroSurface',
'region' : 'Y2_Surface',
'dofs' : {'u.0' : 0.0, 'u.1' : 0.0}
}

or

ebc_1 = {
'name' : 'ZeroSurface',
'region' : 'Y2_Surface',
'dofs' : {'u.all' : 0.0}
}

or

ebc_1 = {
'name' : 'ZeroSurface',
'region' : 'Y2_Surface',
'dofs' : {'u.[0,1]' : 0.0}
}

Mixed-variable BC will be possible again ('u' is a 3D vector, 'p' a scalar):

ebc_10 = {
'name' : 'a name',
'region' : 'a region',
'dofs' : {u.all : 0.0, 'p.0' : 1.0}, # same as {u.[0,1,2] : 0.0, 'p.all' : 1.0}
}

Any comments anyone?

robert.cimrman said, at 2008-02-25T14:11:46.000Z:

Implemented :). Try to test it, please.

dependence on matplotlib

Does sfepy depend on matplotlib?

$ ./schroedinger.py --help
matplotlib import failed!
Traceback (most recent call last):
File "./schroedinger.py", line 41, in <module>
from sfe.homogenization.phono import processOptions
File "/home/ondra/sfepy/sfe/homogenization/phono.py", line 1, in <module>
import pylab
ImportError: No module named pylab

I think the exact set of dependencies should be in the documentation.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=38


earlier comments

robert.cimrman said, at 2008-06-12T11:54:37.000Z:

Some stuff does depend, for example 'eigen.py -p' which plots the results. On the other hand, schroedinger.py does not plot anything, so I fixed the dependence.

Try it please!

ondrej.certik said, at 2008-06-12T13:30:41.000Z:

Works well, thanks!

new input syntax for variables

Same motivation as Issue 19.

old syntax:
variables = {
'uc' : ('field', 'unknown', '3_displacement', (0, 1, 2), 0),
'vc' : ('field', 'test', '3_displacement', (0, 1, 2), 'uc'),
'Pi' : ('field', 'parameter', '3_displacement', (0, 1, 2)),
}

new syntax:
variable_1 = {
'name' : 'uc',
'type' : 'unknown field',
'field' : '3_displacement',
'dofs' : (0, 1, 2),
'order' : 0, # order in the global vector of unknowns, specific to
'unknown' variables
}
variable_2 = {
'name' : 'vc',
'type' : 'test field',
'field' : '3_displacement',
'dofs' : (0, 1, 2), # redundant?
'dual' : 'uc', # not sure about name, specific to 'test' variables
}
variable_3 = {
'name' : 'Pi',
'type' : 'parameter field',
'field' : '3_displacement',
'dofs' : (0, 1, 2), # redundant?
}

Migrated from http://code.google.com/p/sfepy/issues/detail?id=20


earlier comments

robert.cimrman said, at 2008-02-18T15:48:30.000Z:

Implemented:

variable_1 = {
'name' : 'u',
'kind' : 'unknown field',
'field' : '2_displacement',
'dofs' : (0, 1),
'order' : 0,
}
('type' -> 'kind')

rename sfe to sfepy

The library is called sfepy, so the module should be called sfepy, not sfe.

BTW, in sympy, we also renamed the module from sym to sympy.

This should be done as soon as possible.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=41


earlier comments

robert.cimrman said, at 2008-06-26T11:27:12.000Z:

hg rename sfe sfepy should do?

ondrej.certik said, at 2008-06-26T11:29:37.000Z:

yep. and fixing all the imports.

robert.cimrman said, at 2008-06-26T14:43:11.000Z:

and the Makefiles... Good to have find, sed and friends.

ondrej.certik said, at 2008-06-26T15:01:14.000Z:

Thanks for fixing this.

stress recovery

Implement stress (or any other quantity computed in quadrature points)
extrapolation into mesh nodes. Useful e.g. for boundary integrals.

see Introduction to FEM
(http://www.colorado.edu/engineering/CAS/courses.d/IFEM.d/), chapter 29

Migrated from http://code.google.com/p/sfepy/issues/detail?id=45


earlier comments

robert.cimrman said, at 2010-04-20T09:15:02.000Z:

This could be, in fact, easily achieved by defining a custom integral with quadrature points coinciding with the mesh nodes:

from sfepy.fem.geometry_element import geometry_data
gdata = geometry_data['3_8']
nc = len(gdata.coors)

integrals = {
'ivn' : ('v', 'custom', gdata.coors, [gdata.volume / nc] * nc),
}

...

and then evaluate:

stress = problem.evaluate('dq_cauchy_stress.ivn.Omega( m.D, u )', state)

Then you can choose whether to average somehow the stresses in each node, or not.

This example needs the current github repo version, as it uses short syntax for
custom integrals, and the volume attribute of geometry_data. Of course, you can use
long syntax, and provide your own coordinates and weights.

If the example above resolves the issue, close it, please.

tests won't pass without manually creating the output-tests dir

Steps to reproduce:

$ hg clone http://hg.sympy.org/sfepy
$ cd sfepy

Apply the patch in the issue 10 if you use scipy0.6.0.

$ make
$ ./runTests.py --filter-more
<<< directory: tests, test files: 14
+++ test_structAdd: ok
+++ test_structIAdd: ok
--- test_linear_terms: failed!
--- test_input: failed!
--- test_input: failed!
--- test_input: failed!
--- test_input: failed!
--- test_recursiveDictHDF5: failed!
--- test_sparseMatrixHDF5: failed!
--- test_linearRigidBodyBC: failed!
--- test_linearRigidBodyBC: failed!
+++ test_readMeshes: ok
+++ test_compareSameMeshes: ok
+++ test_parseEquations: ok
+++ test_parseRegions: ok
+++ test_pbc: ok
+++ test_pbc: ok
+++ test_problemCreation: ok
14 test file(s) executed in 9.91 s, 9 failure(s) of 18 test(s)

and here is a fix:

$ mkdir output-tests
$ ./runTests.py --filter-more
<<< directory: tests, test files: 14
+++ test_structAdd: ok
+++ test_structIAdd: ok
+++ test_linear_terms: ok
+++ test_input: ok
+++ test_input: ok
+++ test_input: ok
+++ test_input: ok
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
--- test_linearRigidBodyBC: failed!
--- test_linearRigidBodyBC: failed!
+++ test_readMeshes: ok
+++ test_compareSameMeshes: ok
+++ test_parseEquations: ok
+++ test_parseRegions: ok
+++ test_pbc: ok
+++ test_pbc: ok
+++ test_problemCreation: ok
14 test file(s) executed in 13.96 s, 2 failure(s) of 18 test(s)

So either the test suite should create the directory if it doesn't exist,
or we need to put some empty file and put that file into the hg control.

The two failing tests are due to the issue 11.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=12


earlier comments

robert.cimrman said, at 2008-02-05T13:38:56.000Z:

creating the directory is ok, I will fix it.

robert.cimrman said, at 2008-02-05T13:53:46.000Z:

done.

ondrej.certik said, at 2008-02-05T14:03:33.000Z:

Works fine now.

compulsory dot notation for materials

Let us have a material definition:

material_2 = {
'name' : 'm',
'mode' : 'here',
'region' : 'Omega',
'E' : 1.0,
}

Some terms with a material argument require passing the actual matrial
object ('m'), others require passing the data attribute ('m.E'). Only the
latter possibility is going to be supported.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=21


earlier comments

ondrej.certik said, at 2008-02-18T12:36:48.000Z:

Let's document everything in docstrings.

robert.cimrman said, at 2008-02-20T16:06:34.000Z:

Done. Added to the docstring of Material class.

fix or replace Makefile

Although the Makefile still works for building the extension code, it fails
in its second purpose - making the backup/release package - as the files
need to be listed manually at several places.

I will try to fix this (short term), but in a longer term we could look
elsewhere (scons?)

Migrated from http://code.google.com/p/sfepy/issues/detail?id=26


earlier comments

robert.cimrman said, at 2008-03-26T15:00:56.000Z:

Fixed the makefiles.

ondrej.certik said, at 2008-03-26T15:04:53.000Z:

Scons sucks too. Let's stick to makefiles if we can.

control verbosity

I think that currently too much information is printed, that is not
interesting/informative for a normal user.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=16


earlier comments

ondrej.certik said, at 2008-02-06T11:13:26.000Z:

You mean like overall during the process of solving? Yep, there should be options like -v, -vv, etc.

robert.cimrman said, at 2008-02-06T11:21:15.000Z:

or -v , whatever. this means slowly replacing all print statements by output() function (defined in sfe.base.base), with added 'verbosity'. But this can wait IMHO.

For the moment I will just remove some prints (like the times printed after running
simply.py), and make others more informative.

ondrej.certik said, at 2008-02-06T11:24:05.000Z:

Agree.

robert.cimrman said, at 2008-11-19T16:20:07.000Z:

changeset http://hg.sympy.org/sfepy/rev/f8783eff3ac4 makes this easier, as printing can now be well controlled.

two tests fail in scipy0.6.0 (but work in svn)

All tests should pass:

$ ./runTests.py --filter-more
<<< directory: tests, test files: 13
+++ test_structAdd: ok
+++ test_structIAdd: ok
+++ test_linear_terms: ok
+++ test_input: ok
+++ test_input: ok
+++ test_input: ok
+++ test_input: ok
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
--- test_linearRigidBodyBC: failed!
--- test_linearRigidBodyBC: failed!
+++ test_parseEquations: ok
+++ test_parseRegions: ok
+++ test_pbc: ok
+++ test_pbc: ok
+++ test_problemCreation: ok
13 test file(s) executed in 24.51 s, 2 failure(s) of 16 test(s)

The two failing tests are due to the fact, that in the latest released
scipy (0.6.0) you cannot use generalized indices:

File "/usr/lib/python2.4/site-packages/scipy/sparse/sparse.py", line
2450, in setitem
raise ValueError, "invalid index value: %s" % str((i, j))
ValueError: invalid index value: (array([ 16, 17, 18, ..., 7095, 7096,
7097]), array([ 0, 1, 2, ..., 5689, 5690, 5691]))

which is fixed in the svn version of scipy.

Is it possible to add a fix to support both scipy0.6.0 and svn? I think we
should not depend on svn versions of other libraries when possible, so that
we can just come to a different system, install standard packages (using
apt-get in Debian, something else in gentoo) and then sfepy should work.

If it is too much pain to support scipy0.6.0, then of course it's not worthy.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=11


earlier comments

robert.cimrman said, at 2008-02-05T13:38:00.000Z:

This functionality depends on the ability to extract a submatrix from a scipy CSR matrix. It cannot work without this ability reasonably -> in this case I am for waiting for a next scipy release. Anyway, linearRigidBodyBC is a special thing that majority of people do not need.

ondrej.certik said, at 2008-02-05T13:46:41.000Z:

ok, in this case I suggest to check the version of scipy in the tests and do not execute them for scipy 0.6.0.

Patch implementing this attached.

robert.cimrman said, at 2008-02-05T13:56:10.000Z:

fine solution, thanks!

ondrej.certik said, at 2008-02-05T13:58:44.000Z:

Works fine for me now. I forgot to write a meaningful log into the patch. Next time. :)

migrate sfe home page to better address

http://ui505p06-mbs.ntc.zcu.cz/sfe as address sucks.

now we are waiting for assigning an alias to the new server, so the
migration may happen any time soon.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=9


earlier comments

ondrej.certik said, at 2008-02-05T16:39:47.000Z:

Also let's name it "sfepy"?

robert.cimrman said, at 2008-02-05T16:53:06.000Z:

probably :) I am not sure what exact address we get (we had several possibilities), but certainly it could be discussed if we do not like it. An alias change should not be difficult.

robert.cimrman said, at 2008-02-25T09:33:54.000Z:

We have got http://sfepy.kme.zcu.cz/ - now the data have to be moved.

robert.cimrman said, at 2008-02-29T12:14:42.000Z:

http://sfepy.kme.zcu.cz/ for now redirects to the old server - better than nothing!

robert.cimrman said, at 2008-10-14T14:51:00.000Z:

Things started to move again, see

http://sfepy.kme.zcu.cz/cgi-bin/moin.cgi/

The sfepy.kme.zcu.cz page will contain information on Grant and other projects I am
paid from plus larger examples, while sfepy.org will be devoted to the code itself. I
have already migrated and updated all the documentation.

robert.cimrman said, at 2008-12-10T14:52:45.000Z:

The new pages (sfepy.kme.zcu.cz) are good enough now to close this issue - I do not update the old pages anymore anyway.

add info how to use paraview to our wiki

See the mailinglist for more info.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=1


earlier comments

ondrej.certik said, at 2008-02-05T15:24:14.000Z:

Particularly this thread:

http://groups.google.com/group/sfepy-devel/browse_thread/thread/246e4066e5465992

ondrej.certik said, at 2008-02-06T10:26:50.000Z:

The info how to use paraview from python is on the paraview wiki, one needs to download the pdf files. Most of my questions are explained in there. I am busy now, but when I find some time, I'll try it and write some small howto to our wiki.

robert.cimrman said, at 2008-02-06T10:44:12.000Z:

great! I am also too busy now to evaluate such things, so thanks for taking care of it.

ondrej.certik said, at 2008-02-06T14:17:58.000Z:

Here is the relevant pdf, that explains everything:

http://www.paraview.org/Wiki/images/2/26/Servermanager.pdf

robert.cimrman said, at 2008-02-06T14:29:20.000Z:

there is a discussion going on about animations: http://public.kitware.com/pipermail/paraview/2008-February/006811.html

I wonder if it is still possible to animate the legacy VTK files we use (as they are
simple and text only, no XML).

ondrej.certik said, at 2008-02-06T14:54:54.000Z:

We can always convert them to XML for the animations if needed.

robert.cimrman said, at 2008-02-06T15:14:45.000Z:

http://public.kitware.com/pipermail/paraview/2008-January/006569.html http://paraview.org/Wiki/Animating_legacy_VTK_file_series ... so easy!

ondrej.certik said, at 2008-02-22T00:09:44.000Z:

http://code.google.com/p/sfepy/wiki/ParaView

Please update the wiki with some examples how to do animation with sfepy and
paraview. Then let's close this issue.

robert.cimrman said, at 2008-03-07T15:41:31.000Z:

Today I was forced to create not a few figures with _mouse_ again and again - it was a royal PITA. I will look at scripting paraview (or something else) as soon as possible (= after the next week).

robert.cimrman said, at 2008-10-24T11:55:14.000Z:

I have updated the wiki a bit. Let's close this. We are scripting mayavi2 now anyway.

add and clean-up basic homogenization terms

Some of the homogenization term classes are identical to those already in
the public repository except material arguments they accept (constant x
variable, scalar * unit matrix x general tensor). There names are
completely unrelated though.

-> Think of common names, merge common functionality, add the classes to
the public repository.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=31


earlier comments

robert.cimrman said, at 2008-03-31T16:08:14.000Z:

done for now (*_lin_elastic*, *_diffusion*, *_biot* terms added).

term tests with manufactured solutions

Test terms and equations using the method of manufactured solutions (MMS).

Briefly, the MMS involves the following steps:

  1. assume a particular solution (e.g. u = sin(x) * cos(y))
  2. analytically compute the required right-hand side (source terms) and
    boundary conditions for a particular domain
  3. compare the numerical solution with the analytical one (possibly for
    various mesh refinements).

References (via http://doi.org/):
doi:10.1016/j.jcp.2004.10.036
doi:10.1115/1.1436090

Example:
http://www.imechanica.org/node/1357

How (quite complex!):

  • try to use sympy to have an automatic derivation of the source terms.
  • annotate somehow the term classes with what they do symbolically using
    sympy syntax

First, we should try a simple test case with the Laplace term.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=34


earlier comments

robert.cimrman said, at 2008-05-07T14:27:12.000Z:

The simple test case works, see tests/test_msm_laplace.py, now let us do the complex stuff. Even this test showed me how the 'per partes' integration in deriving weak forms can bite, when one forgets the fluxes...

robert.cimrman said, at 2008-05-09T14:18:56.000Z:

The first prototype using SymPy to generate the manufactured right-hand sides is done (rev. 195:cca307dfbf73, see http://hg.sympy.org/sfepy/file/cca307dfbf73/tests/test_msm_laplace.py).

Sample output:
... evaluating terms, "<=" is solution, "=>" is the rhs:
... dw_laplace( material, virtual, state )
... symbolic: c * div( grad( u, [x, y, z] ), [x, y, z] )
... using argument map: {'c': 'material', 'u': 'state'}
... <= sin( 3.0 * x ) * cos( 4.0 * y )
... => -25cos(4y)sin(3x)
... <= ((x - 0.5)3) * sin( 5.0 * y )
... => -3
(1 - 2x)sin(5y) + 25(0.5 - x)3sin(5y)
... <= (x
2) + (y
*2)
... => 4

Note that the material parameter 'c' of the Laplace term is actually evaluated in the
same way as in a regular computation -> changing it within the input file
tests/test_msm_laplace.py (see material_1) from 1 to 12 leads to:

... evaluating terms, "<=" is solution, "=>" is the rhs:
... dw_laplace( material, virtual, state )
... symbolic: c * div( grad( u, [x, y, z] ), [x, y, z] )
... using argument map: {'c': 'material', 'u': 'state'}
... <= sin( 3.0 * x ) * cos( 4.0 * y )
... => -3E+2cos(4y)sin(3x)
... <= ((x - 0.5)3) * sin( 5.0 * y )
... => -36
(1 - 2x)sin(5y) + 3E+2(0.5 - x)3sin(5y)
... <= (x
2) + (y
*2)
... => 48

It works, but there are some simplifying assumptions, namely a single scalar unknown
variable. I also do not like the explicit listing of variables as in
http://hg.sympy.org/sfepy/file/f304324986ff/sfe/terms/termsLaplace.py

symbolic = {'expression': 'c * div( grad( u, [x, y, z] ), [x, y, z] )',
            'map' : {'u' : 'state', 'c' : 'material'}}

Nevertheless, the Pandora's box is open!

robert.cimrman said, at 2008-05-16T10:17:48.000Z:

I will remove the [x, y, z] from 'c * div( grad( u, [x, y, z] ), [x, y, z] )', as a solution is always a function of space (and time), so x, y, z, and t variables will always be defined.

Other thing: should scalar fields be somehow distinguished from vector fields to
allow the following definition? linear elasticity, small strain tensor, just a
prototype!:
e = 1/2 * (grad( vec( u ) ) + grad( vec( u ) ).T)
instead of
e_ij = 1/2 * (d_j( u_i ) + d_i( u_j ))
Or not? I am not sure yet.

Anyway, I would rather not reinvent SyFi...

ondrej.certik said, at 2008-05-16T11:52:28.000Z:

I don't mind either way.

ondrej.certik said, at 2009-04-01T07:21:58.000Z:

will have to implement it myself :) I hoped you will do it :) we need something in sympy, so that we can specify all those weakforms in sympy and let sympy do the thing so we need a Nabla operator we need a dot product (I guess just regular "*"?) etc.

add docstring to testsBasic.py and runTests.py

Please add a module docstring to tests/testsBasic.py, something like this:

"""
This module is not a test file, it contains some useful classes, that are
imported from some test files.
"""

Then apparently there is some magic going on. For example
tests/test_input_kostka.py contains:

inputName = 'input/kostka.py'

however this variable is not called from testsBasic.TestInput, so how this
works should be explained in the module docstring in the file

runTests.py

Migrated from http://code.google.com/p/sfepy/issues/detail?id=15


earlier comments

ondrej.certik said, at 2008-02-05T16:39:07.000Z:

Also please explain in runTests.py docstring how to write my own new tests.

You don't have to explain all the details (I can copy some existing test file as a
starting point), but just a few sentences how it works and what the testfile is
supposed to do and what it should contain and return would be very helpful.

robert.cimrman said, at 2008-02-05T16:49:49.000Z:

short explanation first:

All variables defined in a test file are collected in 'conf', so inputName is in
conf.inputName.

A test file can contain anything, but usually it is similar to a regular input file
(defining a test problem), with a mandatory Test class. This class holds all the
test_* functions, as well as the fromConf(), which serves to initialize the test
(conf is in fact the test file itself, options are command-line options)

The test_* functions are colelcted automatically by runTests.py, with one exception:
if a certain order of their evaluation is required, a class attribute 'test' of the
Test class with a list of the test function names should be defined (example:
test_meshio.py).

ondrej.certik said, at 2008-02-05T17:24:32.000Z:

Excellent, let's put this into the docstring and then close this issue.

robert.cimrman said, at 2008-02-06T10:09:53.000Z:

done. I have also added --print-doc option to runTests.py.

ondrej.certik said, at 2008-02-06T10:25:15.000Z:

Perfect, great job, thanks!

ondrej.certik said, at 2008-02-06T10:25:16.000Z:

Perfect, great job, thanks!

allow 'short' syntax in input files

I would like to know your opinion on the changes proposed below. They are
intended to allow (optionally) reducing the verbosity of the input file
syntax. Of course, the 'long' syntax would still be there.

  1. allow also 'short' syntax for variables, ebc, epbc

variables = {
'uc' : ('unknown field', '2_displacement', 0),
'vc' : ('test field', '2_displacement', 'uc'),
'Pi' : ('parameter field', '2_displacement', 'uc'),
'Pi1' : ('parameter field', '2_displacement', 'uc'),
'Pi2' : ('parameter field', '2_displacement', 'uc'),
'pc' : ('unknown field', 'pressure3', 1),
'pc_0' : ('parameter field', 'pressure3', 'pc'),
'pp1' : ('parameter field', 'pressure3', 'pc'),
'pp2' : ('parameter field', 'pressure3', 'pc'),
'qc' : ('test field', 'pressure3', 'pc'),
}

ebcs = {
'fixed_u' : ('Corners', {'uc.all' : 0.0}),
'fixed_p_zero' : ('EBCGamma1', {'pc.0' : 0.0}),
'fixed_p_one' : ('EBCGamma2', {'pc.0' : 0.0}),
}

  1. regions:

together with:

region_0 = {
'name' : 'Bottom',
'select' : 'nodes in (y < -%.3f)' % yw,
}
region_1 = {
'name' : 'Top',
'select' : 'nodes in (y > %.3f)' % yw,
}

allow:

regions = {
'Bottom' : ('nodes in (y < -%.3f)' % yw, {}),
'Top' : ('nodes in (y > %.3f)' % yw, {}),
}

the {} is for additional flags, like canCells, forbid, etc.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=33


earlier comments

ondrej.certik said, at 2008-04-10T08:17:23.000Z:

1. yes, but only when we add explanation to our docs. :)

  1. is perfectly fine

    robert.cimrman said, at 2008-04-10T08:26:25.000Z:

Sure :) Neither the long syntax is explained, though :)

In small input files in the distro I will let the long syntax anyway, this is useful
mainly for me doing complex homogenization stuff.

robert.cimrman said, at 2008-05-02T12:41:28.000Z:

The final missing part (regions) is done. Both long and short version work.

tests won't pass on amd64

Pristine sfepy install:

$ ./runTests.py --filter-more
<<< directory: tests, test files: 14
+++ test_structAdd: ok
+++ test_structIAdd: ok
+++ test_linear_terms: ok
+++ test_input: ok
--- test_input: failed!
+++ test_input: ok
+++ test_input: ok
--- test_recursiveDictHDF5: failed!
--- test_sparseMatrixHDF5: failed!
+++ test_linearRigidBodyBC: ok
+++ test_linearRigidBodyBC: ok
--- test_readMeshes: failed!
--- test_compareSameMeshes: failed!
+++ test_parseEquations: ok
+++ test_parseRegions: ok
+++ test_pbc: ok
+++ test_pbc: ok
+++ test_problemCreation: ok
14 test file(s) executed in 11.17 s, 5 failure(s) of 18 test(s)

Let's close this issue when all tests/sfepy are fixed to pass on amd64 too.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=14


earlier comments

ondrej.certik said, at 2008-02-05T14:07:05.000Z:

Some of the tests started to pass after installing the "python-tables" package.

$ ./runTests.py --filter-more
<<< directory: tests, test files: 14
+++ test_structAdd: ok
+++ test_structIAdd: ok
+++ test_linear_terms: ok
+++ test_input: ok
--- test_input: failed!
+++ test_input: ok
+++ test_input: ok
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
+++ test_linearRigidBodyBC: ok
+++ test_linearRigidBodyBC: ok
--- test_readMeshes: failed!
--- test_compareSameMeshes: failed!
+++ test_parseEquations: ok
+++ test_parseRegions: ok
+++ test_pbc: ok
+++ test_pbc: ok
+++ test_problemCreation: ok
14 test file(s) executed in 11.45 s, 3 failure(s) of 18 test(s)

robert.cimrman said, at 2008-02-05T14:10:42.000Z:

could you run all the failing test files with --debug? I do not have access to AMD64.

robert.cimrman said, at 2008-02-05T15:04:51.000Z:

forget previous comment, I can debug it on your machine you gave me access to.

robert.cimrman said, at 2008-02-05T15:15:13.000Z:

probably fixed, try it please :)

ondrej.certik said, at 2008-02-05T15:20:00.000Z:

Indeed it works now.

$ time ./runTests.py
<<< directory: tests, test files: 14
<<< tests/test_base.py
+++ test_structAdd: ok
+++ test_structIAdd: ok
<<< tests/test_elasticity_small_strain.py
+++ test_linear_terms: ok
<<< tests/test_input_kostka.py
+++ test_input: ok
<<< tests/test_input_le.py
+++ test_input: ok
<<< tests/test_input_navier_stokes.py
+++ test_input: ok
<<< tests/test_input_poisson.py
+++ test_input: ok
<<< tests/test_io.py
+++ test_recursiveDictHDF5: ok
+++ test_sparseMatrixHDF5: ok
<<< tests/test_lcbc_2d.py
+++ test_linearRigidBodyBC: ok
<<< tests/test_lcbc_3d.py
+++ test_linearRigidBodyBC: ok
<<< tests/test_meshio.py
+++ test_readMeshes: ok
+++ test_compareSameMeshes: ok
<<< tests/test_parsing.py
+++ test_parseEquations: ok
+++ test_parseRegions: ok
<<< tests/test_periodic_bc_2d.py
+++ test_pbc: ok
<<< tests/test_periodic_bc_3d.py
+++ test_pbc: ok
<<< tests/test_quadratures.py
+++ test_problemCreation: ok
14 test file(s) executed in 11.60 s, 0 failure(s) of 18 test(s)

Thanks for the fix!

let's use python style guidelines

Let's make sfepy a regular python library by following the usual
conventions that people expect in python.

Mainly this:

http://www.python.org/dev/peps/pep-0008/

"
A style guide is about consistency. Consistency with this style guide is
important. Consistency within a project is more important. Consistency
within one module or function is most important.
"

Currently, sfepy uses both

some_method()
someMethod()

this is very inconsistent. I am not even mentioning things like the
following :)

dm_printNeighbourList()

From the guidelines:

"
Function Names

  Function names should be lowercase, with words separated by underscores
  as necessary to improve readability.

  mixedCase is allowed only in contexts where that's already the
  prevailing style (e.g. threading.py), to retain backwards compatibility.

[...]

Method Names and Instance Variables

  Use the function naming rules: lowercase with words separated by
  underscores as necessary to improve readability.

"

So I think the whole sfepy should just use one style overall. Let's use the
style that is suggested in the guidelines. (We don't have to be a backwards
compatible yet like threading.py)

Migrated from http://code.google.com/p/sfepy/issues/detail?id=43


earlier comments

robert.cimrman said, at 2008-06-26T11:52:29.000Z:

ok, as numpy and scipy have also tried to stick to it recently. Just one thing I would like to preserve in SfePy:

function( x, y, z )
instead of
function(x, y, z)

The two extra spaces improve the readability quite a bit, as the arguments are
visually separated from function name.

Any volunteers to automate this?

ondrej.certik said, at 2008-06-26T11:56:03.000Z:

I don't think it can be automated. I'll provide a patch that fixes all the names. I'll look at how this could be done easily in vim, or some commandline script.

robert.cimrman said, at 2008-06-26T12:08:00.000Z:

yep. some IDE with refactoring should be able to do it, e.g. emacs (or vim :)

ondrej.certik said, at 2008-07-16T11:54:14.000Z:

This is a release blocker.

robert.cimrman said, at 2008-07-16T12:47:06.000Z:

I propose additional recommendations:

  • do not use single letter names (not even loop variables - use e.g. ii, ir, ic, ...)
  • prefer whole words to abbreviations in public APIs - there is completion after all
    yes: equation, transform_variables(), filename
    rather not: eq, transvar(), fname
  • functions have usually form _()
    e.g.: save_data(), transform_variables(), do not use data_save(),
    variable_transform() etc.
  • variables like V, c, A, b, x should be tolerated only locally when expressing
    mathematical ideas
  • I like more function( arg1, arg2, arg3 = value ) than
    function(arg1, arg2, arg3=value)
  • a = 1 instead of a=1
  • some more?

comments?

ondrej.certik said, at 2008-07-16T14:10:43.000Z:

I agree, except:

  • do not use single letter names (not even loop variables - use e.g. ii, ir, ic, ...)

I prefer to use single letter loop variables when appropriate.

  • I like more function( arg1, arg2, arg3 = value ) than
    function(arg1, arg2, arg3=value)

I like more function(arg1, arg2, arg3=value), simply because this is what other
people use, so that's what I am used to.

otherwise ok.

Whenever you have something that doesn't follow the mainstream you really need to
have a good reason for it, otherwise it just looks unprofessional and it's more
difficult for other people to read the code. And we need more python developers,
rather than creating obstacles for them. imho.

robert.cimrman said, at 2008-07-16T14:24:06.000Z:

Single letter loops are ok, its just that finding (in an editor) a single letter in text is difficult as it tends to be included in many other words.

Random remarks:
As for fun( arg ) x fun(arg) it's just whitespace but in the latter form fun and arg
are not visually separated and I find it difficult to read.

fun(a,b,c,d) or fun( a, b, c, d ) are self-consistent, fun(a, b, c, d) is not, IMHO.

Anyway those were meant as recommendations, not rules.

Btw. for renaming I am going to use http://bicyclerepair.sourceforge.net/ within Emacs.

ondrej.certik said, at 2008-07-16T14:49:26.000Z:

> Single letter loops are ok, its just that finding (in an editor) a single letter in > text is difficult as it tends to be included in many other words.

Good editors allow you to search for the word "i", in vim it's the command "*".

As for fun( arg ) x fun(arg) it's just whitespace but in the latter form fun and
arg are not visually separated and I find it difficult to read.

I understand your argument, but I think it's a matter of habit. My argument is above.

fun(a,b,c,d) or fun( a, b, c, d ) are self-consistent, fun(a, b, c, d) is not, IMHO.

My rule is to use a space after ",", so f(a, b, c) is perfectly consistent, while the
others are not. :)

robert.cimrman said, at 2008-07-16T14:55:27.000Z:

Sometimes you have not good editor. But enough - this one is settled.

Yeah, habits. I will have enough problems with getting used to new function names
that I reserve myself the right to call( a, function, this, way ). :)

ondrej.certik said, at 2008-07-16T15:02:06.000Z:

> Yeah, habits. I will have enough problems with getting used to new function names > that I reserve myself the right to call( a, function, this, way ). :)

Sure. I can live with this minor problem for some time. :)

ondrej.certik said, at 2008-07-21T12:49:10.000Z:

Ok, one last problem is the call( a, function, this, way ) stuff. But we agreed to go with it for some time.

BTW, do you require me to use it as well? If I find a free while, I can try to craft
some script that will do the call(a, b, c) <---> call( a, b, c ) transformations
automatically and correctly.

Anyway, this issue is mostly fixed, so I am lowering the priority to medium.

robert.cimrman said, at 2008-07-21T12:59:14.000Z:

Certainly call( a, b, c ) is easier to parse as you can just use split() :)

IMHO we have now better things to do than writing scripts that remove/add two spaces

  • this is a non-issue.

I would prefer if you use also call( a, b, c ) for future stuff, but it is just a
recommendation, just like the others proposed in comment 5.

ondrej.certik said, at 2008-07-21T15:44:33.000Z:

Agree. As long as we will not reject code with one or the other style, it's ok with me. It's a huge improvement over the former state. :)

robert.cimrman said, at 2008-07-21T15:53:15.000Z:

IMHO we could close this general issue, and eventually submit more specific ones related to this topic, e.g. filename vs. file_name.

ondrej.certik said, at 2008-07-21T17:53:46.000Z:

Yep.

configurable output prefix

The prefix 'sfe: ' is curently hardcoded...

Migrated from http://code.google.com/p/sfepy/issues/detail?id=32


earlier comments

robert.cimrman said, at 2008-04-02T15:15:26.000Z:

done.

robert.cimrman said, at 2008-04-02T15:16:24.000Z:

done. use:

from sfe.base.base import setOutputPrefix
setOutputPrefix( 'cool_prefix:' )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.