title: How do you store a discretized 3D domain (for solve PDE) in sparse format, when boundary conditions can change?
body: <p>I am looking at solving a problem that is a PDE, and the 3D discretized domain can have a different boundary condition on each of the 6 boundaries (or all the same).</p>
  
  <p>What is the best way to put this sparse matrix into a compressed format? Is CSR going to be my only option here? I thought about using ellpack, but I am not sure how that works for changing boundary conditions.</p>
  
  <p>Thinking about the 2D matrix representation of the 3d space...it will be primarily diagonally dominant with 7 diagonals, but those diagonals will potentially change along the boundaries. Doesnt seem like I can use a format where I store the values, and an offset from the diagonal that is the same every time.</p>
  
  <p>Obviously i am trying to set this problem up  to be more cache friendly for my CG solver which is doing a lot of vector-matrix multiply</p>