User spcific DefaultFactory

Registered by Felix Ospald

Hi, it would be good to have a mechanism like

class MyLinearAlgebraFactory : public LinearAlgebraFactory
{
....
}

DefaultFactory::set_user_factory(new MyLinearAlgebraFactory());
dolfin::parameters["linear_algebra_backend"] = "user";

or even better:

DefaultFactory::register_user_factory("user", new MyLinearAlgebraFactory());
dolfin::parameters["linear_algebra_backend"] = "user";

This could be done very simply by a static std::map inside DefaultFactory.

this would also allows us to use new solvers within the existing context.
LinearSolver solver("mysolver") ...

or do things like:

class MyLinearAlgebraFactory : public PETScFactory
{
SparsityPattern* create_pattern() const
{
  return new FastSparsityPattern;
}
}

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

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.