Topic: Dof grouping, names, input files, lagrange multipliers

I have several things I'd like to see us work out for Dofs, and they are all related:

1. Input files - I'd like to specify dofs by string names instead of numbers, e.g:

boundarycondition 1 dofs 3 D_u D_v D_w values 3 0. 0. 0.

2. Dof groups - We need to have a way to specify that some dofs should be grouped together when for example computing the residual for NRSolver. D_u, D_v, D_w should all be grouped together as "D".

3. I want names and groups for dynamically created dofs as well, instead of just having X_1, X_2, X_3.

Designwise I'm thinking std::map's stored in the domain which maps
dof_id -> string
dof_id -> dof_group
and we would have a perhaps: "Domain::registerDof(int dofid, std::string name, std::string group)"

When it comes to the predefined dofs, I hate that one needs to maintain a seperate enum. Avoiding this monolithic list would be cleaner and more modular (only the necessary dofs for a given build would need to be present, sort of like how the classfactory works.
But, pratically, we simply need a D_u etc. to refer to, without performance costs, in so many places in the code, that I think maintaining the 2 lists of dofs is worth it (one list being the current DofIDItem enum, and the other being some piece of code that "registers" all these dofs into the maps in the ctor of Domain).

(every domain needs to have these maps, as bcs, xfem, etc. will register new dofs dynamically, even the predefined dofs remain constant)

2

Re: Dof grouping, names, input files, lagrange multipliers

Hi Mikael,
sounds good to me. I would only suggest one potential extension, that could simplify the code. We can introduce group names with name corresponding to DOF IDs (as groups with only one member, being DOF ID). This way we can in many places support individual DOFs and DOF groups with one (DOF group like) code. So, for example, this would be possible:
boundarycondition 1 dofs 1 D values 1 0.
instead of
boundarycondition 1 dofs 3 D_u D_v D_w values 3 0. 0. 0.

(Not sure if this is the optimal example).