[petsc-users] How to create an array of vectors of type Vec (for use with slepc EPSGetInvariantSubspace)

dazza simplythebest sayosale at hotmail.com
Mon Sep 2 01:56:10 CDT 2024


Dear All,
           I am seeking to perform a large number of eigenvalue calculations (related to a fluid dynamics
 problem) using the slepc  framework. I have written the program that calls slepc and validated its solutions against
 known results for special cases - the Jacobi-Davidson iteration seemed to perform best on this problem.
 Since in the 'production-level' calculation I will step through a parameter space which should
mean only small changes to the eigenproblem between each calculation, it seems to make sense
 to use the previous solution as the initial guess for the next calculation.

 The sequence to execute this strategy would seem to be:
To write out the current soln subspace:

call EPSGetInvariantSubspace
[ call VecView   -> binary file (if a file storage is required for possible restart)]

To then read in this data to use it as the initial subspace for the next run:

call  EPSSetInitialSpace

My question is that EPSGetInvariantSubspace needs an 'array of nconv vectors', how does one create
 such an array ? My understanding is that the Vec structure is just a one-dimensional array (with contents
 possibly scattered in non-contiguous memory locations !?) , so do we just need to create a long Vec
 that stores multiple vectors ? How can we do this (the examples I have seen thus far use a MatCreateVecs to specify the size
 of the Vec)?

If loading such a subspace from a binary file (created maybe by VecView), presumably VecLoad is the
 best way to load such an array of vectors from the binary file ?

 Best wishes and many thanks,
                                            Dan.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240902/b39ee957/attachment.html>


More information about the petsc-users mailing list