NumericalForward.py
def evaluate_one_step(self) -> None:
        """
        Simulating one step of the simulation
        Is using already initialised instance variables
        """

        # Evaluate new boundary vector (BC means boundary condition)

        # Assemble vector b (dot() is matrix multiplication)
        self.b = self.b_base.dot(self.T)
        # Apply explicit portion of HeatFlux (Neumann BC 1st node)
        self.b[0] += self.dt*(1-self.theta)*self.HeatFlux[self.current_step_idx]
        # Apply implicit portion of HeatFlux (Neumann BC 1st node)
        self.b[0] += self.dt*self.theta*self.HeatFlux[self.current_step_idx+1]
        # Apply explicit contribution of the body temperature (Robin BC Nth node)
        self.b[-1] -= self.dt*(1-self.theta)*self.robin_alpha*self.T[-1]
        # Apply explicit contribution of the ambient temperature (Robin BC Nth node)
        self.b[-1] += self.dt*(1-self.theta)*self.robin_alpha*self.T_amb[self.current_step_idx]
        # Apply implicit contribution of the ambient temperature (Robin BC Nth node)
        self.b[-1] += self.dt*self.theta*self.robin_alpha*self.T_amb[self.current_step_idx+1]

        # solve the equation self.A*self.T=b
        self.T = spsolve(self.A, self.b)  # solve new self.T for the new step
        self.current_step_idx += 1  # move to new timestep
        self.T_x0[self.current_step_idx] = self.T_x0_interpolator(self.T)  # type: ignore

        # Incrementing time information for the callback
        # We are assuming the self.dt stays the same all the time
        # If self.dt would be changeable, this would need to be reverted
        #   to the previous state of "self.current_t += self.dt",
        #   which however had other disadvantages (as we do not want
        #   the time being incremented when we do inverse problem probes)
        #   - it was firstly solved by passing the boolean value whether
        #     to increment time, but then there were issues with incompatible
        #     signatures of evaluate_one_step() methods in Simulation and
        #     InverseSimulation()
        self.current_t = self.dt * self.current_step_idx

        Simulating one step of the simulation
        Is using already initialised instance variables
        
Simulating one step of the simulation
Is using already initialised instance variables
Simulating one step of the simulation Is using already initialised instance variables
def evaluate_one_step(self) -> None:
        self.b = self.b_base.dot(self.T)
        self.b[0] += self.dt*(1-self.theta)*self.HeatFlux[self.current_step_idx]
        self.b[0] += self.dt*self.theta*self.HeatFlux[self.current_step_idx+1]
        self.b[-1] -= self.dt*(1-self.theta)*self.robin_alpha*self.T[-1]
        self.b[-1] += self.dt*(1-self.theta)*self.robin_alpha*self.T_amb[self.current_step_idx]
        self.b[-1] += self.dt*self.theta*self.robin_alpha*self.T_amb[self.current_step_idx+1]
        self.T = spsolve(self.A, self.b)  
        self.current_step_idx += 1  
        self.T_x0[self.current_step_idx] = self.T_x0_interpolator(self.T)  
        self.current_t = self.dt * self.current_step_idx
def evaluate_one_step ( self ) -> None : self . b = self . b_base . dot ( self . T ) self . b [ 0 ] += self . dt * ( 1 - self . theta ) * self . HeatFlux [ self . current_step_idx ] self . b [ 0 ] += self . dt * self . theta * self . HeatFlux [ self . current_step_idx + 1 ] self . b [ - 1 ] -= self . dt * ( 1 - self . theta ) * self . robin_alpha * self . T [ - 1 ] self . b [ - 1 ] += self . dt * ( 1 - self . theta ) * self . robin_alpha * self . T_amb [ self . current_step_idx ] self . b [ - 1 ] += self . dt * self . theta * self . robin_alpha * self . T_amb [ self . current_step_idx + 1 ] self . T = spsolve ( self . A , self . b ) self . current_step_idx += 1 self . T_x0 [ self . current_step_idx ] = self . T_x0_interpolator ( self . T ) self . current_t = self . dt * self . current_step_idx
Simulating one step of the simulation
Is using already initialised instance variables
Simulating one step of the simulation Is using already initialised instance variables
"""
        Simulating one step of the simulation
        Is using already initialised instance variables
        """ # Evaluate new boundary vector (BC means boundary condition) # Assemble vector b (dot() is matrix multiplication) # Apply explicit portion of HeatFlux (Neumann BC 1st node) # Apply implicit portion of HeatFlux (Neumann BC 1st node) # Apply explicit contribution of the body temperature (Robin BC Nth node) # Apply explicit contribution of the ambient temperature (Robin BC Nth node) # Apply implicit contribution of the ambient temperature (Robin BC Nth node) # solve the equation self.A*self.T=b # solve new self.T for the new step # move to new timestep # type: ignore # Incrementing time information for the callback # We are assuming the self.dt stays the same all the time # If self.dt would be changeable, this would need to be reverted #   to the previous state of "self.current_t += self.dt", #   which however had other disadvantages (as we do not want #   the time being incremented when we do inverse problem probes) #   - it was firstly solved by passing the boolean value whether #     to increment time, but then there were issues with incompatible #     signatures of evaluate_one_step() methods in Simulation and #     InverseSimulation()
self