thegooglecodearchive / sfepy

Automatically exported from code.google.com/p/sfepy
0 stars 0 forks source link

improve handling degrees of freedom in inputs #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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...

Original issue reported on code.google.com by robert.c...@gmail.com on 19 Feb 2008 at 3:56

GoogleCodeExporter commented 9 years ago
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?

Original comment by robert.c...@gmail.com on 25 Feb 2008 at 10:16

GoogleCodeExporter commented 9 years ago
Implemented :). Try to test it, please.

Original comment by robert.c...@gmail.com on 25 Feb 2008 at 2:11

GoogleCodeExporter commented 9 years ago
Migrated to http://github.com/sfepy/sfepy/issues/27

Original comment by robert.c...@gmail.com on 30 Jan 2012 at 10:24