<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div>I want to output a VTK file containing Vec which associate with DMPLEX, but I keep getting some errors.</div><div>I use PetscViewerVTKOpen() to create the vtk file.</div><div>Then I saw many examples just use DMCreateGlobalVector() to create the Vec associate with DM.</div><div>However, almost all of them aren't DMPLEX but are DMDA.</div><div>I don't know whether it will cause some problems.</div><div>These is what I write:</div><div><br></div><div>  PetscViewerCreate(PETSC_COMM_WORLD, &viewer);<br></div><div><div>  PetscViewerVTKOpen(PETSC_COMM_WORLD, "vtk_output_test.vtk", FILE_MODE_WRITE, &viewer);</div><div>  DMCreateGlobalVector(dm, &x);</div><div>  VecSetValue();   //Set value for x</div><div>  VecView(x, viewer);</div></div><div><br></div><div>Here is the error output:</div><div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Argument out of range</div><div>[0]PETSC ERROR: Out of range index value 1 maximum 0</div><div>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.10.2, unknown </div><div>[0]PETSC ERROR: ./test3 on a arch-linux2-c-debug named barry-PhysioMech by barry Mon Dec 10 05:52:19 2018</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --download-mumps --download-scalapack --download-ctetgen</div><div>[0]PETSC ERROR: #3 VecSetValues_Seq() line 726 in /home/barry/petsc/src/vec/vec/impls/seq/bvec2.c</div><div>[0]PETSC ERROR: #4 VecSetValues() line 856 in /home/barry/petsc/src/vec/vec/interface/rvector.c</div></div><div><br></div><div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Invalid argument</div><div>[0]PETSC ERROR: Could not classify input Vec for VTK</div><div>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.10.2, unknown </div><div>[0]PETSC ERROR: ./test3 on a arch-linux2-c-debug named barry-PhysioMech by barry Mon Dec 10 05:52:19 2018</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --download-mumps --download-scalapack --download-ctetgen</div><div>[0]PETSC ERROR: #17 DMPlexGetFieldType_Internal() line 134 in /home/barry/petsc/src/dm/impls/plex/plex.c</div><div>[0]PETSC ERROR: #18 VecView_Plex_Local_VTK() line 294 in /home/barry/petsc/src/dm/impls/plex/plex.c</div><div>[0]PETSC ERROR: #19 VecView_Plex_Local() line 335 in /home/barry/petsc/src/dm/impls/plex/plex.c</div><div>[0]PETSC ERROR: #20 VecView_Plex() line 382 in /home/barry/petsc/src/dm/impls/plex/plex.c</div><div>[0]PETSC ERROR: #21 VecView() line 590 in /home/barry/petsc/src/vec/vec/interface/vector.c</div></div><div><br></div><div>I think the first part of the error comes from VecSetValue(), but I don't know how to fix it.</div><div>And I totally don't know what its mean in the second part of the error.</div><div><br></div><div>Thank you,</div><div>Barry</div></div></div></div></div></div>