Subversion Repositories slepc-dev

Rev

Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1220 Rev 1229
Line 1139... Line 1139...
-  breakdown - flag indicating that a breakdown has occurred
-  breakdown - flag indicating that a breakdown has occurred
 
 
   Notes:
   Notes:
   The start vector is computed from another vector: for the first step (i=0),
   The start vector is computed from another vector: for the first step (i=0),
   the initial vector is used (see EPSGetInitialVector()); otherwise a random
   the initial vector is used (see EPSGetInitialVector()); otherwise a random
   vector is created. Then this vector is forced to be in the range of OP and
   vector is created. Then this vector is forced to be in the range of OP (only
   orthonormalized with respect to all V-vectors up to i-1.
   for generalized definite problems) and orthonormalized with respect to all
 
   V-vectors up to i-1.
 
 
   The flag breakdown is set to true if either i=0 and the vector belongs to the
   The flag breakdown is set to true if either i=0 and the vector belongs to the
   deflation space, or i>0 and the vector is linearly dependent with respect
   deflation space, or i>0 and the vector is linearly dependent with respect
   to the V-vectors.
   to the V-vectors.
 
 
Line 1159... Line 1160...
PetscErrorCode EPSGetStartVector(EPS eps,int i,Vec vec,PetscTruth *breakdown)
PetscErrorCode EPSGetStartVector(EPS eps,int i,Vec vec,PetscTruth *breakdown)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
  PetscReal      norm;
  PetscReal      norm;
  PetscTruth     lindep;
  PetscTruth     lindep;
 
  STBilinearForm form;
  Vec            w;
  Vec            w;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(eps,EPS_COOKIE,1);
  PetscValidHeaderSpecific(eps,EPS_COOKIE,1);
  PetscValidHeaderSpecific(vec,VEC_COOKIE,3);
  PetscValidHeaderSpecific(vec,VEC_COOKIE,3);
Line 1173... Line 1175...
  } else {
  } else {
    ierr = VecDuplicate(eps->vec_initial,&w);CHKERRQ(ierr);
    ierr = VecDuplicate(eps->vec_initial,&w);CHKERRQ(ierr);
    ierr = SlepcVecSetRandom(w);CHKERRQ(ierr);
    ierr = SlepcVecSetRandom(w);CHKERRQ(ierr);
  }
  }
 
 
  /* Force the vector to be in the range of OP */
  /* Force the vector to be in the range of OP for definite generalized problems */
  ierr = STApply(eps->OP,w,vec);CHKERRQ(ierr);
  ierr = STGetBilinearForm(eps->OP,&form);CHKERRQ(ierr);
 
  if (form == STINNER_B_HERMITIAN) {
 
    ierr = STApply(eps->OP,w,vec);CHKERRQ(ierr);
 
  } else {
 
    ierr = VecCopy(w,vec);CHKERRQ(ierr);
 
  }
 
 
  /* Orthonormalize the vector with respect to previous vectors */
  /* Orthonormalize the vector with respect to previous vectors */
  ierr = EPSOrthogonalize(eps,i+eps->nds,PETSC_NULL,eps->DSV,vec,PETSC_NULL,&norm,&lindep);CHKERRQ(ierr);
  ierr = EPSOrthogonalize(eps,i+eps->nds,PETSC_NULL,eps->DSV,vec,PETSC_NULL,&norm,&lindep);CHKERRQ(ierr);
  if (breakdown) *breakdown = lindep;
  if (breakdown) *breakdown = lindep;
  else if (lindep || norm == 0.0) {
  else if (lindep || norm == 0.0) {