big numpy arrays - out of memory
I'm solving an optimal control problem concerning the Advection Diffusion Equation using FEniCS.
During the calculation I need the QR decomposition of a matrix with size (Number of BasisFunctions) x (Number of Triangles) and I need to invert and transpose matrices. (I'm using Raviart Thomas Finite Elements)
I tried this with the numpy functions and numpy arrays,
but because my matrices are very big, the functions causes "Out of memory" errors.
I wonder if there is an alternative in Fenics for the numpy functions, perhaps using the lapack routines, but I don't know how to use them.
Any advice how I can do this better would be useful.
Here is my Fenics Code:
import numpy as np
from numpy import*
x_max = 154.0 # maximum x-coordinate
y_max = 0.78 # maximum y-coordinate
# define rectangle mesh
mesh = Rectangle(0,0, x_max, y_max, 78, 154)
mesh.order()
U = FunctionSpace(mesh, "Raviart-Thomas", 1)
W = FunctionSpace(mesh, "DG", 0)
psi = TrialFunction(U)
phi = TestFunction(W)
int_psi = phi*div(psi)*dx
Cmat_tr = assemble(int_psi)
C_mat = Cmat_tr.array().T
Q_mat,R_mat = np.linalg.
Q_t = Q_mat.T
R_inv = np.linalg.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- FFC Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Garth Wells
- Solved:
- Last query:
- Last reply: