def QuadField1D(self,solution,quad): #diff = npl.norm(solution.q[1]-q_old[1],1) self._x = solution.x.centers.copy() quad[0,solution.frame] = solution.t quad[1,solution.frame] = sq(solution.q[0]*solution.q[1],solution.x.centers) quad[2,solution.frame] = sq(np.sqrt(solution.q[0]**2 + solution.q[1]**2),solution.x.centers) return quad
def QuadField1D(solution, quad): #diff = npl.norm(solution.q[1]-q_old[1],1) quad[0, solution.frame] = solution.t quad[1, solution.frame] = sq(solution.q[0] * solution.q[1], solution.x.centers) quad[2, solution.frame] = sq(np.sqrt(solution.q[0]**2 + solution.q[1]**2), solution.x.centers) return quad
def QuadField2D(solution,quad): #diff = npl.norm(solution.q[1]-q_old[1],1) quad[0,solution.frame] = solution.t quad[1,solution.frame] = sq(np.sqrt(solution.q[1]*solution.q[2]**2 + (-solution.q[0]*solution.q[2])**2),solution.x.centers) quad[2,solution.frame] = sq(np.sqrt(solution.q[0]**2 + solution.q[1]**2 + solution.q[2]**2),solution.x.centers) return quad