I am using petsc to solve a linear elasticity problem discretized by finite elements.The initial mesh is read by a mesh file and the distribution in each processor is done using METIS.I am using only the basics routines from petsc in order to create the submatrices and vectors.After solving I want every processor to write solution in a file.My question is,since petsc re-order the dofs internally(for example processor 0 goes from 0-N etc.) how can I track which dof from initial mesh corresponds to which solution value obtained from petsc solution vector?For example processor 1 has {4,6,8,5,13,9} nodes from initial mesh and the global range of petsc solution vector goes from 5 to 11(using VecGetOwnershipRange).How can I know which value is assigned for node 5?

  • $\begingroup$ I don't understand the question. At some point you are writing into the vector, and you need to know which element you need to write into. This is the point where your code has knowledge about the association of vector elements to nodes. $\endgroup$ – Wolfgang Bangerth Jan 28 at 21:47
  • $\begingroup$ If you partition with Metis, and should have the mapping as a result of that. $\endgroup$ – Victor Eijkhout Jan 30 at 13:56
  • $\begingroup$ I mean that petsc using an internal ordering in order to formulate the system Ax=b. The final solution corresponds to petsc ordering which may differ from the natural ordering $\endgroup$ – Spy123 Jan 30 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.