Refactoring code
This commit is contained in:
4
pina/problem/__init__.py
Normal file
4
pina/problem/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from .abstract_problem import AbstractProblem
|
||||
from .problem2d import Problem2D
|
||||
from .problem1d import Problem1D
|
||||
from .timedep_problem import TimeDependentProblem
|
||||
19
pina/problem/abstract_problem.py
Normal file
19
pina/problem/abstract_problem.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
|
||||
class AbstractProblem(metaclass=ABCMeta):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def input_variables(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def output_variables(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def conditions(self):
|
||||
pass
|
||||
6
pina/problem/problem1d.py
Normal file
6
pina/problem/problem1d.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from .abstract_problem import AbstractProblem
|
||||
|
||||
|
||||
class Problem1D(AbstractProblem):
|
||||
|
||||
spatial_dimensions = 1
|
||||
6
pina/problem/problem2d.py
Normal file
6
pina/problem/problem2d.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from .abstract_problem import AbstractProblem
|
||||
|
||||
|
||||
class Problem2D(AbstractProblem):
|
||||
|
||||
spatial_dimensions = 2
|
||||
6
pina/problem/timedep_problem.py
Normal file
6
pina/problem/timedep_problem.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from .abstract_problem import AbstractProblem
|
||||
|
||||
|
||||
class TimeDependentProblem(AbstractProblem):
|
||||
|
||||
pass
|
||||
Reference in New Issue
Block a user