This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

create Vector and Matrix

0 votes

Hello,

i want to solve a System Ax=b via

solve(A, x, b)

So i have to create A and b. My first question is:

Whats comm in Vector(comm, N) respectively Matrix(comm,N,N)?

My second question: Do i have to initialize x only with x = Vector() or also with Vector(comm, N)?

And my last question: The Values for A and b came from a List. Via Indexing, i will write the data to A and b. Is there something else to do, like assemble() or assign(), for the solve-command?

I usually solve such Systems in Matlab and for fenics, I only find examples for functions. So I think about an alternative way: I could initalize a scalarfunktion and overwrite the values, but then i also dont know how to initalize A!?

Thanks

asked Oct 28, 2014 by MrCoffeee FEniCS Novice (230 points)

1 Answer

0 votes

Hi!
comm is an the MPI communicator; you can use any constructor, not necessarily that one.

I am interested in the third answer as well, especially in a parallel execution.

answered Oct 29, 2014 by Massimiliano Leoni FEniCS User (1,760 points)
...