Skip to content

Feature/instationary

René Heß requested to merge feature/instationary into master

Make it possible to solve instationary problems by providing a form called 'mass' in the UFL file. Some notes:

  • The most important change is in cache.py: Deleting the cache did not work. Consider the following minimal example:
    global_dict = {}

    class ModDict(dict):
        def __init__(self, tags):
            dict.__init__(self)
            self.tags = tags

        def __getitem__(self, i):
            # if i == "True":
            #     return True
            return i in self.tags


    def test():
        print eval("True")

        print eval("True", {})

        print global_dict.items()
        print eval("True", global_dict)

        print eval("True", ModDict('test'))

        print eval("not True", ModDict('test'))

        print ModDict('test')["True"]

        print ModDict('test')["Blubber"]

        # print global_dict["True"] -> key error


    test()

The modified dictionary never throws a key error. Instead it always returns False if a key is not found in the tags. Therefore print eval("True", ModDict('test')) returns False!

  • You can switch between implicit and explicit through formcompiler arguments.
  • The time loop in the driver is hard coded. Should be replaced with something smarter in the future. -> Issue
  • In order to test the problems I compare with an exact solution. Easiest way to do that: Chose g and f like in the poisson example. Unfortunately this leads to boring vtk files since everything ist stationary ;).
  • The explicit time stepping has some weird behavior. The reference solution behaves exactly the same and it is not surprising that an explicit time stepping method is not suitable for soling heat equation. Nonetheless I think it is strange how it behaves on the boundary (it doesn't try to satisfy the Dirichlet condition). The cause for that could be:
    1. I'm doing the wrong thing in PDELab.
    2. You shouldn't do explicit instationary CG in PDELab.
    3. Some bug.
  • Probably it is the first option ;).

Merge request reports