On Sun, Sep 02, 2012 at 11:23:11AM +0100, Garth N. Wells wrote: > On 2 September 2012 11:10, Anders Logg <[email protected]> wrote: > > On Sat, Sep 01, 2012 at 03:09:42PM +0100, Garth N. Wells wrote: > >> The logic around how we handle integration over domains is confusing. > >> I'm trying to fix a small problem which is opening a can of worms. > >> Subdomain data can be optionally passed to the assembler, attached to > >> a Form or attached to a Mesh (the latter being particularly confusing > >> because it's mixing concepts). I suggest that we have just one to do > >> things, and I think the most logical and user friendly is to attach > >> subdomain data to Forms. Opinions? > > > > I agree that the logic is complex, but it is there for a reason. > > > > There are three ways to specify subdomains, by order of increasing > > priority. > > > > First, it can be specified as part of the mesh. This is a good thing > > since it allows markers to be stored as part of Mesh XML files. Very > > useful for Mesh generators and tools like VMTK. > > > > I think that this is very clumsy and mixes concepts. Say I have one > mesh but want to perform two different simulations with different bcs. > It's opaque. What happens if I have markers in a Mesh and markers > attached to a Form -> ambiguous. > > Better would be to store the markers as part of the mesh, but pull > them out and attach them to a form. I was already planning to have > mesh markers in a mesh file that are identified by strings (e.g. > "top", "inner sphere", etc) rather than integers (which are error > prone because they convey no meaning). A user could query which > markers a mesh has (via a set of identifier strings), and attach the > right ones.
Sounds like a good solution. We could add a simple function call for transferring the markers "as is" to the Form, if the mesh is already marked with the correct integers to be used in the Form. A potential problem with this approach is the duplication of data (markers in both Mesh and Form). Possibly, this could be handled with shared pointers. > > Second, it can be specified as part of a Form. This is useful for > > assembling several forms on the same mesh but with different domains. > > > > This is nice. > > > Third, it can be specified explicitly as an argument to the assembler. > > > > If we should cut any of these, I would suggest cutting the third one, > > but I think it is widely used as part of both user code and examples > > so I'm not sure we should cut it. > > > > We have a bug that I'm more interested in fixing simply and robustly > than in preserving a clumsy interface, so I'd cut it. Users can update > their code. We should wait for comments on this one. I can manage without those extra arguments, but I believe others use it. -- Anders _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : [email protected] Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp

