Assuming one linear system AX=B, where A is a matrix of NxN and B is a vector, A and B are known and vector X is unknown. How to use the linear solver in OpenFoam to solve this linear system?
I thought that two fields of X and B are probably created first as
Info<< "Reading field T\n" <<endl;
while I don't know how to set up B since it is known.
Another question is how to set an equation to solve
If this step is properly handled, it could be easy to set up linear solver and preconditioner in fvSolution
Any idea on this problem?
Argen, X and B creating is just as you showed in the post. Respect the matrix, as far as I know the problem is that fvMatrices in FOAM are ever related to a geometrical problem and its discretization, so that is not possible to create them only from their coefficients and positions in the matrix (Both fvMatrix and lduMatrix don't have constructors from elements and positions). It requires to use the lduAddressing at low level and would require to code your own classes to do so.
Please FOAMers correct me if I'm wrong.
Do you have more suggestions on it?
|All times are GMT -4. The time now is 02:13.|