sfepy/sfepy — Issue #37: allow 'short' syntax in input files
Author: rc
Created: 2012-01-30 10:24:29+00:00
State: open

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.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=33

earlier comments

ondrej.certik said, at 2008-04-10T08:17:23.000Z:

1. yes, but only when we add explanation to our docs. :)

2. is perfectly fine

robert.cimrman said, at 2008-04-10T08:26:25.000Z:

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.

robert.cimrman said, at 2008-05-02T12:41:28.000Z:

The final missing part (regions) is done. Both long and short version work.