On Thu, 17 Jul, 2014 at 9:37 AM, Chris Richardson <[email protected]> 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).

A related issue has come up previosuly:

https://bitbucket.org/fenics-project/dolfin/issue/67/move-building-of-foomesh-to-factory

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

I'm not too keen on passing a Parameter object.


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

Another (possible) disadvantage is when creating lots of lightweight meshes.


Any alternative suggestions welcome.

A typical approach is to have 'generator' classes/functions, i.e. create an empty Mesh, set some options, then generate, or call a specific generator.

Garth


Chris
_______________________________________________
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