festim-dev/FESTIM-workshop

Example: How to create a custom BC, source, trap, etc

Closed this issue · 5 comments

Often users need to create their own custom models.

It would be good to show the process of inheriting from a FESTIM class to override some methods etc

Does this issue also include a custom Newton solver?

It could include it yes.

Although maybe the custom solver could have its own demo?

Initially I was more thinking cases where we want a specific formulation for extrinsic traps or things like this that require to override classes

Although maybe the custom solver could have its own demo?

Sure. I simply wanted to clarify this.

Thus, we need a dedicated issue for the Newton solver demo as well.

In fact there are several examples of when we need to do this:

  • Modelling an enclosure (see this verification case): we had to override the iterate method of Simulation
  • Having a dirichlet BC from tabulated data (see this reply on Discourse)
  • Having temperature from tabulated data (see the same reply)
  • Making a custom boundary condition (see example with a custom recombination coefficient)

Maybe each of them could have its own demo

Actually we have the CustomFlux BC that already does a lot of stuff so many BCs are not the best example for this.

@jhdark was suggesting writing custom derived quantities like including advection for instance.