Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_x(self, size):
if self.disc.meshtype == 'static':
self.nt = int(round(size / self.disc.resolution[0]))
self.nbc = self.disc.resolution[0] + 2*self.nt - 2
discreteop = FractionalTime(
self.alpha, self.geom, self.t_min, self.t_max, self.disc, self.nt, None)
x = discreteop.get_x()
elif self.disc.meshtype == 'dynamic':
self.nbc = 0
# x = np.random.rand(size, 2)
x = sobol_sequence.sample(size + 1, 2)[1:]
x = x * [self.geom.diam, self.t_max-self.t_min] - [self.geom.l, self.t_min]
discreteop = FractionalTime(
self.alpha, self.geom, self.t_min, self.t_max, self.disc, None, x)
x = discreteop.get_x()
y = self.func(x)
return x, y, discreteop
def get_x(self, size):
if self.disc.meshtype == 'static':
self.nt = int(round(size / self.disc.resolution[0]))
self.nbc = self.disc.resolution[0] + 2*self.nt - 2
discreteop = FractionalTime(
self.alpha, self.geom, self.t_min, self.t_max, self.disc, self.nt, None)
x = discreteop.get_x()
elif self.disc.meshtype == 'dynamic':
self.nbc = 0
# x = np.random.rand(size, 2)
x = sobol_sequence.sample(size + 1, 2)[1:]
x = x * [self.geom.diam, self.t_max-self.t_min] - [self.geom.l, self.t_min]
discreteop = FractionalTime(
self.alpha, self.geom, self.t_min, self.t_max, self.disc, None, x)
x = discreteop.get_x()
y = self.func(x)
return x, y, discreteop