A better abstraction for parameters
Describing the model then going back and identifying parameters is backwards. A more powerful approach would be to describe potential parameters when creating the model.
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Currently, the main parameter case is InitialConditio
Recall that an initial condition is represented by libadjoint as an additional equation of the form
I u = ic
Suppose now that in setting the initial condition we label ic as a parameter in advance. Something like:
u = Parameter(ic)
Parameter ic would have to return a decorated Function so as not to break forward Dolfin functionality. However when u eventually hits a solve, the presence of a parameter could be recorded. This then establishes the presence of the parameter and would enable dolfin-adjoint routines such as compute_gradient to immediately do the Right Thing.
This has the advantage that a parameter need not just be an explicit initial condition, it could be a coefficient in a form or a boundary condition without much change. I think it must also be possible to extend this to cover time-varying parameters in a nice manner (do Dolfin TimeSeries help here somehow?)