tmp commit - toward 0.0.1

This commit is contained in:
Your Name
2021-11-29 15:29:00 +01:00
parent beae301a58
commit fb16fc7f3a
38 changed files with 2790 additions and 1 deletions

27
pina/tdproblem1d.py Normal file
View File

@@ -0,0 +1,27 @@
import numpy as np
from .problem1d import Problem1D
from .segment import Segment
class TimeDepProblem1D(Problem1D):
def __init__(self, variables=None, bc=None, initial=None, tend=None, domain_bound=None):
self.variables = variables
self._spatial_dimensions = 2
self.tend = tend
self.tstart = 0
if domain_bound is None:
bound_pts = [bc[0] for bc in self.boundary_conditions]
domain_bound = np.array([
[min(bound_pts), max(bound_pts)],
[self.tstart, self.tend ]
])
self.domain_bound = np.array([[-1, 1],[0, 1]])#domain_bound
print(domain_bound)
self.boundary_conditions = (
(Segment((bc[0][0], self.tstart), (bc[1][0], self.tstart)), initial),
(Segment((bc[0][0], self.tstart), (bc[0][0], self.tend)), bc[0][1]),
(Segment((bc[1][0], self.tstart), (bc[1][0], self.tend)), bc[1][1])
)