Skip to content

Systems

System ¤

Bases: ABC

Source code in feniax/systems/system.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
class System(ABC):

    def __init__(self, name: str, settings: data_container.DataContainer):
        """Initialise object representing system of equations

        Parameters
        ----------
        name : str
            Name of the system
        settings : data_container.DataContainer
            system configuration settings

        """

        self.name = name
        self.settings = settings

    @abstractmethod
    def set_ic(self):
        """
        Initial conditions for the system
        """
        pass

    @abstractmethod
    def set_system(self):
        """
        Defines the actual system to be solved based on the inputs
        """
        pass

    @abstractmethod
    def set_solver(self):
        """
        Picks the solver in ./sollibs to solve the system of equations
        """

        pass

    @abstractmethod
    def solve(self):
        """
        Run the solver on the system of equations
        """

        pass

    @abstractmethod
    def build_solution(self):
        """
        Based on the solution states, build any postprecessing fields
        """

    def __init_subclass__(cls, **kwargs):
        assert "cls_name" in kwargs
        super().__init_subclass__()
        if kwargs["cls_name"] in __SYSTEM_DICT__:
            raise ValueError("Name %s already registered!" % kwargs["cls_name"])
        __SYSTEM_DICT__[kwargs["cls_name"]] = cls

__init__(name, settings) ¤

Initialise object representing system of equations

Parameters:

Name Type Description Default
name str

Name of the system

required
settings DataContainer

system configuration settings

required
Source code in feniax/systems/system.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
def __init__(self, name: str, settings: data_container.DataContainer):
    """Initialise object representing system of equations

    Parameters
    ----------
    name : str
        Name of the system
    settings : data_container.DataContainer
        system configuration settings

    """

    self.name = name
    self.settings = settings

build_solution() abstractmethod ¤

Based on the solution states, build any postprecessing fields

Source code in feniax/systems/system.py
54
55
56
57
58
@abstractmethod
def build_solution(self):
    """
    Based on the solution states, build any postprecessing fields
    """

set_ic() abstractmethod ¤

Initial conditions for the system

Source code in feniax/systems/system.py
24
25
26
27
28
29
@abstractmethod
def set_ic(self):
    """
    Initial conditions for the system
    """
    pass

set_solver() abstractmethod ¤

Picks the solver in ./sollibs to solve the system of equations

Source code in feniax/systems/system.py
38
39
40
41
42
43
44
@abstractmethod
def set_solver(self):
    """
    Picks the solver in ./sollibs to solve the system of equations
    """

    pass

set_system() abstractmethod ¤

Defines the actual system to be solved based on the inputs

Source code in feniax/systems/system.py
31
32
33
34
35
36
@abstractmethod
def set_system(self):
    """
    Defines the actual system to be solved based on the inputs
    """
    pass

solve() abstractmethod ¤

Run the solver on the system of equations

Source code in feniax/systems/system.py
46
47
48
49
50
51
52
@abstractmethod
def solve(self):
    """
    Run the solver on the system of equations
    """

    pass