Author Topic: Use MatSetNearNullSpace  (Read 6453 times)

arktik

  • Jr. Member
  • **
  • Posts: 46
Use MatSetNearNullSpace
« on: November 20, 2018, 06:44:12 AM »
Dear Administrator, Dear Feap users,

My parallel feap v8.5.2 installation with petsc 3.9.2 has worked without errors for most of my test problems. I have tested the combinations of ksp_type and pc_type also without trouble (as per parmanual.pdf). However, I get the following error with gamg preconditioner. when my problem has ndm=3 and ndf>ndm.
Code: [Select]
[0]PETSC ERROR: Petsc has generated inconsistent data
[0]PETSC ERROR: Don't know how to create null space for ndm=3, ndf=4.  Use MatSetNearNullSpace.
[0]PETSC ERROR: #1 PCSetCoordinates_AGG() line 196 in /home/user/Software/petsc-3.9.2/src/ksp/pc/impls/gamg/agg.c
[0]PETSC ERROR: #2 PCSetCoordinates() line 1876 in /home/user/Software/petsc-3.9.2/src/ksp/pc/interface/precon.c
This happens for user defined elements as well as solid elements from feap's library. To reproduce the error, please see the attached example input file. Is there a solution?
As per https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCGAMG.html, feap has to call MatSetNearNullSpace to indicate the near null space of the tangent operator.

Thanks

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1164
Re: Use MatSetNearNullSpace
« Reply #1 on: November 20, 2018, 07:41:29 AM »
The error is likely related to the fact that we create the Null Space for GAMG using PCSetCoordinates, but it appears that PCSetCoordinates does not know what to do with thermoelasticity (4 dofs per node).  Thus it is asking you to explicitly set the null space.  You need to replace the call to PCSetCoordinates with a call to MatSetNearNullSpace.  I'm not exactly sure what the syntax for this is but you should be able to find some examples in the PETSc tutorials/examples.  Note that we set the block size (MatSetBlockSize) when we create the matrix, so you do not need to do that again.

If you can not figure it out, please post again and we will try to have a look too.

arktik

  • Jr. Member
  • **
  • Posts: 46
Re: Use MatSetNearNullSpace
« Reply #2 on: November 20, 2018, 08:18:24 AM »
MatSetNearNullSpace(MAT, MatNullSpace) takes objects of type MAT and MatNullSpace as two arguments. Inside parfeap/usolve.f, Kmat is a MAT object but there is no MatNullSpace object defined.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1164
Re: Use MatSetNearNullSpace
« Reply #3 on: November 20, 2018, 09:51:02 AM »
Yes that is correct since we instead have been using the PCSetCoordinates method for accomplishing the same thing.  I think you will need to set up the null space yourself.  For thermo-elasticity I am guessing that you will need to set up 6 rigid body mode vectors for the elasticity and then 1 constant vector for the thermal part.

arktik

  • Jr. Member
  • **
  • Posts: 46
Re: Use MatSetNearNullSpace
« Reply #4 on: November 21, 2018, 03:48:51 AM »
Thanks for your response Prof. Govindjee. I have to dig a bit deeper into Petsc routines to set the null space in usolve.f. I will give an update here once it's done.