How do you store a discretized 3D domain (for solve PDE) in sparse format, when boundary conditions can change?

StackOverflow https://stackoverflow.com/questions/3110410

Question

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).

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.

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.

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

Was it helpful?

Solution

coordinate reduce row format..it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top