I need to develop a FVM code in C (The multiscale FVM method for heterogeneous media). I know that:
- Only uniform rectangular grids will be considered (2d now, later 3d)
Sparse systems will be large
Need to parallelize my code eventually (will be solving local problems on fine grid and use them to solve PDE on coarse grid)
Speed is key
I used Matlab exclusively during my PhD. I am now faced with the challenge of C programming which is new to me.
I fully intend to use existing libraries as much as possible, but I am quite puzzled about my options and to what extent I should use them.
- Must I write my own program and assemble the matrices and then look for solver libraries, or are there alternatives ?
- Which library would you recommend for this? Is PETSC my best choice ? (I couldnt find many sparse solvers in C)
- I looked at GSL, LApack, etc and my question is does using a library entail using only the data types/headers that they offer ? For instance GSL has a vector and matrix header file which seems to have its own data type.
- Even simple steps, like setting a matrix A= B requires several lines of code in C, is there any library that offers some of these basic "matlab" luxuries, basically readymade functions in C for such tasks ?
I realize some of my questions might be very elementary, considering my lack of familiarity with C and the non-adhoc way to program numerical methods. I apologize.
I understand the question is subjective in nature, but your answers will point me in the right direction.