I am running the attached code. it is about the grain growth using phase field model. But unfortunately its performance in high grid point is not good enough. one the algorithm that is common for improving performance is sparse. I tried it but it looks to have some issues in matrix. I'd be thankful to have suggestion to solve this problem.
suggestion to solve this problem.