On Mon, 4 Aug, 2014 at 2:25 PM, Anders Logg <[email protected]> wrote:
On Thu, Jul 17, 2014 at 09:37:37AM +0100, Chris Richardson wrote:

 It may seem obvious, but I want to be able to attach parameters to a
 Mesh before it calls its 'build' method.
 This is because I need to be able to choose a ghosting strategy in
 parallel (at present it is set by a GlobalParameter).

 I was thinking of adding a constructor which can take a Parameters
 argument to all Mesh constructors (i.e. including all
 the Unit*Mesh constructors).

 Advantages - flexibility, any future set of parameters can be
 accommodated
            - can remove current string arguments, like "diagonal"
 for RectangleMesh

 Disadvantages - user has to create a Parameters object if they want
 to change the Mesh defaults
- cannot constrain set of allowed parameters in advance

 Any alternative suggestions welcome.

Are there more than 1 parameter to set? If not, an option would be to
add a parameter to the constructors with a default value.

I think we're approaching a sustainable solution here:

   https://bitbucket.org/fenics-project/dolfin/issue/67

which resolves another issue too.

I would like to avoid optional arguments. One is ok, but two or more leads to bugs. Some of the mesh constructors already take an optional string argument.

Garth



--
Anders
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to