<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear Jose,</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks for your speedy response ... and of course for creating this great software. The</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
VecDuplicateVecs does seem to be the routine I was looking for!</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best wishes,</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dan.</div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> Jose E. Roman <jroman@dsic.upv.es><br>
<b>Sent:</b> Monday, September 2, 2024 7:06 AM<br>
<b>To:</b> dazza simplythebest <sayosale@hotmail.com><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] How to create an array of vectors of type Vec (for use with slepc EPSGetInvariantSubspace)</span>
<div> </div>
</div>
<div style="font-size: 11pt;">You can use VecDuplicateVecs() to create an array of Vec.<br>
Yes, you can use VecLoad() to read the data from a binary file.<br>
<br>
Jose<br>
<br>
<br>
> El 2 sept 2024, a las 8:56, dazza simplythebest <sayosale@hotmail.com> escribió:<br>
><br>
> Dear All,<br>
> I am seeking to perform a large number of eigenvalue calculations (related to a fluid dynamics<br>
> problem) using the slepc framework. I have written the program that calls slepc and validated its solutions against<br>
> known results for special cases - the Jacobi-Davidson iteration seemed to perform best on this problem.<br>
> Since in the 'production-level' calculation I will step through a parameter space which should<br>
> mean only small changes to the eigenproblem between each calculation, it seems to make sense<br>
> to use the previous solution as the initial guess for the next calculation.<br>
><br>
> The sequence to execute this strategy would seem to be:<br>
> To write out the current soln subspace:<br>
><br>
> call EPSGetInvariantSubspace<br>
> [ call VecView -> binary file (if a file storage is required for possible restart)]<br>
><br>
> To then read in this data to use it as the initial subspace for the next run:<br>
><br>
> call EPSSetInitialSpace<br>
><br>
> My question is that EPSGetInvariantSubspace needs an 'array of nconv vectors', how does one create<br>
> such an array ? My understanding is that the Vec structure is just a one-dimensional array (with contents<br>
> possibly scattered in non-contiguous memory locations !?) , so do we just need to create a long Vec<br>
> that stores multiple vectors ? How can we do this (the examples I have seen thus far use a MatCreateVecs to specify the size<br>
> of the Vec)?<br>
><br>
> If loading such a subspace from a binary file (created maybe by VecView), presumably VecLoad is the<br>
> best way to load such an array of vectors from the binary file ?<br>
><br>
> Best wishes and many thanks,<br>
> Dan.<br>
<br>
<br>
</div>
</body>
</html>