Hi all,
Problem description file and error output below. I don't understand what this error means or why I am getting it. At this point I'm still trying to learn my way around sfepy and I'm not 100% comfortable with the underlying math either. So this file might not make sense as far as what it appears to be trying to model, and my error could be in the code or in the math itself.
I'm running the problem description file using simple.py from within a tmux session on Ubuntu 14.04 in anaconda. The anaconda environment uses python 2.7 so that mayavi will also work.
Thanks in advance for any help.
-Yoni
Problem description:
filename_mesh = sfepy_dir + '/meshes/2d/square_quad.mesh'
regions = {
'Omega': 'all',
'Gamma_Top': ('vertices in (y == 0.4)', 'facet'),
'Gamma_Bottom': ('vertices in (y == -0.5)', 'facet'),
'Gamma_Left': ('vertices in (x == -0.5)', 'facet'),
'Gamma_Right': ('vertices in (x == 0.4)', 'facet')
}
fields = {
'head': ('real', 1, 'Omega', 1),
'reservoir_height': ('real', 1, 'Omega', 1)
}
variables = {
'u' : ('unknown field', 'head', 0, 1),
'l' : ('test field', 'head', 'u'),
'h' : ('unknown field', 'reservoir_height', 0, 1),
'l2' : ('test field', 'reservoir_height', 'h'),
}
ebcs = {
'u1' : ('Gamma_Left', {'u.0' : 2.0}),
'u2' : ('Gamma_Right', {'u.0' : -2.0}),
'u3' : ('Gamma_Top', {'u.0' : 5.0}),
'u4' : ('Gamma_Bottom', {'u.0' : 0.0})
}
integrals = {
'i' : 2
}
materials = {
'storativity' : ({'name': 'S',
'values': {'val' : 1.0}}),
'HParam': ({'name': 'hp',
'values': {'val' : 0.2}})
}
equations = {
'diffusion' :
"""
dw_volume_dot.i.Omega(S.val, l, du/dt)
= dw_electric_source.i.Omega(S.val, l2, h)
"""
}
solvers = {
'ts' : ('ts.simple', {
't0' : 0.0,
't1' : 10.0,
'dt' : None,
'n_step' : 11, # Has precedence over dt.
}),
'newton' : ('nls.newton', {
'i_max' : 1,
'eps_a' : 1e-10,
}),
'ls' : ('ls.scipy_direct', {}),
}
Error:
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/script/simple.py", line 184, in <module>
main()
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/script/simple.py", line 177, in main
app = PDESolverApp(conf, options, output_prefix)
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/applications/pde_solver_app.py", line 137, in __init__
self.problem = Problem.from_conf(conf, init_equations=is_eqs, **kwargs)
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/discrete/problem.py", line 173, in from_conf
obj.set_equations(conf.equations, user={'ts' : obj.ts})
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/discrete/problem.py", line 464, in set_equations
variables = Variables.from_conf(self.conf_variables, self.fields)
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/discrete/variables.py", line 156, in from_conf
var = Variable.from_conf(key, val, fields)
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/discrete/variables.py", line 847, in from_conf
special=special, key=key, history=history)
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/discrete/variables.py", line 1338, in __init__
special, flags, **kwargs)
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/discrete/variables.py", line 878, in __init__
self._set_kind(kind, order, primary_var_name, special=special)
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site- packages/sfepy/discrete/variables.py", line 887, in _set_kind
raise ValueError('order %d already used!' % order)
ValueError: order 0 already used!
Hi Yoni,
On 07/23/2017 09:04 PM, Yoni Teitelbaum wrote:
Hi all,
Problem description file and error output below. I don't understand what this error means or why I am getting it. At this point I'm still trying to learn my way around sfepy and I'm not 100% comfortable with the underlying math either. So this file might not make sense as far as what it appears to be trying to model, and my error could be in the code or in the math itself.
I'm running the problem description file using simple.py from within a tmux session on Ubuntu 14.04 in anaconda. The anaconda environment uses python 2.7 so that mayavi will also work.
Thanks in advance for any help.
-Yoni
Problem description:
<snip>
variables = { 'u' : ('unknown field', 'head', 0, 1), 'l' : ('test field', 'head', 'u'), 'h' : ('unknown field', 'reservoir_height', 0, 1),
This should be:
'h' : ('unknown field', 'reservoir_height', 1),
'l2' : ('test field', 'reservoir_height', 'h'), }
In unknown variables ('unknown field'), the third item in the tuple is the order of that variable in the global vector - each unknown has to have a different value, starting from zero up to the number of unknowns - 1. The last (fourth) item in the tuple is the history length (number of time steps to remember prior to current step) - you do not need to specify it for 'h', as you do not have a time derivative of 'h' in your equations. See also [1].
r.
I found the answer to this, thank you. The problem is that in the variable h, the value of the <spec> argument (0) is the same as the corresponding value for u. Changing it to the <spec> argument for h to 1 fixes the problem.
On 23 July 2017 at 22:04, Yoni Teitelbaum <ytbaum@gmail.com> wrote:
Hi all,
Problem description file and error output below. I don't understand what this error means or why I am getting it. At this point I'm still trying to learn my way around sfepy and I'm not 100% comfortable with the underlying math either. So this file might not make sense as far as what it appears to be trying to model, and my error could be in the code or in the math itself.
I'm running the problem description file using simple.py from within a tmux session on Ubuntu 14.04 in anaconda. The anaconda environment uses python 2.7 so that mayavi will also work.
Thanks in advance for any help.
-Yoni
Problem description:
filename_mesh = sfepy_dir + '/meshes/2d/square_quad.mesh'
regions = {
'Omega': 'all',
'Gamma_Top': ('vertices in (y == 0.4)', 'facet'),
'Gamma_Bottom': ('vertices in (y == -0.5)', 'facet'),
'Gamma_Left': ('vertices in (x == -0.5)', 'facet'),
'Gamma_Right': ('vertices in (x == 0.4)', 'facet')
}
fields = {
'head': ('real', 1, 'Omega', 1),
'reservoir_height': ('real', 1, 'Omega', 1)
}
variables = {
'u' : ('unknown field', 'head', 0, 1),
'l' : ('test field', 'head', 'u'),
'h' : ('unknown field', 'reservoir_height', 0, 1),
'l2' : ('test field', 'reservoir_height', 'h'),
}
ebcs = {
'u1' : ('Gamma_Left', {'u.0' : 2.0}),
'u2' : ('Gamma_Right', {'u.0' : -2.0}),
'u3' : ('Gamma_Top', {'u.0' : 5.0}),
'u4' : ('Gamma_Bottom', {'u.0' : 0.0})
}
integrals = {
'i' : 2
}
materials = {
'storativity' : ({'name': 'S',
'values': {'val' : 1.0}}),
'HParam': ({'name': 'hp',
'values': {'val' : 0.2}})
}
equations = {
'diffusion' :
"""
dw_volume_dot.i.Omega(S.val, l, du/dt)
= dw_electric_source.i.Omega(S.val, l2, h)
"""
}
solvers = {
'ts' : ('ts.simple', {
't0' : 0.0,
't1' : 10.0,
'dt' : None,
'n_step' : 11, # Has precedence over dt.
}),
'newton' : ('nls.newton', {
'i_max' : 1,
'eps_a' : 1e-10,
}),
'ls' : ('ls.scipy_direct', {}),
}
Error:
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-packages/sfepy/script/simple.py", line 184, in <module>
main()File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-packages/sfepy/script/simple.py", line 177, in main
app = PDESolverApp(conf, options, output_prefix)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/applications/pde_solver_app.py", line 137, in __init__
self.problem = Problem.from_conf(conf, init_equations=is_eqs, **kwargs)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/problem.py", line 173, in from_conf
obj.set_equations(conf.equations, user={'ts' : obj.ts})File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/problem.py", line 464, in set_equations
variables = Variables.from_conf(self.conf_variables, self.fields)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 156, in from_conf
var = Variable.from_conf(key, val, fields)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 847, in from_conf
special=special, key=key, history=history)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 1338, in __init__
special, flags, **kwargs)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 878, in __init__
self._set_kind(kind, order, primary_var_name, special=special)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 887, in _set_kind
raise ValueError('order %d already used!' % order)ValueError: order 0 already used!
On 07/24/2017 09:15 PM, Yoni Teitelbaum wrote:
I found the answer to this, thank you. The problem is that in the variable h, the value of the <spec> argument (0) is the same as the corresponding value for u. Changing it to the <spec> argument for h to 1 fixes the problem.
Good! See also my response to your question that I had sent to the mailing list [1].
r. [1] https://mail.python.org/mm3/archives/list/sfepy@python.org/message/45RWJA2A3...
On 23 July 2017 at 22:04, Yoni Teitelbaum <ytbaum@gmail.com> wrote:
Hi all,
Problem description file and error output below. I don't understand what this error means or why I am getting it. At this point I'm still trying to learn my way around sfepy and I'm not 100% comfortable with the underlying math either. So this file might not make sense as far as what it appears to be trying to model, and my error could be in the code or in the math itself.
I'm running the problem description file using simple.py from within a tmux session on Ubuntu 14.04 in anaconda. The anaconda environment uses python 2.7 so that mayavi will also work.
Thanks in advance for any help.
-Yoni
Problem description:
filename_mesh = sfepy_dir + '/meshes/2d/square_quad.mesh'
regions = {
'Omega': 'all',
'Gamma_Top': ('vertices in (y == 0.4)', 'facet'),
'Gamma_Bottom': ('vertices in (y == -0.5)', 'facet'),
'Gamma_Left': ('vertices in (x == -0.5)', 'facet'),
'Gamma_Right': ('vertices in (x == 0.4)', 'facet')
}
fields = {
'head': ('real', 1, 'Omega', 1),
'reservoir_height': ('real', 1, 'Omega', 1)
}
variables = {
'u' : ('unknown field', 'head', 0, 1),
'l' : ('test field', 'head', 'u'),
'h' : ('unknown field', 'reservoir_height', 0, 1),
'l2' : ('test field', 'reservoir_height', 'h'),
}
ebcs = {
'u1' : ('Gamma_Left', {'u.0' : 2.0}),
'u2' : ('Gamma_Right', {'u.0' : -2.0}),
'u3' : ('Gamma_Top', {'u.0' : 5.0}),
'u4' : ('Gamma_Bottom', {'u.0' : 0.0})
}
integrals = {
'i' : 2
}
materials = {
'storativity' : ({'name': 'S',
'values': {'val' : 1.0}}),
'HParam': ({'name': 'hp',
'values': {'val' : 0.2}})
}
equations = {
'diffusion' :
"""
dw_volume_dot.i.Omega(S.val, l, du/dt)
= dw_electric_source.i.Omega(S.val, l2, h)
"""
}
solvers = {
'ts' : ('ts.simple', {
't0' : 0.0,
't1' : 10.0,
'dt' : None,
'n_step' : 11, # Has precedence over dt.
}),
'newton' : ('nls.newton', {
'i_max' : 1,
'eps_a' : 1e-10,
}),
'ls' : ('ls.scipy_direct', {}),
}
Error:
File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-packages/sfepy/script/simple.py", line 184, in <module>
main()File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-packages/sfepy/script/simple.py", line 177, in main
app = PDESolverApp(conf, options, output_prefix)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/applications/pde_solver_app.py", line 137, in __init__
self.problem = Problem.from_conf(conf, init_equations=is_eqs, **kwargs)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/problem.py", line 173, in from_conf
obj.set_equations(conf.equations, user={'ts' : obj.ts})File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/problem.py", line 464, in set_equations
variables = Variables.from_conf(self.conf_variables, self.fields)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 156, in from_conf
var = Variable.from_conf(key, val, fields)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 847, in from_conf
special=special, key=key, history=history)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 1338, in __init__
special, flags, **kwargs)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 878, in __init__
self._set_kind(kind, order, primary_var_name, special=special)File "/home/yoni/anaconda3/envs/mayavi_env/lib/python2.7/site-pac kages/sfepy/discrete/variables.py", line 887, in _set_kind
raise ValueError('order %d already used!' % order)ValueError: order 0 already used!
SfePy mailing list sfepy@python.org https://mail.python.org/mm3/mailman3/lists/sfepy.python.org/
participants (2)
-
Robert Cimrman -
Yoni Teitelbaum