sfepy/sfepy — Issue #27: improve handling degrees of freedom in inputs
Author: rc
Created: 2012-01-30 10:24:14+00:00
State: open

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.