Subversion Repositories slepc-dev

Rev

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

Rev 2319 Rev 2326
Line 220... Line 220...
@*/
@*/
PetscErrorCode QEPSetTolerances(QEP qep,PetscReal tol,PetscInt maxits)
PetscErrorCode QEPSetTolerances(QEP qep,PetscReal tol,PetscInt maxits)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
 
  PetscValidLogicalCollectiveReal(qep,tol,2);
 
  PetscValidLogicalCollectiveInt(qep,maxits,3);
  if (tol != PETSC_IGNORE) {
  if (tol != PETSC_IGNORE) {
    if (tol == PETSC_DEFAULT) {
    if (tol == PETSC_DEFAULT) {
      qep->tol = 1e-7;
      qep->tol = 1e-7;
    } else {
    } else {
      if (tol < 0.0) SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Illegal value of tol. Must be > 0");
      if (tol < 0.0) SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Illegal value of tol. Must be > 0");
Line 315... Line 317...
@*/
@*/
PetscErrorCode QEPSetDimensions(QEP qep,PetscInt nev,PetscInt ncv,PetscInt mpd)
PetscErrorCode QEPSetDimensions(QEP qep,PetscInt nev,PetscInt ncv,PetscInt mpd)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
 
  PetscValidLogicalCollectiveInt(qep,nev,2);
 
  PetscValidLogicalCollectiveInt(qep,ncv,3);
 
  PetscValidLogicalCollectiveInt(qep,mpd,4);
  if( nev != PETSC_IGNORE ) {
  if( nev != PETSC_IGNORE ) {
    if (nev<1) SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Illegal value of nev. Must be > 0");
    if (nev<1) SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Illegal value of nev. Must be > 0");
    qep->nev = nev;
    qep->nev = nev;
    qep->setupcalled = 0;
    qep->setupcalled = 0;
  }
  }
Line 384... Line 389...
@*/
@*/
PetscErrorCode QEPSetWhichEigenpairs(QEP qep,QEPWhich which)
PetscErrorCode QEPSetWhichEigenpairs(QEP qep,QEPWhich which)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
 
  PetscValidLogicalCollectiveEnum(qep,which,2);
  if (which!=PETSC_IGNORE) {
  if (which!=PETSC_IGNORE) {
    if (which==PETSC_DECIDE || which==PETSC_DEFAULT) qep->which = (QEPWhich)0;
    if (which==PETSC_DECIDE || which==PETSC_DEFAULT) qep->which = (QEPWhich)0;
    else switch (which) {
    else switch (which) {
      case QEP_LARGEST_MAGNITUDE:
      case QEP_LARGEST_MAGNITUDE:
      case QEP_SMALLEST_MAGNITUDE:
      case QEP_SMALLEST_MAGNITUDE:
Line 462... Line 468...
@*/
@*/
PetscErrorCode QEPSetLeftVectorsWanted(QEP qep,PetscBool leftvecs)
PetscErrorCode QEPSetLeftVectorsWanted(QEP qep,PetscBool leftvecs)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
 
  PetscValidLogicalCollectiveBool(qep,leftvecs,2);
  if (qep->leftvecs != leftvecs) {
  if (qep->leftvecs != leftvecs) {
    qep->leftvecs = leftvecs;
    qep->leftvecs = leftvecs;
    qep->setupcalled = 0;
    qep->setupcalled = 0;
  }
  }
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
Line 555... Line 562...
@*/
@*/
PetscErrorCode QEPSetScaleFactor(QEP qep,PetscReal alpha)
PetscErrorCode QEPSetScaleFactor(QEP qep,PetscReal alpha)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
 
  PetscValidLogicalCollectiveReal(qep,alpha,2);
  if (alpha != PETSC_IGNORE) {
  if (alpha != PETSC_IGNORE) {
    if (alpha == PETSC_DEFAULT || alpha == PETSC_DECIDE) {
    if (alpha == PETSC_DEFAULT || alpha == PETSC_DECIDE) {
      qep->sfactor = 0.0;
      qep->sfactor = 0.0;
    } else {
    } else {
      if (alpha < 0.0) SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Illegal value of alpha. Must be > 0");
      if (alpha < 0.0) SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Illegal value of alpha. Must be > 0");
Line 601... Line 609...
@*/
@*/
PetscErrorCode QEPSetProblemType(QEP qep,QEPProblemType type)
PetscErrorCode QEPSetProblemType(QEP qep,QEPProblemType type)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
 
  PetscValidLogicalCollectiveEnum(qep,type,2);
  if (type!=QEP_GENERAL && type!=QEP_HERMITIAN && type!=QEP_GYROSCOPIC)
  if (type!=QEP_GENERAL && type!=QEP_HERMITIAN && type!=QEP_GYROSCOPIC)
    SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_WRONG,"Unknown eigenvalue problem type");
    SETERRQ(((PetscObject)qep)->comm,PETSC_ERR_ARG_WRONG,"Unknown eigenvalue problem type");
  qep->problem_type = type;
  qep->problem_type = type;
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
Line 667... Line 676...
.seealso: QEPSetTolerances()
.seealso: QEPSetTolerances()
@*/
@*/
extern PetscErrorCode QEPSetConvergenceTest(QEP qep,PetscErrorCode (*func)(QEP,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*),void* ctx)
extern PetscErrorCode QEPSetConvergenceTest(QEP qep,PetscErrorCode (*func)(QEP,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*),void* ctx)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
 
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  qep->conv_func = func;
  qep->conv_func = func;
  qep->conv_ctx = ctx;
  qep->conv_ctx = ctx;
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
Line 700... Line 710...
@*/
@*/
PetscErrorCode QEPSetTrackAll(QEP qep,PetscBool trackall)
PetscErrorCode QEPSetTrackAll(QEP qep,PetscBool trackall)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
  PetscValidHeaderSpecific(qep,QEP_CLASSID,1);
 
  PetscValidLogicalCollectiveBool(qep,trackall,2);
  qep->trackall = trackall;
  qep->trackall = trackall;
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__