Hi there,
I'm experimenting with a mixed finite element formulation of the Poisson equation to become more familiar with the terms in SfePy. The equations are
int( v . grad(p) ) + int ( f p ) = 0, int( c u div(q) ) = int( v . q ),
where u is a scalar unknown, v is a vector unknown, p is a scalar test function and q is a vector test function.
I'm getting the error message:
IndexError: material(s) "v" not found!
My code is as follows:
material_1 = { 'name' : 'coef', 'region' : 'Omega', 'values' : {'val' : 1.0}, } material_2 = { 'name' : 'source_term', 'region' : 'Omega', 'mode' : 'function', 'function' : 'source_term_func', } field_1 = { 'name' : 'temperature', 'dim' : (1,1), # First component = # degrees of freedom per node 'flags' : (), 'domain' : 'Omega', 'bases' : {'Omega' : '2_3_P1'} } field_2 = { 'name' : 'grad_temperature', 'dim' : (2,1), 'flags' : (), 'domain' : 'Omega', 'bases' : {'Omega' : '2_3_P2'} } variable_1 = { 'name' : 'u', 'kind' : 'unknown field', 'field' : 'temperature', 'order' : 0, # Appears first in the global vector of unknowns. } variable_2 = { 'name' : 'p', 'kind' : 'test field', 'field' : 'temperature', 'dual' : 'u', # This is a test function corresponding to u. } variable_3 = { 'name' : 'v', 'kind' : 'unknown field', 'field' : 'grad_temperature', 'order' : 1, } variable_4 = { 'name' : 'q', 'kind' : 'test field', 'field' : 'grad_temperature', 'dual' : 'v', # This is a test function corresponding to v. } integral_1 = { 'name' : 'i1', 'kind' : 'v', 'quadrature' : 'gauss_o2_d2', } equations = { 'Temperature1' : """dw_stokes.i1.Omega( v, p ) = dw_volume_lvf.i1.Omega( source_term.val, p )""", 'Temperature2' : """dw_stokes.i1.Omega( q, u ) = dw_volume_lvf.i1.Omega( v, q )""", }
The whole log is:
sfepy: left over: ['source_term_func', 'data_dir', 'nm', '_filename',
'__package__', '__doc__', '__builtins__', 'ebc_sin', '__file__',
'__name__', 'ebc_sin2', 'amplitude']
sfepy: reading mesh (/Users/dpo/local/src/sfepy/meshes/2d/
square_unit_tri.mesh)...
sfepy: ...done in 0.00 s
/Users/dpo/local/lib/python2.6/site-packages/numpy/lib/utils.py:140:
DeprecationWarning: unique1d
is deprecated!
warnings.warn(depdoc, DeprecationWarning)
sfepy: setting up domain edges...
sfepy: ...done in 0.00 s
sfepy: creating regions...
sfepy: Omega
sfepy: Gamma_Top
sfepy: Gamma_Bottom
sfepy: ...done in 0.01 s
sfepy: equation "Temperature2":
sfepy: dw_stokes.i1.Omega( q, u ) = dw_volume_lvf.i1.Omega( v, q )
sfepy: equation "Temperature1":
sfepy: dw_stokes.i1.Omega( p, v ) =
dw_volume_lvf.i1.Omega( source_term.val, p )
Traceback (most recent call last):
File "/Users/dpo/local/src/sfepy/simple.py", line 106, in <module>
main()
File "/Users/dpo/local/src/sfepy/simple.py", line 99, in main
app = SimpleApp( conf, options, output_prefix )
File "/Users/dpo/local/src/sfepy/sfepy/applications/simple_app.py",
line 50, in __init__
**kwargs )
File "/Users/dpo/local/src/sfepy/sfepy/fem/problemDef.py", line 88,
in from_conf
obj.set_equations( conf.equations )
File "/Users/dpo/local/src/sfepy/sfepy/fem/problemDef.py", line 168,
in set_equations
self.materials, user )
File "/Users/dpo/local/src/sfepy/sfepy/fem/equations.py", line 142,
in setup_terms
eq.setup_terms(regions, variables, materials, self.caches, user)
File "/Users/dpo/local/src/sfepy/sfepy/fem/equations.py", line 310,
in setup_terms
self.check_term_args( variables, materials, user )
File "/Users/dpo/local/src/sfepy/sfepy/fem/equations.py", line 260,
in check_term_args
term.check_args(variables, materials, user)
File "/Users/dpo/local/src/sfepy/sfepy/terms/terms.py", line 330, in
check_args
'material(s) "%s" not found!')
File "/Users/dpo/local/src/sfepy/sfepy/base/base.py", line 780, in
check_names
raise IndexError(msg % missing)
IndexError: material(s) "v" not found!
What am I doing wrong?
Thanks! Dominique
-- You received this message because you are subscribed to the Google Groups "sfepy-devel" group. To post to this group, send email to sfepy...@googlegroups.com. To unsubscribe from this group, send email to sfepy-devel...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.