thegooglecodearchive / sfepy

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

allow 'short' syntax in input files #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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}),
}

2. 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.

Original issue reported on code.google.com by robert.c...@gmail.com on 9 Apr 2008 at 4:14

GoogleCodeExporter commented 9 years ago
1. yes, but only when we add explanation to our docs. :)

2. is perfectly fine

Original comment by ondrej.c...@gmail.com on 10 Apr 2008 at 8:17

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

Original comment by robert.c...@gmail.com on 10 Apr 2008 at 8:26

GoogleCodeExporter commented 9 years ago
The final missing part (regions) is done. Both long and short version work.

Original comment by robert.c...@gmail.com on 2 May 2008 at 12:41

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

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